thermostat.py

I’ve got temperature management of the MPU6050 working using my protopi.

Thermostat plot

Thermostat plot

Circuitry is identical to that shown previously:

Mosfet switch

Mosfet switch

Load is a 50Ω SMD resistor.  The MOSFET is a BS170, and the 100k is just one I had knocking around from a project 15 years ago (more in that in a few weeks).

Here’s the physical build with the 50Ω resistor attached to the MPU6050 with thermal tape and the red and black wires connecting it back to MOSFET.

Protopi with thermostat

Protopi with thermostat

Here’s the code.

This has worked pretty well but with a few compromises:

  • I had to use a 50Ω resistor as the next lowest in the series was 10Ω; that limits the current, and hence heating effect of the resistor
  • Probably as a result, the system couldn’t attain the desired temperature of 40°C – lowering the target to 30°C worked as the graph shows.
  • It took five minutes for the temperature to stabilize at 30°C, partly because of the lower heating power of the 50Ω resistor, but also I suspect because the breakout and breadboard were sinking heat away from the MPU-6050.

Still proof of concept was successful.  There were various changes I had to make to the exiting PID code that I’ll have to merge in with qc.py carefully, but hopefully that means I can calibrate her at a constant temperature.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.