The original wireless temperature sensor module that I built at the end of October is still happily working away proving that the concept of a very minimal wireless node works and that it is quite happy running from two AA batteries.
There were a couple of factors that influenced the previous boards design that meant is was less than ideal, firstly the need to remove the RFM12B when programming using a 5V FTDI cable complicated things and due to Royal Mail dragging their feet and my impatience to get the thing built I only had a piece of stripboard 18 rows high which necessitated placing the RFM12B alongside the ATmega instead of in line with it .
Now, armed with new supplies of stripboard and some new ideas I’ve made a new improved and smaller (40x65mm) board. To resolve the voltage issue I decided to make a small adapter board which contains a voltage regulator and smoothing caps (I didn’t want to put these on the main board in order to keep it as minimal as possible) and I’ve also moved the capacitor and pull up resistor for the reset on to this board meaning the TempTX (as I’ve been calling it) now requires two less components and a little less space. Of course only one adapter is required for as many of the TempTX nodes that are used so in the long run the saving of components required and time to build will make more sense. This adapter also allowed me to re-order the programming pins on the main board which further reduced the number of links required and therefore the space required. Other than using a resonator instead of the crystal and load capacitors I think this is as minimal as this board is going to get. I suppose you could omit the programming header and program the ATmega in another board but that’s probably taking minimalism a bit too far.
One thing I overlooked in the original design was that the DS18B20 temperature sensor was constantly powered up, so even when the ATmega was put to sleep it was still sat there wasting power, they don’t draw much power when idle but every little helps so I’ve changed this in the new design by connecting the power pin to an output that is only turned on long enough to get a reading, turns out this is only around 840ms.
Smaller, simpler and more efficient; The TempTX V2:
I’ve also cleaned up the code and updated it for Arduino IDE 1.0, adding plenty of comments along the way and removed a rogue delay that was causing the previous version to stay awake for longer than required for each reading. To further reduce the power consumption I’ve changed the time between each reading to once a minute as every 10 seconds was a bit over the top on reflection. That and the other improvements mean it is now only fully active for around 900ms out of every minute, for the rest of time the RFM12B is in standby, the DS18B20 is off and the ATmega is in low power mode waiting for the watchdog timer to wake it.
I’ve done some measurements and it is drawing approx 7mA for the 900ms it is awake and the idle current is too low for my cheap meter to read (its going to be in the µA range). Should have some nice improvements on the already good battery life.
I’ve also run some tests on the voltage required to keep it running and it seems to run fine until it drops below 2.71V. I’ve put a fresh set of batteries in and will see how long it runs, don’t expect an update on that any time soon!
Here is a picture of the FTDI to TempTX adapter and one with it connected.
The code is available on GitHub here and this is the code I’m running on a NanodeRF (actually a Nanode 5 with an RFM12B) to upload the readings from these and the sensors I’ve built into my graphical displays to my installation of emoncms.
Here is a screenshot of emoncms showing power usage and readings from 5 temperature sensors.
Cost to build one of the TempTX units is approx £12 (a couple of pounds less while I still have some of the cheap ATmegas that I bought when Proto-PIC had them on special offer) and that is almost all the cost of the ATmega, RFM12B and DS18B20.
Parts list for the TempTX:
Stripboard min 15 holes x 24 rows (40x65mm)
ATmega328P-PU with Arduino bootloader
28 pin DIL socket
2 x 22pF ceramic capacitors
DS18B20 temperature sensor
2 AA Battery holder
5 pin right angle male header
3 pin header & connector for sensor (optional)
Wire for links
Wire for antenna (165mm for 433MHz or 82mm for 868MHz)
Parts list for the programming adapter:
Stripboard min 10 holes x 6 rows
6 pin right angle male header (with one pin pulled out)
5 pin right angle female header
MCP1702-33 voltage regulator
10uF electrolytic capacitor
3 x 100nF ceramic capacitors
2 x 10K resistor