Introduction: Low Power Door/window Sensor

Picture of Low Power Door/window Sensor

In this manual we will show how to create cheap, secure door/window sensor network. We could monitor our door/windows status from desktop computer or mobile phone in web browser. Properly configured sensor could work between 5 and 10 years on 2 AA batteries. Power consumption of this sensor is so low that I'm using wasted batteries from electronic toys and sensor still work. You can use up to 254 sensors per one server.

See more tutorials at

Step 1: Materials

Picture of Materials

EasyIoT server:

Raspberry Pi

NRF24L01+ module

USB power supply

Sensor node (up to 254 sensors per one server)

Arduino Pro Mini (Hacked for low power consumption)

NRF24L01+ module

1M resistor

AA battery holder

Magnetic door/window reed switch

Step 2: EasyIoT Server

Picture of EasyIoT Server

Connect Raspberry Pi and NRF24L01 transceiver.

Download EasyIoT server image and copy it to SD card. EasyIoT server download. Windows users can write EasyIoT server image to SD card with Win32 Disk Imager.

Step 3: Door/window Sensor

Picture of Door/window Sensor

Connect Arduino Pro Mini NRF24L01+, batteries and reed relay. For extra low power consumption follow Arduino low power.

After connection all wires program arduino with this sketch. Make sure that NRF24L01 channel and speed is the same as later used in EasyIoT server (see MyConfig.h file for settings).

Step 4: Configure

Picture of Configure

Power on Raspberry Pi and go in Web browser on computer (Raspberry Pi and computer must be on the same network). In browser type Raspberry Pi IP address. When asked for username and password use: admin and test.

In Web browser go to Configure->Drivers->MySensors->MySensors Driver and then Add Node. Now you power on your new sensor. If you are successful you should see new sensor address (no timeout message). After that create new group Configure->Groups and Modules->Add Group. Add new group and go in newly created group. Now add new sensor. After that you should see new sensor in main page. You can add up to 254 sensors.

Step 5: Mount Sensor

Picture of Mount Sensor

Place sensor to door or window.

Step 6: Monitor

Picture of Monitor

Monitor door/window status from everywhere. If you enabled logging database you can also see door/window status history.


mirws (author)2017-01-29

Can I use attiny85?

mirws (author)2017-01-27

Can i use pir sensor on low power arduino?

lkamache (author)2017-01-03

Great project!

I was wondering... if the NRF24L01 has "Arduino capabilities", why do you still have to use the Arduino Pro Mini?

zurczurc (author)2016-12-29

Very cool your project, does not work on RaspBerry Pi3?


zurczurc (author)2016-12-29

Very cool your project, does not work on RaspBerry Pi3?


aswamer (author)2016-08-25

That's a great tut, by the way, how do you add a new sensor? and how do
you identify it? I'd like to try adding a few sensors around the house.

EasyIoT (author)aswamer2016-08-26

hi, here you have more tutorials:

santa1234 (author)2016-08-24

Hi! great tut! Could you clarify "Properly configured sensor could work between 5 and 10 years on 2 AA batteries." ?

EasyIoT (author)santa12342016-08-24

and this:

santa1234 (author)EasyIoT2016-08-25

thanks for the info. so you:

1. removed the regulator of the Arduino Pro Mini

2. removed the power LED

3. reduced the internal oscillator frequency from 8 to 1MHz to operate at 1.8V

This way you reduced power consumption (Arduino) from 4.8mA to 6uA, resulting 10 years from 2 AA batteries.

I also noticed (from the door_window_sensor.ino) that you are using interrupts to wake the arduino on event (reed switch opened = door opened), otherwise the arduino is sleeping.

So the 10 years life can also be affected by how many door openings happens in between.

anyway, nice tricks!

EasyIoT (author)santa12342016-08-24

yes, look at this link:

JFBourne (author)2016-05-11

Hey, I did this project but for some reason I cant get the EasyIoT to recognized my sensor. When I switch on device I cant get anything an it timeout. I dont know how to troubleshoot this. Thanks

MustafaG15 (author)2016-04-11

Thanks for the great idea. You brought me to the MySensors library, which I use with OpenHAB. But the battery consumption is in my case horrible. I removed the power led, but I left the power regulator active. After that I measured 400 Micro Ampere in power down mode, what seems quite good for the effort. After filling the sensor with two new AA cells it showed me 100% battery capacity. After only one day I see 97% ?!

My 3,3 V Arduino Pro Mini from China seems to work stable only until the battery voltage reachs 2,7V. If it drops below this line, it seems not to be work reliably. Power is connected to VCC (not RAW). How can you use drained batteries? I would need al least 3 drained AA cells to stay over 2,7V.

seamster (author)2014-11-25

Very nicely done! This looks extremely useful for parents of teenagers.

EasyIoT (author)seamster2014-11-26

Thx. Basically I've done this project because I always forgot if I closed all windows or not. Now I can check from remote locations. But be careful: if you fix sensors to door/window poorly then it can fell of and it will show status open. This happened to me once. You can also upgrade sensor functionality to trigger alarms. I will write post about this on my web site

RamyB (author)EasyIoT2016-02-08

I have done this project and its great, thank you

I have also added the beeping when door/window close/open,

only one bug I guess, when the sensor is disconnected (like dead battery), the server show it as CLOSED, which is sometime missleading. is there a work-around to change the default status ?

RamyB (author)2016-02-07

i did the project with the arduino as-is without the low power edition, the battery barely last a week and starts nit working, specially that i have added a buzzer to make a sound on the sensor

oklahomagreybeard (author)2016-02-01

This is exactly what I'm looking for. I started down the road with Z-Wave, but really like the idea of building them myself. The only thing I don't see anywhere is what case you used to house the entire project in.

BishoyB (author)2016-01-09

thanks for the great project

I was wondering if it is possible to use a desktop for the server. Both hardware-wise: is there a nRF24L01 that goes on a desktop with Linux installed? And software wise: is there a version of this IoT that works on a desktop?


RobertC141 (author)2015-11-18

Is there any way for the Raspberry pi to process a audio file over speakers in your house when a window/door is opened?

gustavo.ambrozio (author)2015-10-20

Do you know how long can the batteries last? Also, is there any alert when the batteries die or are about to die? Thanks for the guide.

duncann (author)2015-08-22

I get a compilation error:

WindowSensor_arduinopromini.ino: In function ‘void sendValue()’:
WindowSensor_arduinopromini.ino:77:6: error: ‘class MySensor’ has no member named ‘powerUp’
WindowSensor_arduinopromini.ino:80:6: error: ‘class MySensor’ has no member named ‘powerDown’
WindowSensor_arduinopromini.ino:85:8: error: ‘class MySensor’ has no member named ‘powerUp’

I am using the mysensors library version 1.5.

I have tried all means to troubleshoot. Any idea what I might be missing?

dlee53 (author)2015-07-01

just curious, how do you obtain battery percentage of the sensor node? didn't mention in this article, any other link to it?

mtufan (author)dlee532015-07-19

@dlee53: readVcc does the trick. there are number of sites explaining how it's done. e.g.

miragempro (author)2015-03-25

I can remove the Raspberry Pi and put the ARDUINO?

EasyIoT (author)miragempro2015-03-25

Do you mean for server? No, Arduino is not powerful enough for server in this case.

miragempro (author)EasyIoT2015-03-25

No, only using the RF transmission

thomasjohansen (author)2014-11-25

can you make a guide on the temp sensors too?

EasyIoT (author)thomasjohansen2014-11-26

Yes, for sure I will write about this on my page and all source files will be available on github. I'm also designing special low power board, suitable for small sensors (door/window, temperature, humidity, water leak, soil humidity, gas, movements...). Right now I'm testing low power temperature/humidity sensor. Data is also logged in database so you can see history chart.

phidgetsinc (author)2014-11-25

Magnetic reed switches are great for windows and doors. I love the UI you have for this, it's very clean. Nice work.

EasyIoT (author)phidgetsinc2014-11-26

Thx. And UI works good on desktop and mobile devices.

About This Instructable




Add instructable to: