Author Topic: Most efficient way to wire door/window NC magnets (addressable)?  (Read 708 times)

0 Members and 1 Guest are viewing this topic.

Offline onesixrightTopic starter

  • Frequent Contributor
  • **
  • Posts: 624
  • Country: nl
Hi All,

Im installing a bunch of new doors and windows. I would like to fit them with magnet contacts to detect open/close state, preferable going into a raspberry pi.

I did some reading and apparently you have to versions the NC (normal closed) and NO (normal opened) ones.

I understand that for alarm systems you would use the NC version. Makes sense.

My question, if I would like to identify which window/door is/are open, what would be the best/easiest way to address each sensor?

Obviously some bus style would be cable wise (length) most efficient, but that means I need some way too address each sensor (RS485?). When pulling wires in a star style would be much easier, but more wires.

Situation: 3 floors, house is completely being renovated, so cable access is no problem.

basement: 4 doors / windows
1st: 8 doors / windows
2nd:8 doors / windows

Looking forward to some feedback / best practice

Thanks!
 



« Last Edit: October 15, 2019, 07:45:43 am by onesixright »
 

Offline jonovid

  • Super Contributor
  • ***
  • Posts: 1546
  • Country: au
    • JONOVID
Re: Most efficient way to wire door/window NC magnets (addressable)?
« Reply #1 on: October 15, 2019, 07:34:49 am »
change of state detection maybe the best chose with security setups.
triggered when the input changes state.
allowing for brief time of switch bounce.
as always allow for RF blocking and other long wire isolation to keep your raspberry alive
Hobbyist with a basic knowledge of electronics
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Most efficient way to wire door/window NC magnets (addressable)?
« Reply #2 on: October 15, 2019, 02:50:22 pm »
Best practice is to divide the stations into zones and not concern yourself with exactly which station in a zone is in the wrong state. Just saying...

Check out the DS2413 dual addressable GPIO for an easy, almost turn-key, two-wire solution for what you want to do. Breakout boards available from Adafruit and others.
« Last Edit: October 15, 2019, 03:24:38 pm by jhpadjustable »
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Most efficient way to wire door/window NC magnets (addressable)?
« Reply #3 on: October 15, 2019, 04:15:15 pm »
You can have a loop with n switches and each switch has a resistor in parallel. make the resistors powers of 2 and you can know directly what switches are open or closed.

For instance, you have five switches in series with resistors in parallel with each switch. The values of the resistors are 1K, 2K, 4K, 8K, 16K.

If the loop measures 10K then you know switches 2 and 4 are open.

If you do a loop alarm do it with double parallel cable, better if twisted, to minimize electromagnetic interference. Don't make a loop around a room. Have the return come back the same way it went out.

« Last Edit: October 16, 2019, 10:17:03 am by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf