@joaoabs said in My Slim 2AA Battery Node:
Thx! Done!
N.B. Updated info and description to this project will be found here in first post of the projects MySensors forum thread.
Board releases:
Summary
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.
Features
And more concrete:
The uC
Hardware A "bare bones" ATMega328p 28pin PDIP (with or without socket). Bought from here and here. My reasons to not use Arduino Pro Mini here are
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.
The Radio
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.
The Board
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.
The Enclosure
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.)
The Interface/Connections
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