My Slim 2AA Battery Node
-
@betonishard said:
Hello all,
I have been struggling with this for a couple of weeks now and I just can seem to figure out a good way to upload sketches to the arduio328p-pu. First of all I use this setup;
I use arduino for mac 1.6.5
I use a breadboard with a crystal, two capacitors and a resistor between reset and 5v.
An arduino to burn bootloader (with the chip inserted and sketch arduinoISP uploaded).
I use the same hex files as you guys with 1a. I used the optiboot 9600 BOD, just the 9600 and the 4800. Uploading the bootloader is no problem at all. Arduino ide burns the bootloader without any problems. However when I try to upload the sketches I get different errors. The “Yikes” version in which it states that my device signature is not ok and programmer not responding. I use upload using programmer.So, I tried to upload the arduino uno version to rule out all miscabling. So what I did was upload the arduino uno bootloader, tried to upload the blink sketch afterwards and it works. So my cables are ok….
I thought to repeat the exact same process with the boot version above. However no succes, I keep getting stuck at uploading sketches. Is it just not possible?
I read about setting the fuse options and I read that when you define these in the boards.txt, they will be set as the fuseparameters. When I check the boards txt above i see that fuse settings are: L0x62,H0xde,E0x07, however when I open the png file (first post, fuse settings) it states L0x62,H0xDE,E0xFF. Furthermore the lockbits are at 0xCF, compared to the boards.txt 0x2F. What is true and how should I set these. I don’t see a possibility in arduino ide (I use another arduino to upload, so I don’t have a tiny or USBASP.
Help would be much appreciated here because I have like 30 boards sitting catching dust.
Hi, i had the same problem, but then i tried the 1b hex and since i burned this it works for me.
@meddie said:
@betonishard said:
Hello all,
I have been struggling with this for a couple of weeks now and I just can seem to figure out a good way to upload sketches to the arduio328p-pu. First of all I use this setup;
I use arduino for mac 1.6.5
I use a breadboard with a crystal, two capacitors and a resistor between reset and 5v.
An arduino to burn bootloader (with the chip inserted and sketch arduinoISP uploaded).
I use the same hex files as you guys with 1a. I used the optiboot 9600 BOD, just the 9600 and the 4800. Uploading the bootloader is no problem at all. Arduino ide burns the bootloader without any problems. However when I try to upload the sketches I get different errors. The “Yikes” version in which it states that my device signature is not ok and programmer not responding. I use upload using programmer.So, I tried to upload the arduino uno version to rule out all miscabling. So what I did was upload the arduino uno bootloader, tried to upload the blink sketch afterwards and it works. So my cables are ok….
I thought to repeat the exact same process with the boot version above. However no succes, I keep getting stuck at uploading sketches. Is it just not possible?
I read about setting the fuse options and I read that when you define these in the boards.txt, they will be set as the fuseparameters. When I check the boards txt above i see that fuse settings are: L0x62,H0xde,E0x07, however when I open the png file (first post, fuse settings) it states L0x62,H0xDE,E0xFF. Furthermore the lockbits are at 0xCF, compared to the boards.txt 0x2F. What is true and how should I set these. I don’t see a possibility in arduino ide (I use another arduino to upload, so I don’t have a tiny or USBASP.
Help would be much appreciated here because I have like 30 boards sitting catching dust.
Hi, i had the same problem, but then i tried the 1b hex and since i burned this it works for me.
@meddie @betonishard I guess I know the solution. Yesterday I begun creating my nodes with the same setup and faced the same issue. When You upload your sketch, choose your board, and the important thing which will solve the "Yikes" error, is to choose "Arduino as ISP" not "ArduioISP". You will find it under Tools > Programmer.
Another thing. If you are chip is the one which comes with the arduino UNO, then you have to add a crystal at the first time when you change the bootloader. According to what I read yesterday (and this solved an issue also which I faced) that the chip is already configured to use external crytsal. Thus (for the first time only), I tried adding a 20 Mhz, and 10Mhz as I didn't have 16Mhz, and surprisingly both configurations worked :)
let me know please if that helps.
-
its the fuse, which defines the rising time. the oscillator needs some time to come to the correct frequency. If you dont wait this time its possble that your sketch dont work correctly. But the microcontroller is the 65 ms longer not in sleep mode and need more battery power. but works more stable.
@meddie THanks for the answer.
Can you please also explain your final result to reach 4uA. I have also the same problem and current is 90uA and sometimes drops to 20uA, then rises again. Thanks.
Edit: I figured out that I was using the 3.3v from arduino UNO. CHanged to two 1.5 batteries. THe current drops to 1.4uA when contact is open but sometimes it is also 15 uA. And when contact is closed it is 60 uA, and sometimes drops. Don't know why it is not stable.
Edit 26.1.2016: I managed to reach 1.4uA with door opened, and 15uA when closed. I guess the problem was with the wiring. DOn't really know but I used a battery holder instead. I will try to rechange the resistor value to 1Mohm and reupdate.
Edit 27.1.2016: ok I created another node and connected the contact sensor in series with the 1Mohm and the output is the voltage divider. now it is 1.4uA when open and 4.6uA when closed.
Thanks
-
Board releases
(other colors might be selected when ordering)- Version 2.0 (black) [order] Now designed in KiCad. "Final release". I'm not developing it further atm, but I know others have some projects going.
- Version 1.4 (red) My latest version in Eagle. Known issues are wrong references due to panelization and broken circuit diagram links.
- Version 1.2 (blue) Some less convienient placed components and the panelized verision has a faulty via.
- Version 1.0 (green) The one described below in this first post. Working but not panelized and lacks a few features.
Share stats and info
The panelized versions 2.0, 1.4 and 1.2 have until today (2019-02-24) been shared 230 (!) times at boardhouse. Together with a few shares of the non-panelized version and my own orders, and the usual 3x10-11 boards/order, it means a lot of boards! Guess very few build nodes with every board, but at least the design should be well proven by now. This also means a few $ to MySensors.org, since 1 $/order will be donated. Great thanks to everyone who has orderd this board! I'll keep this share-info updated for transparency purposes. IMPORTANT: Please understand that DirtyPCBs.com is a non-profit community service, with a lot of manual support required. So please be patient and nice to their support in general. A new site is under development. Read more at their support site. EDIT 2017-06-22: Despite the new site it is still a hassle every time to get a reply from them and then the share credits. If anyone have some more info on this, please let me know.Introduction
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 except from a few links further below. 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. A few links to sensor examples based on this node will be presented further down in this post.Features
- Simple, in the sense that it consists of a minimum number of components and common available material.
- Cheap regarding choice of components, assembly work effort, energy storage and power consumption (battery type and life time).
- Flexible universal design base equipped with various sensors. PCB pads used as port connections or prototyping area for extensions.
- Small and discrete to fit in confined spaces and to reach WAF level
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- The APM width is too big.
- APM has no prototyping/near connection area. There's no spare pads for separate connections unless you accept to use pads connected to softwise inactive ports.
- Radio module connection has to be manually made to the APM.
- Low power hacks like removing power led and voltage regulator are needed.
- Necessary support components (resistors and capacitors) are few and can easily be added to a custom pcb.
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 this precompiled bootloader from here. It's an Optiboot with 1MHz internal clock and 9600 baud serial communication. Fuse changed to BOD disable. According to this 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 this new board to my "boards.txt". Fuse settings, don't forget to set the lock bits. If programming a large batch, the ELF production file is handy.
Here's a great tutorial for those who use Arduino Uno as ISP.
UPDATE 1: Today (2017) a lot has happen since I wrote about this. Some things has made it easier for us. A very good selection of precompiled bootloaders is now found here at MySensors. And you don't need to (and shouldn't) mess with the boards.txt any more. Instead I recommend the installation of MiniCore to the Arduino IDE.
UPDATE 2: There have been reported issues with MySensors 2.x freezing on SlimNodes running at 1MHz, which I've confirmed. Recommended solution when using MyS 2.x, is to use 8MHz (internal) instead.The Radio
A standard NRF24L01+ radio module is used. The width align with the AAs and no mods is needed (like with my other one). As always I try to keep the antenna part of the module free from shading metal.
2020-12-14: On using RFM69 - here's a hint from @joaoabs at this page: I've been troubleshooting this slimnode with RFM69 radios and realized that a shunt between RFM69's DIO0 and Mega328's INT0 is required, otherwise the node will not "hear" the gateway. Even if the nrf2rmf69 board is used this shunt is required. It seems this is a re-current issueThe 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.
Latest design files are open and available at the openhardware.io site. Please click on the image-link below to access openhardware.io where all design files such as latest BOM, kicad-files and circuit diagram (pdf) are found.
https://www.openhardware.io/view/10/My-Slim-2AA-Battery-NodeBoard (v2.0) Top Side:

Board (v2.0) Bottom Side:

The Enclosure
UPDATE: If you dont't like my primitive casing descibed below, in this post the user @buxtronix made a nice 3D-printed case which you can find here.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 turn out (see below) that the enclosure's functionality as battery holder wasn't needed even though it was the initial idea. The cable duct 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 for consumers (here in Sweden at least). Eg. to get it, you have to pay >5$/m from places like this or buy it in bulk (50m) from a professional store (preferably as a professional with discount). The 50m bulk batch will give you 263 sensor nodes of standard length (19cm).
Standard consumer dimension cable duct is e.g. 15x15mm from what I've seen. It'd be nice to design a 2AAA node in that one. If only there is a thin radio module? (Future project.)


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.)- Start by taping the two (connecting) batteries together.
- Prepare the wires and make a small bun at the battery connecting ends.
- Attach the wires with tape.
- Tighten the cable ties and carefully note
- that the wires are pressed to make good contact with the battery poles
- how the cable tie ends must be placed to not steal lateral space
- that the wire from the bottom must be routed near the cable tie to not steal space.
- Make the pack more rigid by taping one or two times around at the top, bottom and middle.
- Trim wires and solder the female connector. If desired, leave at least a small part of one wire naked for current measurements.
A battery change is done fast when cables a already made (use solid wires that preserves its shape). So why pay for a battery holder when you can remake a pack with fresh batteries in 1-2 min and your low power sensor will live 5-10 years before anything needs to be done?

The Interface/Connections
Convenient there's the 6 pin standard 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 pads for the ICSP pins. The idea was to have a socket for the radiomodule 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 Gnd and Vcc in this end of the board for general purpose.The Sleep Mode Power Consumption
I measured the sleep mode current draw to be 1.5uA when it's set to interrupt wake up and 5.8uA when it's set to timer wake up.

Sensor Examples and more
Reed Switch Sensor: post 116
Humidity Sensor: Slim Node Si7021 sensor example
Motion Sensor 1: Slim Node as a Mini 2AA Battery PIR Motion Sensor
Motion Sensor 2: Slim CR123A (2AA) battery node..
Scene Controller: Slim Node scene controller/ keypad
(work in progress to collect more examples here)Not Sensor exemples, but some nice to see "node variations" from @AWI:
Here (post 88) and here (post 233). And now there's also @AWI 's My Slim 2AA Battery Node Tools.Still not "slim" enough? Check out Very Narrow and Minimal Switch Node ! by @GertSanders
And also, there's this 5V-slim-node a 5V-slim-node mod by @Soloam
Feature Requests
Here's a collection of suggestions and development ideas for future versions of the board (or other parts). If anyone else make their own board where some of this is included, I'd be happy to reference it from here.- Pin labels/references also on board top side.
- Turn the nRF footprint to make the assembly shorter.
- Make the board suitable for the nRF SMD version.
More Pictures
Some photos. First a comparison next to My (old) 2AA battery sensor, one painted and one not. (Note the high WAF of the colour even without the paint.) Then some placement examples. Reed switch nodes for all my doors and windows are my first priority.

@m26872 said:
Board releases:
- Version 2.0 (black) [order] Now designed in KiCad. Hopefully the "final" release.
Well, can I ask an update ? It's about the labels, couldn't we have them on the two faces ? It's always good to know where are Vcc and Gnd at first eye I think.
After all, the atmega and nrf are the only components that can't move to the other side. But even there, knowing the digital and analog pin should be useful ! -
My PCBs have just arrived and I was going to build a couple of sensors but can´t figure out the first part of how to burn the bootloaders.
For starters can I just use one of the PCBs and solder the atmega socket and a 6 pin header near the nrlf-radio headers? And use this with a Atmega-programmer ?or do I need to solder any more components?
I tried with both a usbasp and a USBtinyISP but could not get any new device to show up in the arduino IDE. But I don´t know if it is a software issue with win10 or if it is hardware related.
-
I've made it with that link: http://www.gammon.com.au/breadboard with no cristal.
-
My PCBs have just arrived and I was going to build a couple of sensors but can´t figure out the first part of how to burn the bootloaders.
For starters can I just use one of the PCBs and solder the atmega socket and a 6 pin header near the nrlf-radio headers? And use this with a Atmega-programmer ?or do I need to solder any more components?
I tried with both a usbasp and a USBtinyISP but could not get any new device to show up in the arduino IDE. But I don´t know if it is a software issue with win10 or if it is hardware related.
@Cliff-Karlsson Apart from the 2x3pin AVRISP you also need to supply power (battery?) Maybe easiest by the 1x6pin FTDI Vcc and Gnd pins. No other components should be needed.
-
@m26872 said:
Board releases:
- Version 2.0 (black) [order] Now designed in KiCad. Hopefully the "final" release.
Well, can I ask an update ? It's about the labels, couldn't we have them on the two faces ? It's always good to know where are Vcc and Gnd at first eye I think.
After all, the atmega and nrf are the only components that can't move to the other side. But even there, knowing the digital and analog pin should be useful !@Pierre-P said:
@m26872 said:
Board releases:
- Version 2.0 (black) [order] Now designed in KiCad. Hopefully the "final" release.
Well, can I ask an update ? It's about the labels, couldn't we have them on the two faces ? It's always good to know where are Vcc and Gnd at first eye I think.
After all, the atmega and nrf are the only components that can't move to the other side. But even there, knowing the digital and analog pin should be useful !I think I'll collect "improvements" in a list. I agree that some labels could be added, but I don't think it's enough for a new board release.
Also the boardhouse credit collection (which becomes MySensors donations) will be scattered and smaller if there's many versions and branches. -
@m26872 said:
AVRISP
Ok so the AVRISP does not provide any power even as it is self powered from usb?
-
@m26872 said:
AVRISP
Ok so the AVRISP does not provide any power even as it is self powered from usb?
@Cliff-Karlsson At least that's how my programmer works (Avrisp MkII). I think it's a thing to not interfere when it's programmed "in circuit".
-
@m26872. Thanks for the design, very nice.
On your posted picture of the GY-21, why have you added extra resistors? The Gy-21 has it's own pull ups 4.7k for the i2c bus, so additional resistors are not required!
I removed the voltage regulator from the gy-21 board as well (detailed elsewhere in the forum) to save a little extra power. The only caveat to this is you've got to remember to remove the radio and gy-21 when programming using the usbtinyisp or usbasp as they run at 5v which could damage them.
I'm using the (hallard) breakout board for the rfm69cw which has a much better range than the nrf24's (no idea why people use these unless they live in a rabbit hutch)
Anyway, thanks once again for sharing.
Glen.
-
@m26872. Thanks for the design, very nice.
On your posted picture of the GY-21, why have you added extra resistors? The Gy-21 has it's own pull ups 4.7k for the i2c bus, so additional resistors are not required!
I removed the voltage regulator from the gy-21 board as well (detailed elsewhere in the forum) to save a little extra power. The only caveat to this is you've got to remember to remove the radio and gy-21 when programming using the usbtinyisp or usbasp as they run at 5v which could damage them.
I'm using the (hallard) breakout board for the rfm69cw which has a much better range than the nrf24's (no idea why people use these unless they live in a rabbit hutch)
Anyway, thanks once again for sharing.
Glen.
-
@m26872. Thanks for the design, very nice.
On your posted picture of the GY-21, why have you added extra resistors? The Gy-21 has it's own pull ups 4.7k for the i2c bus, so additional resistors are not required!
I removed the voltage regulator from the gy-21 board as well (detailed elsewhere in the forum) to save a little extra power. The only caveat to this is you've got to remember to remove the radio and gy-21 when programming using the usbtinyisp or usbasp as they run at 5v which could damage them.
I'm using the (hallard) breakout board for the rfm69cw which has a much better range than the nrf24's (no idea why people use these unless they live in a rabbit hutch)
Anyway, thanks once again for sharing.
Glen.
@betgear My guess is that the main reason for people to use nRF24 is because the MySensors support for RFm69 came rather recently.
Edit: For me it's the price. I buy 20(!!!) pcs nRF24 for the price of one RFm69. Main reason is different shipping costs.
-
I just need to ask one more time so that I am absolutley clear abot the bootloader burning. I still cant figure out how to do this with my USBtiny.
First of all my USBtiny provides 3.3 or 5v does it matter what voltage that I provide?
And If I just place the ISCP (?) header and atmega socket I do not need to solder any more components or provide any more power to make the circut complete? -
I just need to ask one more time so that I am absolutley clear abot the bootloader burning. I still cant figure out how to do this with my USBtiny.
First of all my USBtiny provides 3.3 or 5v does it matter what voltage that I provide?
And If I just place the ISCP (?) header and atmega socket I do not need to solder any more components or provide any more power to make the circut complete?@Cliff-Karlsson said:
First of all my USBtiny provides 3.3 or 5v does it matter what voltage that I provide?
No, as long as it's only the Atmega there.
And If I just place the ISCP (?) header and atmega socket I do not need to solder any more components or provide any more power to make the circut complete?
Yes, correct. (ICSP)
-
I just need to ask one more time so that I am absolutley clear abot the bootloader burning. I still cant figure out how to do this with my USBtiny.
First of all my USBtiny provides 3.3 or 5v does it matter what voltage that I provide?
And If I just place the ISCP (?) header and atmega socket I do not need to solder any more components or provide any more power to make the circut complete?@Cliff-Karlsson Forgot to add that there is already a bootloader on that requires external crystal, you have to add it before to get it work.
-
Ok thanks for the info. So if I do not have any crystals it is not possible to burn the bootloader in any way?
-
@Cliff-Karlsson Forgot to add that there is already a bootloader on that requires external crystal, you have to add it before to get it work.
@m26872 said:
@Cliff-Karlsson Forgot to add that IF there is already a bootloader on that requires external crystal, you have to add it before to get it work.
(the important word "if" dropped out. )
-
Ok thanks for the info. So if I do not have any crystals it is not possible to burn the bootloader in any way?
@Cliff-Karlsson said:
Ok thanks for the info. So if I do not have any crystals it is not possible to burn the bootloader in any way?
No, not if its fuses are set for external crystal.
-
An ATMEGA328 coming from ATMEL is normally set to use the internal oscillator and has no bootloader. You will then have no need to put a crystal.
I do this anyway on my breadboard (for the 28 pin DIP versions).
If you have the SMD version of the atmega328 (the AU variant), I'm assuming it is set in the same default state (no crystal needed, running on internal oscillator).
-
Ok thanks for the info. So if I do not have any crystals it is not possible to burn the bootloader in any way?
@Cliff-Karlsson i added 10 Mhz and it worked as I didnt have 16 Mhz. Also tested with 20Mhz and worked