custom alarm systems at home

Thread Starter

bend94

Joined Feb 15, 2016
37
Hi
I am building my home alarms systems.
what is the solution to read 12V analog inputs with an arduino ?
I don't want to use a resistor dividers circuit, is there a hat card or a solution to plug 12V analog input and be able to process it with arduino?

I need about 4 analog inputs for 4 alarms zones
Each alarms zones with contains reed switch and passive infrared sensor.

addon: if that card could have relay to power siren it would be great !

thanks
 

Yaakov

Joined Jan 27, 2019
4,001
Hi
I am building my home alarms systems.
what is the solution to read 12V analog inputs with an arduino ?
I don't want to use a resistor dividers circuit, is there a hat card or a solution to plug 12V analog input and be able to process it with arduino?

I need about 4 analog inputs for 4 alarms zones
Each alarms zones with contains reed switch and passive infrared sensor.

addon: if that card could have relay to power siren it would be great !

thanks
Could you explain why you want to use analog I/O for signals that are digital? Both the reed switch and PIR sensor only have two states. What is the purpose of the analog sensor.

Also, make sure you use inverted logic and have the alarm zones normally closed so that if the wires are cut it sounds the alarm.
 

Thread Starter

bend94

Joined Feb 15, 2016
37
As you can see i want to use an old alarm system with Passive infrared sensor gather in zones and some reed switch gather in zones. In fact, this is my old alarm system that is already available in my home.
i want to be able to manage that 12V system from an arduino or raspberry.
Arduino/Raspberry allow me to developp in c or python easily
 

LesJones

Joined Jan 8, 2017
3,655
That does not seem to explain why you want to use analogue inputs rather than digital inputs.
Edit. after seeing the diagram of your original alarm panel in post #4 which includes a 2K2 resistor in the loop I can see that it can detect any changes to the loop resistance if the loop is broken or any attempt is made to short out a section of the loop. (It would also show up any high resistance contacts on the sensors.)

Les.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
9,630
I don't want to use a resistor dividers circuit,
Why not?

Also, I don't see any kind of voltage source for the loop. Usually, the loop is fed through a resistor in the controller that forms a voltage divider with the EOL resistor. This sets the "all-OK" (no fault) condition as neither 12 V nor 0 V, so loop tampering can be detected with an analog comparator. My 1980's alarm controller had a big, fat 40-pin DIP uC, while my current controller has a cute little 44-pin PIC in an SMT socket, but both had/have a row of LM339's as window-comparator input stages for the loops, two loops per chip. The design concept is over 40 years old, and in that time no one has come up with a better solution because there isn't one. If you are going to go all hard-wired - and I strongly recommend that you do - it is the way to go.

An option is to scale the resistor values such that the loop node can feed a uC A/D input directly, basically replacing the analog comparators with software. Note, however, that no alarm companies do this, ever. A compromise is to buffer each loop input with an LM324 stage as a voltage follower, keeping the level-detection in software but protecting the uC inputs from transients/whatever. But if the loop source is 12 V you still need an attenuator, transistor, or some kind of level-shifter to get the signal down to something the uC an handle. I've seen this in the hobby/experimenter arena, but not in pro equipment.

Where are you located?

ak
 
Last edited:

Yaakov

Joined Jan 27, 2019
4,001
That does not seem to explain why you want to use analogue inputs rather than digital inputs.
Edit. after seeing the diagram of your original alarm panel in post #4 which includes a 2K2 resistor in the loop I can see that it can detect any changes to the loop resistance if the loop is broken or any attempt is made to short out a section of the loop. (It would also show up any high resistance contacts on the sensors.)

Les.
Yes, supervised loops are pretty standard but he’ll have to write that into the program.
 

Thread Starter

bend94

Joined Feb 15, 2016
37
i need analog input because reed switch and pir connectivity can give 3 states :

  • 0Ohms
  • 2KOhms
  • Infinite

Alarms systems works like this. It is a loop with all sensors with a End Of Line Resistors
regards
 

ericgibbs

Joined Jan 29, 2010
14,699
hi bend,
It would be a cheap and simple way to use a couple of these 4 SIL packages, choose resistor values to suit 12V down to 5V or 3.3V as required.

E
 

Attachments

Thread Starter

bend94

Joined Feb 15, 2016
37
hi bend,
It would be a cheap and simple way to use a couple of these 4 SIL packages, choose resistor values to suit 12V down to 5V or 3.3V as required.

E
you are right, it is simply indeed, use a resistor dividors
but what is a 4 SIL packages ? can you share a link please
 

ericgibbs

Joined Jan 29, 2010
14,699
hi bend,
This is a UK stockist.
Note, if you decide to use this option, you must specify a SIL package type that has 8 pins with 4 internal resistors.
ie: the 4 resistors are isolated from each other.

For information only, some packages have one end of all the resistors common to a single pin.
E
 

Attachments

MrChips

Joined Oct 2, 2009
25,037
You do not have three states.

You have:
1) 2.2K to ground
2) open circuit

For a simple analog or digital input to Arduino, connect 1kΩ resistor from Arduino input to Arduino Vcc.

If you want isolated inputs, use the following, where R1 is your 2.2kΩ EOL resistor and Vi is supplied by the sensors. (R1 and D1 are swapped.) R2 can be any value from 1kΩ to 10kΩ.

1635516549202.png
 

AnalogKid

Joined Aug 1, 2013
9,630
You do not have three states.
Yes, he does.

As above, a standard alarm loop is a voltage divider between 12 V and GND, with one leg of the divider is at the far end of the loop. If an evildoer tries to bypass the loop by shorting across it at any point along the run, the loop voltage seen by the controller drops to GND. This third state is detected by a window-comparator as a fault. The basic idea pre-dates microprocessors and transistors; it can be done with two (appropriately-selected) relay coils in series.

On my controller, I think the window trip points are 4 V and 8 V, but it's been a while since I squinted at those 0805 values. Anything above 8 V is an open-loop fault, and anything below 4 V is a tamper / shorted loop fault.

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
9,630
Under normal conditions, the switch controls two states: normal and open-loop/fault. In a shorted-loop/tamper condition, the combination of the two-resistor voltage divider and a window-comparator detects the third state.

ak
 
Top