Overview

This application senses when the bathroom door is closed and locked. The sensor used in this application is very simple and could easily be used for other applications. One area they use these sensors in all the time is security.

Hardware

The Sensor

The sensor used in this application is a reed switch from sparkfun. Reed switches are great for applications like this because nothing needs to touch them. Inside of a a reed switch there is two little metal plates enclosed of a glass tube(most security systems use a reed switch enclosed in plastic). When a magnetic field is introduced in proximity to the reed switch the two metal plates are attached to each other and when the plates make contact, they make a short or close the switch.

Circuit


Below are some photos of the sensor:


Software

Here is the project for both the bathroom monitor and the led indicator. Note: That this code uses one application for both functions. You'll need to change the mac address in the code to fit your deployment.

This sensor is very easy to use. All you need to do is use an interrupt to detect when the switch is closed. For this application we send a message every time the door is locked or opened. The message is received by a second JCreate that will turn on it's leds to indicate the current state of the bathroom.



#Overview

This application senses when the bathroom door is closed and locked. The sensor used in this application is very simple and could easily be used for other applications. One area they use these sensors in all the time is security.

#Hardware
##The Sensor
The sensor used in this application is a [reed switch](http://www.sparkfun.com/commerce/product_info.php?products_id=8642) from [sparkfun](http://www.sparkfun.com). Reed switches are great for applications like this because nothing needs to touch them. Inside of a a reed switch there is two little metal plates enclosed of a glass tube(most security systems use a reed switch enclosed in plastic). When a magnetic field is introduced in proximity to the reed switch the two metal plates are attached to each other and when the plates make contact, they make a short or close the switch.

##Circuit

![reed_switch_schematic][[reed_switch_schematic]]

||||

Below are some photos of the sensor:

<<<<b
![Image Alt Text][[reed_switch_test]]
<><><><>

<<<<b
![Image Alt Text][[reed_switch_test_mounted_ledsOFF]]
<><><><>

<<<<b
![Image Alt Text][[reed_switch_test_mounted_ledsON]]
<><><><>

||||

#Software
@[Here][[BathroomMonitor.zip]] is the project for both the bathroom monitor and the led indicator. Note: That this code uses one application for both functions. You'll need to change the mac address in the code to fit your deployment.

This sensor is very easy to use. All you need to do is use an interrupt to detect when the switch is closed. For this application we send a message every time the door is locked or opened. The message is received by a second JCreate that will turn on it's leds to indicate the current state of the bathroom.