My Slim 2AA Battery Node
-
@meddie
The pull up 1MOhm resistor should go from Vcc - resistor - D2
The switch should be connected to D2 and Gnd
D2 needs to be defined as INPUT, no need to add the statement with PULLUP.
Post your sketch so we can have a look. -
/** * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * DESCRIPTION * * Interrupt driven binary switch example with dual interrupts * Author: Patrick 'Anticimex' Fallberg * Connect one button or door/window reed switch between * digitial I/O pin 3 (BUTTON_PIN below) and GND and the other * one in similar fashion on digital I/O pin 2. * This example is designed to fit Arduino Nano/Pro Mini * */ #include <MySensor.h> #include <SPI.h> #define SKETCH_NAME "Binary Sensor" #define SKETCH_MAJOR_VER "1" #define SKETCH_MINOR_VER "0" #define PRIMARY_CHILD_ID 3 #define SECONDARY_CHILD_ID 4 #define PRIMARY_BUTTON_PIN 2 // Arduino Digital I/O pin for button/reed switch #define SECONDARY_BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch #if (PRIMARY_BUTTON_PIN < 2 || PRIMARY_BUTTON_PIN > 3) #error PRIMARY_BUTTON_PIN must be either 2 or 3 for interrupts to work #endif #if (SECONDARY_BUTTON_PIN < 2 || SECONDARY_BUTTON_PIN > 3) #error SECONDARY_BUTTON_PIN must be either 2 or 3 for interrupts to work #endif #if (PRIMARY_BUTTON_PIN == SECONDARY_BUTTON_PIN) #error PRIMARY_BUTTON_PIN and BUTTON_PIN2 cannot be the same #endif #if (PRIMARY_CHILD_ID == SECONDARY_CHILD_ID) #error PRIMARY_CHILD_ID and SECONDARY_CHILD_ID cannot be the same #endif MySensor sensor_node; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED); MyMessage msg2(SECONDARY_CHILD_ID, V_TRIPPED); void setup() { sensor_node.begin(); // Setup the buttons pinMode(PRIMARY_BUTTON_PIN, INPUT); pinMode(SECONDARY_BUTTON_PIN, INPUT); // Activate internal pull-ups digitalWrite(PRIMARY_BUTTON_PIN, HIGH); digitalWrite(SECONDARY_BUTTON_PIN, HIGH); // Send the sketch version information to the gateway and Controller sensor_node.sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER"."SKETCH_MINOR_VER); // Register binary input sensor to sensor_node (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. sensor_node.present(PRIMARY_CHILD_ID, S_DOOR); sensor_node.present(SECONDARY_CHILD_ID, S_DOOR); } // Loop will iterate on changes on the BUTTON_PINs void loop() { uint8_t value; static uint8_t sentValue=2; static uint8_t sentValue2=2; // Short delay to allow buttons to properly settle sensor_node.sleep(5); value = digitalRead(PRIMARY_BUTTON_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value sensor_node.send(msg.set(value==HIGH ? 1 : 0)); sentValue = value; } value = digitalRead(SECONDARY_BUTTON_PIN); if (value != sentValue2) { // Value has changed from last transmission, send the updated value sensor_node.send(msg2.set(value==HIGH ? 1 : 0)); sentValue2 = value; } // Sleep until something happens with the sensor sensor_node.sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, 0); } ``` -
@meddie said:
// Activate internal pull-ups
digitalWrite(PRIMARY_BUTTON_PIN, HIGH);
digitalWrite(SECONDARY_BUTTON_PIN, HIGH);If you use the external pull up, you need to comment out these two lines like so:
// Activate internal pull-ups
// digitalWrite(PRIMARY_BUTTON_PIN, HIGH);
// digitalWrite(SECONDARY_BUTTON_PIN, HIGH);No need for an internal pullup if you use an external pull up.
In the above I'm assuming you have an external pullup resistor for each digital pin, one for D2 and one for D3. -
@ahmedadelhosni You know that the nRF pins are not centered? That means if you rotate it like this it will no longer be straight above the "slim node motherboard".
What height do you expect it to be?@m26872 said:
@ahmedadelhosni You know that the nRF pins are not centered? That means if you rotate it like this it will no longer be straight above the "slim node motherboard".
What height do you expect it to be?I understood now what you meant by "not centered". Thanks for notifying me.
I'll take care of that. -
@meddie are you also using the optiboot 9600 NOBOD in boards.txt the same as in the first post (fuse settings I mean)? And are you using avrdude arduino ide for mac?
I tried your solution but i get the same results.. Yikes!
If you use the same setup, can you post your boards.txt? Did you also make changes to the hex file?
Thanks in advance.
-
@m26872 Thanks for your answer... The problem is I read a lot about it (which makes me kinda stupid that I still haven't achieved this).
I tried to find atmel studio (I believe you are referring to atmel studio?) I couldn't find a proper mac version. I checked on the fuse calculator and still no success. Maybe some one could give me the correct fuse settings for AVR or a proper mac download link for atmel studio.
OI know I am asking a lot, but it would help me a lot. Thanks.!!
-
@m26872 Thanks for your answer... The problem is I read a lot about it (which makes me kinda stupid that I still haven't achieved this).
I tried to find atmel studio (I believe you are referring to atmel studio?) I couldn't find a proper mac version. I checked on the fuse calculator and still no success. Maybe some one could give me the correct fuse settings for AVR or a proper mac download link for atmel studio.
OI know I am asking a lot, but it would help me a lot. Thanks.!!
@betonishard Yes, of course ask if you have problem. But I suggest you also make a new separate thread in General-, Hw- or Troubleshooting section about your issues.
Maybe it's a good idea to ask in arduino forum as well. -
Hello @m26872
I succeeded now to burn the bootloader which you used (1Mhz). I just don't understand a phrase which you mentioned above.
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.
Can you explain what is this ? and whether it is affecting badly on something or not ?
Thanks..
-
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.
-
Here
@betonishard said:
@meddie are you also using the optiboot 9600 NOBOD in boards.txt the same as in the first post (fuse settings I mean)? And are you using avrdude arduino ide for mac?
Hi no i use the ide for Windows i dont have a mac.
Here is the hex File
:107E0000112484B714BE81FFE6D085E08093810001 :107E100082E08093C00088E18093C10086E0809377 :107E2000C20089E18093C4008EE0BFD0259A86E02D :107E300023EC3FEF91E0309385002093840096BBC4 :107E4000B09BFECF1D9AA8958150A9F7EE24FF2480 :107E5000AA24A394B5E0CB2EA1E1BA2EF3E0DF2E45 :107E600098D0813461F495D0082FA5D0023829F13B :107E7000013811F485E001C083E083D07FC08234F3 :107E800011F484E103C0853419F485E09CD076C0F8 :107E9000853579F47ED0E82EFF247BD0082F10E0C2 :107EA000102F00270E291F29000F111F84D07801E1 :107EB00065C0863521F484E086D080E0DECF84364C :107EC00009F040C066D065D0082F63D080E0E81686 :107ED00080E7F80618F4F701D7BEE895C0E0D1E0D6 :107EE00058D089930C17E1F7F0E0EF16F0E7FF06A2 :107EF00018F0F701D7BEE8955ED007B600FCFDCFBD :107F0000A701A0E0B1E02C9130E011968C9111977F :107F100090E0982F8827822B932B1296FA010C0160 :107F2000A7BEE89511244E5F5F4FF1E0A038BF0770 :107F300051F7F701C7BEE89507B600FCFDCFB7BE05 :107F4000E8951CC0843761F424D023D0082F21D0B9 :107F500032D0F70185917F0114D00150D1F70EC0C6 :107F6000853739F428D08EE10CD085E90AD08FE02E :107F700084CF813511F488E018D01DD080E101D084 :107F80006FCF982F8091C00085FFFCCF9093C600E3 :107F900008958091C00087FFFCCF8091C00084FDD0 :107FA00001C0A8958091C6000895E0E6F0E098E150 :107FB000908380830895EDDF803219F088E0F5DF4B :107FC000FFCF84E1DECF1F93182FE3DF1150E9F7D5 :107FD000F2DF1F910895282E80E0E7DFEE27FF27CC :027FE000099402 :027FFE0000057C :0400000300007E007B :00000001FFJust create a new txt file put this code in there and rename the file to atmega328_1b.hex
this is my boards.txt:
############################################################## atmega328_1mhz_4800baud.name=ATmega328 on a breadboard 1MHz internal clock, fast start, 1.8V BOD, 4800baud upload atmega328_1mhz_4800baud.upload.protocol=arduino atmega328_1mhz_4800baud.upload.maximum_size=32256 atmega328_1mhz_4800baud.upload.speed=4800 atmega328_1mhz_4800baud.bootloader.low_fuses=0x42 atmega328_1mhz_4800baud.bootloader.high_fuses=0xDE atmega328_1mhz_4800baud.bootloader.extended_fuses=0x07 atmega328_1mhz_4800baud.bootloader.file=atmega/atmega328_1b.hex atmega328_1mhz_4800baud.bootloader.unlock_bits=0x3F atmega328_1mhz_4800baud.bootloader.lock_bits=0x2F atmega328_1mhz_4800baud.build.mcu=atmega328p atmega328_1mhz_4800baud.build.f_cpu=1000000L atmega328_1mhz_4800baud.build.core=arduino:arduino atmega328_1mhz_4800baud.build.variant=arduino:standard atmega328_1mhz_4800baud.bootloader.tool=arduino:avrdude atmega328_1mhz_4800baud.upload.tool=arduino:avrdudethis worked for me!
-
Hello @m26872
I succeeded now to burn the bootloader which you used (1Mhz). I just don't understand a phrase which you mentioned above.
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.
Can you explain what is this ? and whether it is affecting badly on something or not ?
Thanks..
@ahmedadelhosni I've never verified it by measuring, but I understood like @meddie about Gammons writing.
To get rid of those 65ms startup time you should use fuses 42-DE-FF (Lo-Hi-Ext) instead of 62-DE-FF.If anyone could verify and measure current between sleep cycles and share some results, it would be great.
-
Here
@betonishard said:
@meddie are you also using the optiboot 9600 NOBOD in boards.txt the same as in the first post (fuse settings I mean)? And are you using avrdude arduino ide for mac?
Hi no i use the ide for Windows i dont have a mac.
Here is the hex File
:107E0000112484B714BE81FFE6D085E08093810001 :107E100082E08093C00088E18093C10086E0809377 :107E2000C20089E18093C4008EE0BFD0259A86E02D :107E300023EC3FEF91E0309385002093840096BBC4 :107E4000B09BFECF1D9AA8958150A9F7EE24FF2480 :107E5000AA24A394B5E0CB2EA1E1BA2EF3E0DF2E45 :107E600098D0813461F495D0082FA5D0023829F13B :107E7000013811F485E001C083E083D07FC08234F3 :107E800011F484E103C0853419F485E09CD076C0F8 :107E9000853579F47ED0E82EFF247BD0082F10E0C2 :107EA000102F00270E291F29000F111F84D07801E1 :107EB00065C0863521F484E086D080E0DECF84364C :107EC00009F040C066D065D0082F63D080E0E81686 :107ED00080E7F80618F4F701D7BEE895C0E0D1E0D6 :107EE00058D089930C17E1F7F0E0EF16F0E7FF06A2 :107EF00018F0F701D7BEE8955ED007B600FCFDCFBD :107F0000A701A0E0B1E02C9130E011968C9111977F :107F100090E0982F8827822B932B1296FA010C0160 :107F2000A7BEE89511244E5F5F4FF1E0A038BF0770 :107F300051F7F701C7BEE89507B600FCFDCFB7BE05 :107F4000E8951CC0843761F424D023D0082F21D0B9 :107F500032D0F70185917F0114D00150D1F70EC0C6 :107F6000853739F428D08EE10CD085E90AD08FE02E :107F700084CF813511F488E018D01DD080E101D084 :107F80006FCF982F8091C00085FFFCCF9093C600E3 :107F900008958091C00087FFFCCF8091C00084FDD0 :107FA00001C0A8958091C6000895E0E6F0E098E150 :107FB000908380830895EDDF803219F088E0F5DF4B :107FC000FFCF84E1DECF1F93182FE3DF1150E9F7D5 :107FD000F2DF1F910895282E80E0E7DFEE27FF27CC :027FE000099402 :027FFE0000057C :0400000300007E007B :00000001FFJust create a new txt file put this code in there and rename the file to atmega328_1b.hex
this is my boards.txt:
############################################################## atmega328_1mhz_4800baud.name=ATmega328 on a breadboard 1MHz internal clock, fast start, 1.8V BOD, 4800baud upload atmega328_1mhz_4800baud.upload.protocol=arduino atmega328_1mhz_4800baud.upload.maximum_size=32256 atmega328_1mhz_4800baud.upload.speed=4800 atmega328_1mhz_4800baud.bootloader.low_fuses=0x42 atmega328_1mhz_4800baud.bootloader.high_fuses=0xDE atmega328_1mhz_4800baud.bootloader.extended_fuses=0x07 atmega328_1mhz_4800baud.bootloader.file=atmega/atmega328_1b.hex atmega328_1mhz_4800baud.bootloader.unlock_bits=0x3F atmega328_1mhz_4800baud.bootloader.lock_bits=0x2F atmega328_1mhz_4800baud.build.mcu=atmega328p atmega328_1mhz_4800baud.build.f_cpu=1000000L atmega328_1mhz_4800baud.build.core=arduino:arduino atmega328_1mhz_4800baud.build.variant=arduino:standard atmega328_1mhz_4800baud.bootloader.tool=arduino:avrdude atmega328_1mhz_4800baud.upload.tool=arduino:avrdudethis worked for me!
@meddie and @all Tonight I think I have fixed my issue however how I do not understand so maybe someone can explain, or maybe I think I have fixed it and it is not fixed at all.
On the arudino website it states that when you burn your bootloader you have to connect pin 13,12,11 and pin 10 to reset (and ofcourse 5v and ground). AFter burning the bootloader you should replace it with the rx and tx cable and disconnect 13,12,11 and connect reset to reset. Each time I did this I got the error of Yikes! However tonight by accident I forgot to rewire the pins to rx and tx and press “Upload using programmer” all of a sudden it stated “done uploading”.
I tested this with blink sketch so I attached a led to pin13 and ground. The led started to blink. I was happy however did not understand…. or is this just a n00b mistake
-
@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.