N.B. Updated info and description to this project will be found here in first post of the projects MySensors forum thread.
This project describes a successor Node concept to my first 2AA battery sensor. I have combined a few simple design options to a result that I find rather useful myself and I think should be shared. The application specific sensor/-s of your own choice has to be added to this Node design, nor here any example sketches provided here. I use this design for all my door and window reed switches, temperature (calibrated internal or thermistor), LDR and similar simple sensor types. But, nothing prevents the use of more sophisticated sensors like Si7021 here as well. Infact here's a recent example.
And more concrete:
Software Since I prefer Arduino IDE for programming (flash) and debugging, I need a bootloader. Bootloader instructions are found all over the internet, but here's anyway how I do it. I use the "atmega328_1a.hex"(attached file) precompiled bootloader from here. It's an Optiboot with 1MHz internal clock and 9600 baud serial communication. Fuse changed to BOD disable. According to Gammon you should use minimal startup time to reduce power in every 8s sleep cycle, but for the moment I don't care and stick to the default 65ms. I use Avrisp mkII avr programmer for fuse and bootloading similar to this procedure. Arduino as ISP, Avr/USBtiny or whatever any other should of course be just as good. Avr Studio 4.19 is a good choice for Avrisp mkII (perhaps for others too) and 4.19 is the last version before the gigantic (and for me useless) IDEs were released. I add the new board to my "boards.txt" (see attached add_to_boards.txt). Fuse settings (see attached 1MHz_optiboot_1a_-9600.png), and don't forget to set the lock bits (see attached lockbits.png). If programming a large batch, the ELF production file (see attached ELFwredring.PNG) is handy.
A standard NRF24L01+ radio module is used. The width align with the AAs and no mods necessary (like with my old node). As always I try to keep the antenna part of the module free from shading metal.
At first I planned the build on a proto board, just to stick to the cheap-and-standard concept. But with today's low prices on custom made PCBs, it wasn't any longer an option. Space, quality and work effort are so much more attractive. The board is tested (as a normal working MyS node) but not long term or thoroughly (every pad/port interference etc) so I leave no guarantees.
An important overall part of this design idea was to align minimum dimensions of the components and get rid of "expensive" parts like battery holder. It turns out (see below) that the enclosure's functionality as battery holder wasn't needed even though it was the initial idea. The mini trunking case has been discussed earlier, but rejected by some due to lack of ways to seal the endings. I still haven't the perfect solution, but I've since many years simply used (cheap) white tape. With some care it looks ok, and still does 5-10 years later. There are often proper terminators/endings to buy, but for some reason to unrealistic high prices. I used this cable duct with the dimension 17x20mm. Unfortunately it turned out that this particular type I used (Thorsman TMK T20) is now "professional grade" and dimension 17x20 is no longer very commercially available (read cheap) for consumers (here in Sweden at least). Professional stores sell it for 3.5-5.5$/m (preferably as a professional with discount). The 50m bulk batch could give some discount, but will give you 263 sensor nodes of standard length (19cm).
The Battery pack
Easy home made 2AA battery pack. Maybe it looks more demanding and time consuming than it is. (Usually its the other way around in my experience.)
Convenient there's the 6 pin standard FTDI serial interface exactly like on the Arduino Pro Mini. Perhaps it's mirrored here, but I think everybody double checks Gnd and Vcc before connecting. The Vcc and Gnd pins also serves as a connector for the battery pack. (CTS is connected to GND on the PCB.) "Under" the radiomodule are 3x2 pads for the AVR-ICSP pins. The idea was to have a socket for the nRF24L01+ instead of the "expensive" 328p socket and still have easy future access to the SPI/ICSP interface. Perhaps not very useful. But nice to have extra Gnd and Vcc pads in this end of the board for general purpose.
The Sleep Mode Power Consumption
Sleep mode current is
|Qty||Value||Device||Package||Parts||Description||MF||MPN||Aliexpress or Ebay link|
|3||0.1uF||Capacitor||pitch 5.08mm||C1,C2,C3||Ceramic, multilayer, 50V, and low enough profile (to fit inside the uC socket)||AliExpress: https://www.aliexpress.com/item//1910742794.html|
|1||0.1uF||Capacitor||pitch 2.54mm||C5||Ceramic, disc, 50V||AliExpress: https://www.aliexpress.com/item//32287196145.htm...|
|1||4.7uF||Capacitor||Radial pitch 2.54mm||C4||Electrolytic capacitor, 50V||AliExpress: https://www.aliexpress.com/item//32335055073.htm...|
|1||uC||DIP-28||IC1||Atmega328p 28P DIP||AliExpress: https://www.aliexpress.com/item//32410666546.htm...|
|1||IC socket||DIP-28||IC1||DIP-28 socket||AliExpress: https://www.aliexpress.com/item//32272069253.htm...|
|1||FTDI port||P2||Angled 6 pin header for serial connector||AliExpress: https://www.aliexpress.com/item//32327255068.htm...|
|1||nRF24L01+||module||P4||nRF24L01+ 2.4GHz Antenna Wireless Transceiver Module||AliExpress: 10PCS NEW NRF24L01+ 2.4GHz Antenna Wireless Tran...|
|1||10k||Resistor||(throught hole)||R1||0.25W Resistor Carbon or Metal film, 1% or 5%||AliExpress: https://www.aliexpress.com/item//32311042252.htm...|
|add to boards.txt||1.15 kB||1634|
|rev1||5 years ago||2||50 × 50|