User avatar
pssm
Posts: 5
Joined: Tue Nov 25, 2014 10:07 am
Location: Portugal

Connecting to an existing alarm system

Tue Nov 25, 2014 10:31 am

Hi everyone,

I have an alarm system in my house that I'm trying to connect to my RaspberryPI B+.
The first step would be connect the installed motion sensors to the GPIO, and trigger events based on it. The motion sensors I have, are all of the same model (Paradox 476+), with the following technical specs:

(...)
Voltage Typically 11 to 16Vdc
Alarm Output N.C., 28Vdc, 0.15A
Anti-tamper switch N.C., 28Vdc, 0.15A Maximum

Image

And this is whats happening on the alarm central side:

Image

The A terminals of the sensor are the ones connected to the alarm central, and also the ones that I'm interested.

From my understanding when the sensor is triggered the output of it will be a 28Vdc, and if so, what would be the best way to convert this current to a value readable by the RPI?

Thanks!

stevend
Posts: 209
Joined: Fri Oct 11, 2013 12:28 pm

Re: Connecting to an existing alarm system

Tue Nov 25, 2014 1:26 pm

pssm wrote: From my understanding when the sensor is triggered the output of it will be a 28Vdc, and if so, what would be the best way to convert this current to a value readable by the RPI?
Thanks!
Not quite - the output of the detector is basically a switch, which can handle voltages up to 28V d.c. The largest voltage you'll be able to measure is about 14V d.c. (i.e. voltage of the battery in the alarm panel). This switch is normally closed, and opens if movement is detected.

Assuming you're keeping the sensor connected to the alarm panel, the voltage you'll see will depend on the panel. In older and simpler panels, the voltage on one of the two pins will probably always be 0V, and the other will change between 0V (no alarm) and some higher voltage (alarm). For this type you could use a simple digital circuit to detect an alarm.
In newer and more sophisticated panels, resistors at the detector allow the panel to differentiate between a tamper and an alarm using just one pair of wires for signalling. For this you'd need to measure actual analog voltages. (On a panel I measured recently, the voltage never went above 5 volts).

So first step is to take a voltmeter and measure the voltage between the 0V of the 12V supply and each of the 'A' lines in alarm and non-alarm states.

User avatar
pssm
Posts: 5
Joined: Tue Nov 25, 2014 10:07 am
Location: Portugal

Re: Connecting to an existing alarm system

Tue Nov 25, 2014 2:33 pm

stevend wrote:
pssm wrote: From my understanding when the sensor is triggered the output of it will be a 28Vdc, and if so, what would be the best way to convert this current to a value readable by the RPI?
Thanks!
Not quite - the output of the detector is basically a switch, which can handle voltages up to 28V d.c. The largest voltage you'll be able to measure is about 14V d.c. (i.e. voltage of the battery in the alarm panel). This switch is normally closed, and opens if movement is detected.

Assuming you're keeping the sensor connected to the alarm panel, the voltage you'll see will depend on the panel. In older and simpler panels, the voltage on one of the two pins will probably always be 0V, and the other will change between 0V (no alarm) and some higher voltage (alarm). For this type you could use a simple digital circuit to detect an alarm.
In newer and more sophisticated panels, resistors at the detector allow the panel to differentiate between a tamper and an alarm using just one pair of wires for signalling. For this you'd need to measure actual analog voltages. (On a panel I measured recently, the voltage never went above 5 volts).

So first step is to take a voltmeter and measure the voltage between the 0V of the 12V supply and each of the 'A' lines in alarm and non-alarm states.
Ok, understood.
In older and simpler panels, the voltage on one of the two pins will probably always be 0V, and the other will change between 0V (no alarm) and some higher voltage (alarm)
I think this maybe my situation, since the panel has a global tamper inputs, shared by all sensors.

I will measure the voltage, and post the results.

Thanks!

User avatar
pssm
Posts: 5
Joined: Tue Nov 25, 2014 10:07 am
Location: Portugal

Re: Connecting to an existing alarm system

Tue Nov 25, 2014 10:19 pm

So, the value read by the multimeter is 5V when the sensor is triggered. What's the best way to connect it to the GPIO?

Thanks!

danjperron
Posts: 3313
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Connecting to an existing alarm system

Tue Nov 25, 2014 11:32 pm

I do have a small alarm system. I use opto-coupler to detect and set alarm.


Optocoupler use led with a photo transistor. 10 to 20 ma and the led side is around 1.8V so if you have to detect 5V

A resistor of (5V-1.8V)/10 ma = ~ 300 ohm

for 28V (28V - 1.8V) / 10 ma = 2500 ohm (this is 1/4 W) maybe two 1200 ohm resistor in series is better

On the other side of the opto-coupler you juts need to install a 10K pull up to the 3.3v and use any GPIO. This way you isolate the Raspberry Pi from any spike and surge.

The difference with your system is that I added a small cpu in between. But the principle is the same.


I Don't know if you have some IO that you could config on yours. On mine I was able to to set some IO to indicates . Alarm ON , burglar alarm and also I do have an input set to enable/disable the alarm by remote. Very good is one of my kids forget to put the alarm.

I also add the sendmail to my google account. My wife call me big brother for that reason.

Opto-coupler is the way to go.

Sendmail is easy to set.

This is how I called sendmail in 'C'

Code: Select all

sprintf(buffer,"/usr/sbin/sendmail -C /etc/mail/sendmail.alarm.cf -v -f \"%[email protected]" [email protected]</usr/src/alarm/status",buffer);
system(cbuffer)

the * char buffer old the from user and for me is "alarmOff","alarmOn" or "Burglar". I do have the code running at least from 10 years ago. I was using the from user name because at that times Rogers was charging 50 cents to open an SMS. and this way I didn't have to opened it , I knew right away what it was. But now I use gmail. It is as fast . I also switch the server from a Slackware old pentium linux to a small low power Raspberry Pi.

The program creates a status file and execute sendmail using the previous two lines. I use sendmail.alarm.cf which is a little bit different but it is set to my provider pop mail account even if I use my public dns forwarder. I use dyndns.org
Daniel

User avatar
pssm
Posts: 5
Joined: Tue Nov 25, 2014 10:07 am
Location: Portugal

Re: Connecting to an existing alarm system

Wed Nov 26, 2014 10:38 am

danjperron wrote:I do have a small alarm system. I use opto-coupler to detect and set alarm.


Optocoupler use led with a photo transistor. 10 to 20 ma and the led side is around 1.8V so if you have to detect 5V

A resistor of (5V-1.8V)/10 ma = ~ 300 ohm

for 28V (28V - 1.8V) / 10 ma = 2500 ohm (this is 1/4 W) maybe two 1200 ohm resistor in series is better

On the other side of the opto-coupler you juts need to install a 10K pull up to the 3.3v and use any GPIO. This way you isolate the Raspberry Pi from any spike and surge.

The difference with your system is that I added a small cpu in between. But the principle is the same.


I Don't know if you have some IO that you could config on yours. On mine I was able to to set some IO to indicates . Alarm ON , burglar alarm and also I do have an input set to enable/disable the alarm by remote. Very good is one of my kids forget to put the alarm.

I also add the sendmail to my google account. My wife call me big brother for that reason.

Opto-coupler is the way to go.

Sendmail is easy to set.

This is how I called sendmail in 'C'

Code: Select all

sprintf(buffer,"/usr/sbin/sendmail -C /etc/mail/sendmail.alarm.cf -v -f \"%[email protected]" [email protected]</usr/src/alarm/status",buffer);
system(cbuffer)

the * char buffer old the from user and for me is "alarmOff","alarmOn" or "Burglar". I do have the code running at least from 10 years ago. I was using the from user name because at that times Rogers was charging 50 cents to open an SMS. and this way I didn't have to opened it , I knew right away what it was. But now I use gmail. It is as fast . I also switch the server from a Slackware old pentium linux to a small low power Raspberry Pi.

The program creates a status file and execute sendmail using the previous two lines. I use sendmail.alarm.cf which is a little bit different but it is set to my provider pop mail account even if I use my public dns forwarder. I use dyndns.org
Daniel
Hey,

Thanks for the feedback. I've installed DomotiGa in my RPi, and the point of all this will be read the sensors notifications via the WiringPi plugin, and trigger events based on it.

About the circuit, I was thinking of using a simple Zener voltage regulator. Would this be safe enough to connect directly to the GPIO pins?

danjperron
Posts: 3313
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Connecting to an existing alarm system

Wed Nov 26, 2014 12:12 pm

Zener will work.

If the RPi is not near the the alarm system you could end up with spike.

I.M.O. Opto-coupler isolation is the best. Even prevent against lightning.

Also I like the fact that the ground is floating.(they could be at different potential).

There is an DIP ic with quad opto.

Daniel

stevend
Posts: 209
Joined: Fri Oct 11, 2013 12:28 pm

Re: Connecting to an existing alarm system

Wed Nov 26, 2014 9:33 pm

Isolation is always good, and optocouplers are a good way of achieving it. Their problem can be that they need a finite current (1-5mA) to switch, and that can disturb the circuit they are monitoring. If added in series, their voltage drop can also cause problems.

There are some digital isolators (such as these) which solve the level translation and isolation/loading problems in one device - you can operate them with 5V on one side and 3.3V on the other. There's a whole range with various combinations of directionality. Silicon Labs make a compatible range which are generally cheaper than AD if you can get them.

User avatar
pssm
Posts: 5
Joined: Tue Nov 25, 2014 10:07 am
Location: Portugal

Re: Connecting to an existing alarm system

Thu Nov 27, 2014 9:45 am

Thank you guys.

For now I was able to connect the sensors using what I had at my disposal, that is, resistors and zeners. For the final version I will definitely look into your suggestions.

But for now, its working :D

Cheers

Return to “Automation, sensing and robotics”