Door Opening sensor

I’m working on a home alarm with Fez spider kit & of course .net gadgeeter.
I want mount a simple electric wire with two magnet on a door, when the contact is open (not shortcircuit) the door is open.
There’s a module where i can connect simply two wire capable to read a “true” boolean value if the contact is shortcircuit and a “false” when not ?
Or how can i obtain the same feature ?

Thanks

Welcome limroc !

As far as i know, there is no reed switch/magnetic switch Gadgeteer module, but you should just look at any reed switch from your local electronics store, for instance I would go and buy this one http://www.jaycar.com.au/productView.asp?ID=LA5070

Then you need a length of wire (how long depends where your door is in relation to your Spider), and an extender or makebread module to break out a digital IO pin.

good luck, keep us posted on what you find !

Can this, in some way, be achieved with the load module too?

Srry meant load module :wink:

What is the loader module?

Srry meant load module

The load module just turns power on and off for up to seven (? i think) channels. How would this detect if a door opened?

I’m not sure how two magnets would work, either. You could use a magnet on the door and a Hall Effect sensor (at SF, https://www.sparkfun.com/products/9312) on the door jamb. This will detect a change in magnetic state and flip a digital pin. There is no module pre-made to do this, but it would be trivial with an Extender (GHI store) or MakeBread/MakeWire (community offers).

As an example of simplicity, my (then) 6 year old son built such a circuit to turn on LEDs when he waved his “magic” wand over this type of (hidden) sensor. The tip of his wand had a small magnet in it. There was no FEZ or other micro involved, but we’ve had lots of fun showing his friends his magical powers :slight_smile:

@ limroc9872, Welcome to the forum!

  1. If you have the CerberusBee mainboard you could connect to the Arduino pins (the ones on the sides) and use those.

  2. If you are handy with a soldering iron you could connect the wires from the magnetic reed to the button module.

  3. For one door you could use the breakout pins on the extender and build your own module. It would be quite easy and only require 2 pins (I think) from the breakout. The 3.3v wire going to the common and then the signal wire coming from the NO or NC pin on the reed (depending on your code preference for what true means).

  4. If you are looking at eventually doing all the doors and windows you could use the IO60 (I am going to use one for all the doors & windows in my new house). This could be really nice if you also might want to tie in some output options such as relays.

I wouldn’t expect that a single IO60 module could run an entire house full of door and window sensors, unless you live in a 700 square foot apartment. The cable runs will be too long.

If you do, then just about any mainboard or non gadgeteer option should have plenty of gpio to do what you want.

In the last house I owned (3600 sq ft) I had it working with a Phidget IFK which is very similar to the IO60, so I am hopeful that the IO60 will work in my new house. I’ll find out in 2 - 2.5 months.

You ran all your window and door sensors from a single central location with simple 3V3 GPIO? Wow, I wouldn’t have guessed that would work.

I also hope it will work, because I try to solve the same problem. Moreover I want to turn lights when some event is raised (switch is turned on, PIR detects a motion, outside light is below some value), turn fan when humidity is above some value, turn on heating when temperature in a room is bellow some value etc.

For now, I have problem, that interupt event is raised with quite big delay on IO60P16 (see my post http://www.tinyclr.com/forum/topic?id=8797&page=1#msg87511) and raises twice on my FEZ Spider. That would be uncomfortable with lights for example.

As I said, it was with a Phidget IFK which is SIMILAR to the IO60, so no I haven’t YET done it with the IO60. I believe the Phidget IFK was 5v with a trigger at 4.5 so the max loss was 10% and I don’t think I even measured that much with a multi-meter. It may all come down to thresholds, but of course if I find a voltage drop it should remain fairly constant so I can always attach a second power source to deliver the signal so that the dropped value is sufficient to trigger.

I did also have the garage door tied in with a relay so that I could open/close it. I also had a reed sensor on the door itself so that I knew if it was completely closed or at least partially open.

For the lighting, interrupts should not be an issue. If you detect motion you turn the lights on, if you detect motion again .5 seconds later you should just keep the lights on. Adding some state awareness should solve the problem. Also you could add a simple value that remembers the last time you had the interrupt and not fire extra events until some time period has passed. Have you tried the glitch filter? When I was playing with a reed filter using just jumpers (3" wires) I was getting like 30 open interrupts when I would open and 2 close when I would close, but the glitch filter reduced it to just the one I expected.

godefroi, I have done this now, and it works. The io60p16 driver doesn’t support board level interrupts (at this time), so I have have a loop (200ms) to check the 27 pins I am interested in watching, but the power concerns expressed seem to be a non-issue.

I got one of these Hall High Sensitivity Sensor Switch - emartee.com and hooked it up to an analog input pin of my Cerberus, it works well. You could easily substitute the light sensor in my tutorial http://technicalstuffhopefullyuseful.blogspot.dk/2013/01/using-analog-input-sensors-with-net.html with the hall sensor.

Very interesting. I’m glad it worked. That makes this sort of thing much simpler than the alternatives (RS-485 etc).