A homemade thermostat up in the basement rafters controls the heating in my home. The smart bit is the radio frequency communication that connects it to a remote temperature sensor.
So, I'm planning a home automation system based around wireless nodes of my own design: the Magic Mote featuring a MSP430G2553 low power microcontroller plus NRF24L01+ 2.4 GHz radio module. (PCBs now available on Tindie!) Part of the motivation for doing this is that the wires between the furnace in the basement and the thermostat 2 floors up have broken and it's a terrible nuisance to fish new wires in a 100 year old house with knob and tube wiring inside the walls.
I hacked together this little relay box to control the furnace. Active low set and reset lines from microcontroller govern a 2-coil latching relay that switches the 24 VAC line to the furnace contactor. The box is powered by a 8.5 VAC doorbell transformer. The doorbell wires run conveniently adjacent to the furnace control lines in the basement. A bridge rectifier and 1000 uF cap convert that to about 11 VDC, enough to power the relay coils, which is dropped down to 5 V using a zener diode for output to a microcontroller.
I made a hideous mess of soldering to the perfboard, having both omitted to breadboard the circuit and misread the relay datasheet. The saving grace was having used 2x turned pin DIP8 sockets to mount the relay. More bodges followed. The resistor R1 was included to protect the zener diode for maximum life, but its value was unnecessarily large. When I modified the circuit to include a 3.3 V LDO voltage regulator I put a second resistor in parallel with R1 to bring the combined resistance down to somewhere around 100 Ω.
These little project boxes from Rapid were very handy, but slightly too small for this job. They were a good size for the wireless nodes though, and the aluminium lid might make a great ground plane for a dipole aerial.
This Magic Mote featured a DHT22/AM2303 temperature and humidity sensor connected to the 4-pin header. From its perch on top of the old thermostat in the 2nd floor hallway the RF transceiver had sufficient range to reach its counterpart in the basement.
The firmware is at an early stage of development. Communication is one way. The wireless node transmits temperature and humidity readings every 2 seconds. For purposes other than demonstration a much slower frequency would be sensible to improve battery life. The LEDs blink green for successful transmission or flash orange if the transfer goes unacknowledged. The receiver decodes the message and controls the furnace relay according to a simple rule. The set temperature is hardcoded to 18 °C with a dead band of half a degree either side.
I am indebted to Spirillis for his excellent msprf24 library which interfaces the Nordic module and is superbly documented in the wiki. The DHT22 is read using an interrupt driven routine by TheDZhon ported to C.
This demo is just a first step on the way to a more comprehensive home automation system. The plan is to use a BeagleBone to coordinate a network of sensors and appliances, interacting via a browser client and logging data to the web.