When I first set up my Raspberry Pi thermostat project, I was collecting temperature on an Arduino with RN-XV wifi module for communicating with the Raspberry Pi. This worked well enough to get things started, but was far from ideal. First off, the RN-XV put off some heat that would show up by as much as +5 degrees on the temperature sensor (significantly less when putting the module to sleep). Second, the price of the RN-XV was somewhat prohibitive, coming in at $35 each from Sparkfun, and that's not even including the supporting Arduino. I'd like to monitor temperature in multiple rooms and maybe even set up zones, so a minimum of $35 in each room is a tad steep. Third, powering the thing meant having it tethered to an outlet somewhere.
I wanted a cheap, wireless, battery operated sensor that I could place anywhere in the house. In addition, I wanted it to look more or less like it belonged there. So I've been putting in a fair amount of time recently to develop a new circuit board.
For wireless communication, I'm using the easy to find and unbelievably cheap nRF24L01+ module (black daughter PCB in images above). I found on eBay a set of 10 for a little over $12. The micro controller is an ATTINY84 running on the 1MHz internal oscillator. On the sensor side, I have space for a DS18B20 and TMP36 temperature sensors (presumably you would only use one or the other) and a HIH5030 humidity sensor. For power, I use a single LR44 button cell battery with a MCP1640 boost converter to boost the voltage to 2.7V. I have estimated the battery life to be somewhere in the 6 month to 1 year range using sleep modes where ever possible, but that's yet to be confirmed. I have set up the micro to be able to read the battery voltage to be able to send out a low battery warning.
You may be wondering about the shape of the PCB. Like I said above, I wanted this to look like it belongs in my house when installed. The various holes on the ends allow it to mount inside a standard electrical box under any of the common size face plates (I would not recommend putting it in the same box where house mains power is present). When used with a light switch face plate, the sensors are positioned to be directly behind the small rectangular opening to allow for good air flow to the sensors.
Software on here was a lot more difficult than I was planning on, mainly due to the wireless module. The ATTINY84 does not have a dedicated SPI bus, so I was forced to learn how to communicate to the nRF24L01+ in software via bit-banging. I did get it figured out, though, and things seem to be working fine now. As far as the programming language, I found this site that explained how to get it up and running in the Arduino IDE, and most Arduino functions work on the ATTINY84 as expected. It does require an ISP programmer to upload the code. I would highly recommend buying a dedicated programmer, but a spare Arduino can be made to work in a pinch.
There are about $10 of components on the board including the wireless module, but not including any of the sensors (a TMP36 is fairly cheap, but the other two are pricey). This is my first version of this PCB and its far from perfect (as you can see in the images above), so I'm not going to put this one for sale just yet. I do have a load of these boards though, so if you want to play with it send me a message and we'll work something out.