I'm trying to make my own home wireless security system. I will be using probably 3 AA batteries to power these devices. My problem is that I need to know if the batteries will be enough to power the devices for at least 6 months. Below are the details of all the devices I will be using:

  1. Mini Nano V3.0 ATmega328P Microcontroller Board w/USB Cable For Arduino
  2. Makerfire Arduino NRF24L01+ 2.4GHz Wireless RF Transceiver Module
  3. uxcell MC 38 Mount Wired Door Window Sensor Magnetic Reed Switch Recessed

Below are some project requirements that might be useful:

  1. For the Nano, I want to put it to sleep using delay(2000) in the loop() function. The Nano will be the one checking the window sensor.
  2. I will be using a project enclosure of about 4X4 inches.

If this will not be possible maybe someone knows of other devices that use less power that will be more suitable for this project? I would prefer something easy to use like Arduino Nano with USB so I can easily program it.

EDIT: sorry but I just like to add that from the main HUB component, I would like to check the status of the window sensor if it is open/closed. This will be useful if there is an open window/door around the house when going to sleep. Probably the Nano will broadcast its current window sensor status to the main HUB program. Thanks.

  • how will you make sure than nobody can jam the radio signal?
    – jsotola
    Commented Jan 12, 2018 at 7:34
  • @jsotola I addressed this in my answer. Even with "still alive" functionality the sensor should last for many months if programmed properly.
    – jdwolf
    Commented Jan 12, 2018 at 10:53
  • I'm just trying to build my own home security system. My electronics knowledge is very limited, so for now I don't want to worry about jamming the radio signal.
    – Marquinio
    Commented Jan 12, 2018 at 13:36
  • @Marquinio In that case why not just have just a magnetic reed switch connected to a buzzer? Standby would be next to nothing then.
    – jdwolf
    Commented Jan 12, 2018 at 13:40
  • I want to make a web GUI for the system where I can see the state of all the door/window sensors. I also want to be able to armed/disarm the system. When its armed and triggered then the buzzer will be triggered.
    – Marquinio
    Commented Jan 12, 2018 at 13:53

3 Answers 3


You should use interrupts for the reed switch and then put the microcontrolller into sleep for a keep alive interval. Your master device should check that the sensor is still active and set off the alarm if its not. You would also want to allow for a battery low condition that might disable the alarm for convince. This still should keep the power consumption low.

The nano is roughly 1mA @ 3.3v while the CPU is running and 72uA when its in sleep. Discounting power consumption in the alarm condition triggered by the interrupt using an interval of 9 seconds using delay or interrupt timers then average consumption then about a second to wake up and send a keep alive over the RF. (0.000072 * 9 + 0.001 * 1) / 10 = 0.0001648 amps. (average over 10 second duty cycle)

My guesstimate of your RF power consumption without knowing what kind of protocol would be somewhere around 128 bytes per transmission taking about 90ms. (0.0001 * 9910 + 0.015 * 90) / 10,000 = 0.0002341 amps.

Total of their averages is: 0.0003989 or 398.9uA.

Alkaline AA cells vary widely. So instead based on some Ni-MH with 2400mAh per cell and 1.2v

3 cells would be 3.6v so you'll "get" most of the mAhs out of the batteries.

2400mAh = 2400000uAh

2400000uAh / 398.9uA ~= 6016.54 hours or 250 days or 8 months.

Power consumption were intentional overestimates. You should be able to make it last a lot longer.

https://www.avrprogrammers.com/howto/atmega328-power http://harizanov.com/2013/05/nrf24l01-power-consumption-footprint/

  • Based on your calculations It gives me hope that this will work. Now what you mean by "put the microcontroller into sleep"? Is this as simple as something like delay(2000) or something more complicated? If more complicated can you please provide a link so I can follow those steps? Thanks.
    – Marquinio
    Commented Jan 12, 2018 at 13:59
  • I'll have to read and understand how interrupts work, no easy way around that. I can now move forward with my project. Thanks for your help!
    – Marquinio
    Commented Jan 12, 2018 at 17:07

It only seems to do one thing: activate an alarm if the reed switch changes. Power the system through the reed switch. It will have zero standby current and the battery will last the shelf life. That said, you might be able to use an RF module w/o even a MCU, though not that particular one...

  • Thats pointless because if you jam the RF the sensor is useless. That would make a silly security system.
    – jdwolf
    Commented Jan 12, 2018 at 10:50
  • this is for a home security system. one theoretical attack doesn't make it pointless any more than the existence of locksmiths makes locking your door "pointless". If someone breaking into OP's house is jamming RF signals, they are going to get in one way or the other... Still you could for example, add a 110db alarm to the build and still get "infinite" standby, maybe even with a microphone sensor as an RF backup. Main point: in my experience, analog still beats digital for long-term reliability.
    – dandavis
    Commented Jan 12, 2018 at 11:54
  • @jdwolf: what's to stop someone from spoofing the RF signal? If you authenticate, that's a ton of complexity to avoid replay attacks, schedule keys, not burn eeprom, etc. Try using a simple spark gap transmitter and a dollar-store AM radio as a detector: you can't jam a spark gap w/o setting off the receiver ;)
    – dandavis
    Commented Jan 12, 2018 at 12:21
  • Nothing about my answer indicates that encryption wouldn't be used. Signal jamming includes intentionally blocking the signal or destroying the device between its broadcast intervals (which would be easily detectable on the cheapest of hardware) so even spark gap can't help you there. In any case "I'm still alive" style security is how professional security systems actually work.
    – jdwolf
    Commented Jan 12, 2018 at 13:34
  • This will be a basic home security system. Once I can make the power last a long time I will beef it up and maybe add jamming protection, but for now I will probably have the Nano send an "I'm still alive" to the main HUB like jdwolf mentioned.
    – Marquinio
    Commented Jan 12, 2018 at 13:44

You should use a reed switch that is both NC and NO. Then power only the disconnected part of the switch and listen to pin changes and put everything into sleep. This can improve your power consumption. See the answers postet here: Low Power Pin Change Detection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.