Wednesday, February 19, 2014

Space Heater Thermostat Project.

New project for a new year...

There are links in this blog. Words you might know, or not. Most of the links go to WikiPedia, "the free online encyclopedia". I'm a big fan of WikiPedia.

WikiPedia is edited by the general public, with some organizational oversight for consistency. To be sure, with hotly contested subjects, like religion or politics, there are actual "editing wars" going on continually but I feel pretty confident in the quality of entries on the sciences and technology.

   I do tinker with with my own Arduino ATMega2560  board, and a loaned Texas Instruments MSP-430G2553 board. Both of these are microcontroller boards.

   Both boards use an Integrated Development Envionment or IDE, which is in this case a free software download. The Texas Instruments I IDE, Energia, is a near clone of the preceeding Arduino IDE, both based on Wiring.

   Both let you create programs in an interpreted language (very similar in syntax to C++ or so I understand) that provides functions, data types, constants and conditional logic statements to get information, act on it in a defined way and provide outputs to the real world, to control electrical/electronic devices.

    These IDEs function to allow you to write code (referred to as "sketches") in an easy way and a compiler to turn your code into machine language, which is sent to the memory of the microcontroller on the board.
You can make your sketches public, share them as many are.

   What can these microcontroller boards do? Microcontrollers are at the heart of the controls of just about any modern gadjet that has a keypad and a display....the television, the remote controls you use, the microwave, dishwasher, clothes washer, dryer, house thermostat, your home security system, to name only a few. Want to build your own Home Automation system? You could do that now.

   Your car has at least one microcontroller, assuming it's 1980s or newer --- its Electronic Control Module or ECM. As you may be aware, these automotive microcontrollers are becoming the new hardware hacking frontier...for hot rodders old and new.

   Getting back on subject, these hobbyist-oriented microcontroller boards can be easily connected to additional circuits that are also inexpensive, well documented and easily constructed. And from there, you can connect to and control a wide range of devices, bring in information from sensors, connect to the internet...it's a techno-geek's dream come true.

   This is the power to create, put into the hands of the general public...google Maker culture sometime if you want a little tour of technology as seen from the hobbyist's and tinkerer's point of view.




   Here's a picture of my Arduino and a Radio Shack breadboard plus some other goodies attached to a wooden board.  I like recycling lumber too!



The breadboard can receive 5 Volts DC from the Arduino itself or (more normally) I supply power to the breadboard separately from a (you guessed it, recycled) ATX computer power supply, which will probably show up in other photos "to be uploaded soon". Otherwise, all the current would have to be supplied either through the USB cable itself, or some battery pack connected to the Arduino.

That electric motor you see came from a discarded inkjet printer I took apart. This arrangement of stuff has very little to do with the project, except that I tend to hammer out the kinks on the Arduino board first before trying to port it over to the TI board, which is far smaller and pinned out differently (it's got a different microcontroller, but still does much the same job with far less "unused computing power" than the Arduino offers.

   Eventually I hope to incorporate that LCD display and that rotary encoder board visible in the above photo into my project. The knob to allow manually ajusting the the heat ouptut level and the LCD to display both a measure temperature AND the current setpoint applied, using either the manual knob or by communicating with the microcontroller board via old school serial port, Ethernet or WiFi, or I2C, or infrared (think of all the discarded electronics that use IR remote controls...you can guess where I want to go with that!)

    There is a LOT of example code for these very popular microcontroller boards, both supplied as part of the free IDE downloads themselves and also by a LOT of people producing and sharing their own code online.

(List some Links)

   After I got some LEDs to blink on my Arduino, I spent a lot of time looking at You Tube videos of all the cool things people have been doing with these microcontroller boards, but only recently have I attempted to make something myself.

   Someone gave me a "broken" electric space heater...basically a 1500 watt hair dryer on steroids --- it has a  fan, some electric heating coils, an adjustable bimetallic thermostat control, which had simply worn itself out.



CYA Disclaimer...Please Read!

Okay, I need to mention that hooking up hobby boards to real world devices designed to run on household current can present a number of safety issues.

The manufacturers of these appliances do a LOT of research, design, & testing to get them Underwriters Laboratories (UL) approved--and generally shielding themselves from any possible lawsuit BEFORE their product gets into the hands of the consumer.

What I'm doing here is deconstructing and re-designing this device.

That means all bets off, we're off the map, here be dragons, etc. etc.

PROCEED YOUR OWN RISK.   I hope that's clear.

I can't over-emphasize the importance of knowing what you are doing, or having someone around who does, should you decide to try any of this. I'll describe it as best I can for you but

Please Remember to BE CAREFUL.

Now that you've read and understood, please read on. :)


This picture is the only one I can find that shows the original space heater...so I include it here.
(The front cover has already been removed)


Also note the ATX power supply I mentioned earlier...on the bench there next to my Arduino
It was converted to a utility DC power supply. It can deliver 3.3, 5, -12, +12 volts, well regulated and
with good current capability.

Description of the Space Heater


   This space heater, as manufactured, had  several built-in safety devices and features.

 First, a tip switch that disconnects the heater coils if the heater itself gets tipped over.
Second, the fan will continue running until the unit is either switched off or loses power.

Did you notice I mentioned a device (the switch) and a feature (fan keeps running to cool things off)?

   Second, there are two temperature cutoff devices on the heating coils themselves ... one is a mechanical bimetallic switch, normally closed, opens around 160 degrees F.

   There is also a self resetting thermal fuse in series with the bimetallic switch. These devices protect from overheating, by opening a switch in response to high temperature, shutting the heater coils off until the temperature drops to a safe level again.

   Feature: If the fan were to stop running, the heater coils would get hot, not TOO hot of course, and shut off.  However, there are conditions where the heating coils could cool down enough to reset the switch and start heating again.

   It's an appliance with a very low price point, and I feel a conscious choice was made here, to save money at the expense of  providing some "mechanical reset"...a button a person would have to push BEFORE that coil could be re-energized. Human intervention. Take a look around and decide if it's wise to try turning it back on.

   I wanted to replace the worn-out thermostat on this broken space heater with  a thermostatic control cobbled up on  my Arduino.  Seemed like a simple thing to do...and so began another project..

   In general terms, if you want to control something, you have to measure it first. I used a thermistor (10K ohm, NTC) for my temperature sensor.

   Again, in keeping with my intent to recycle and re-use tech junk, this thermistor was salvaged from a non-working color laserjet printer.

   I easily found example sketches for reading a thermistor...and it seemed to work! Nice to get some success on the first try.

   And I used a (loaned) solid state relay or SSR as a way to use my Arduino's low voltage outputs to control the heater coils.


In this picture I've switched over to the TI LaunchPad and a smaller breadboard.
Note the ATX power supply feeding 3.3 Volts to the breadboard.

   I point with pride to the fact that the board, the metal ductwork, the aluminum heat sink on the Solid State Relay, and the screws holding it together are salvaged materials.

   The heat sink is one I didn't sell as scrap aluminum from recycling old computers.

   The metal duct, legs and "floor"...I got out my tin snips and cut pieces from metal HVAC ductwork -- construction waste.

   The control panel was saved from the original space heater...there's an On/Off switch.
There is also a Fan switch that selects "always on" and "on only when heating", and
a Heater switch that selects LOW or HIGH...one heater coil or both together.

   I got all these goodies out of the plastic cage they came in and put them all on a board. The original attempt was pretty quick and dirty.

   After some good-natured ribbing by friends I showed it to...(one comment was "looks like an accident waiting to happen!")...I took the hint and rebuilt it with more safety features.

   It has a grounded power cord, a fuse, metal parts grounded, fan blades and heater coils enclosed to protect errant fingers...I feel I can continue now with far less risk.





No comments:

Post a Comment