Magnetic door sensor project

The front door of our building is constantly left open. I am trying to setup a system that detects when the door is open, and sends a notification if left open longer than some specific duration. A backend system that shows current status of door, and tracks times opened and closed.

I actually implemented a system completely, using an Arduino with Wifly shield and reed sensor ( https://github.com/ncoronges/DoorSensor935 ) - and it worked perfectly.. for about 12 hours :roll_eyes:

I failed to consider how little battery life I would get, esp with the wifly shield. I researched adding polymer lithium ion batteries but coming to the conclusion that battery powering this thing will be a pain no matter what, having to replace/recharge every few days..

Since there are many door sensor products out there ( eg. http://www.smarthome.com/59482/GE-45131-Choice-Alert-Window-Door-Sensor/p.aspx ), that use little power and communicate wirelessly, I thought it better to explore this route. To see if I could setup a receiver, and hook that into my arduino with wifly shield..

But how do you read the RF signals being transmitted from these door sensors? It seems there are door sensors that support zigbee but does anyone have experience with them out there, or know where to get ones that can be read by regular series 1 zigbee modules that work with arduino?

Thanks in advance.

Hi,

Lots of material out there on this subject.. Google "wireless door sensor arduino"

The front door of our building is constantly left open.

Attach a spring :slight_smile:

Automotive key fobs work for years on a tiny power source and they are relatively long range. Could that technology be used? - Scotty

The simplest way I can think of is to use a normally-open or changeover reed switch, and connect the switch between the battery and the Arduino, so that the Arduino and wifi unit are powered up only when the door is open. Then just have the Arduino delay for the required amount of time before transmitting the signal. The battery will be supplying power only while the door is open.

A better way is to roll your own Arduino substitute on stripboard, without the FTDI chip (to save power), and have the power to the wifi module switched by the atmega328p. Then you can run the microcontroller in sleep mode most of the time, and only power up the wifi unit when you need to send a message. You could have it monitor the battery voltage and send a "battery low" message as well.

@dc42 - this sounds like a good approach: wake up when the door opens. But not finding any Normally-Open reed switches. The one i have is a Normally-Closed switch. If you have any recos..

Thanks.

SPDT (also known as changeover) reed switches are readily available, for example my local store has http://www.maplin.co.uk/ri-90-micro-changeover-reed-switch-44111.

Radio Shack and many other places like Alarm companies have normally-open reed switches AKA door / window switches that close when a magnet is close to them and open when it is removed. If you can position the magnet so the switch does not close until the door begins to open (close to the hinge) You could wake up the Arduino which could then stay running after the switch opens again as the door goes to the fully-open position.

You might want a second switch at the fully-closed position so Arduino can tell that state.