Newbie question - How to monitor open/closed state of two relays??

Hi everyone -

Utterly new to Arduino here, and looking for a bit of "what would be the best way"
methodology --

I have an Honeywell Ademco alarm system, which has a relay board with it.
I (hopefully) am going to configure the alarm panel system event triggers
such that the relays essentially give me basic status for the system -

I'd like to monitor those relays with an Arduino, and then
feed data about the open/closed state of the relays to a Linux server I have at home,
so that it can put the data on a webpage, to allow me to know if the alarm is armed/disarmed
or whether the system is normal or in an alarm state.

What's the best way to monitor a pair of relay contacts with an Arduino, and provide
instant updates of a state change to a PC ?
I'm assuming USB would be the connection method, unless I
spring for a WiFi/Ethernet shield next --

Thanks, Rabin

Are the relay contacts of interest powered?

I think there is no easy way to monitor the current state of a relay, except by connecting another relay to the relay to be monitored. Then you could use the output of the monitoring relays to tell the Arduino their state. I think you don't even need USB or Ethernet since it's an electrical signal you can feed to an analog input (with due caution).

As for alternatives, it all depends on what you can get from the control unit - can you do more than just switch on a relay when an alarm condition occurs? Say, execute a script to compose a message, open a (serial, ethernet) connection, send the message.

I assume that your home, with the Linux server, is also the place where the alarm system is installed. If so, USB should be fine for Arduino-PC communications.

I don't think so --- as in, there's no voltage flowing across the contacts when they close.

They are the relays on an Ademco 4204CF relay board.
The "CF" series board is the 'supervised' one, which I believe implies
merely that the main alarm panel can tell when the contacts side of the relay
has opened or closed, ie, for triggering a secondary fire panel, or something of the like.

This is the manual for the 4204CF
http://www.walkerhomesecurity.com/home_alarm_manuals/ademco/4204cfii.pdf
I think the info is that the relay has a loop resistor in line, used to determine if the far-end of the circuit is
missing...

Does that help answer your question??

thanks for your help...

rabin:
Hi everyone -

Utterly new to Arduino here, and looking for a bit of "what would be the best way"
methodology --

If you don't want to, or are unable to, break into the circuiry of your alarm system I would suggest taping/sticking a reed switch to each relay. There should be sufficient 'spare' magnetic field around the energised relay to activate a small reed switch. The reed swiches will be independent of any of the alarm system wiring.

rabin:
I don't think so --- as in, there's no voltage flowing across the contacts when they close.

If the relays are being used, there will be a voltage difference between the terminals when they are open. The question is what the voltage is. If it's a low DC voltage, it would be possible to drop that into the range the Arduino an read using a voltage divider so the Arduino can read that and determine whether the contacts were open or closed. But if it is a mains voltage or other high voltage, it would not be safe to connect the Arduino to it.

Drawing current from the relays may alter the monitoring function, i.e. the control unit may detect something unusual going on and signal an abnormal condition in the system. The reed switch looks more promising but I believe it would only detect a change in the state of a relay, not its present state. So you'll have to make assumptions ("if the state changed, then an alarm went off") without the ability to inquire into the state.

A monitoring relay would detect the flow of current from the monitored relay without interfering with it, it could send a notification to the Arduino when it detects a change or be polled by the Arduino to get the present state.

Thanks for everyone's responses - but I think I need to clarify one point --

These two relays that are either open or closed, (#1 armed/disarmed or #2 normal/alarm activated)
are dedicated to notifying me - not to any other purpose in the system.
So I don't have to go about being somewhat careful in how I attach to my alarm system.
I could as easily light up an LED someplace based on the closed/open state of these relays.

My intent is to run wiring (or borrow pairs) from CAT5 wiring that already runs
from the alarm system to where the Arduino is -

I like the ideas some of you have for detecting current in the coil of one relay by magnetically inducing a smaller relay nearby,
which removes any actual electrical connection, etc etc.
Neat idea, and one I'll save for later consideration :wink:

In essence, I guess the question at it's simplest is this:

How can I monitor a switch to see if it's open or closed using an Arduino?

It almost seems that I could use this:

My thought though, is that I want to monitor TWO relays,
so that would need some modifications...

Do I have to consider the effects of my circuit being a larger loop (longer wires) circuit
than that simple 2" tiny circuit with a manual switch?
It would seem in that DigitalReadSerial example that the Arduino
is providing the power, in which case the gauge/length of wiring, etc
would have an effect on how much current the Arduino is being asked to source?

I guess if there are concerns for voltage/current being exposed to the Arduino, I could
use the relay in the alarm panel to just complete a circuit with a secondary power source
to close a reed relay that the Arduino is observing the contacts on....

Does that help folks understand how to help me more?

I really appreciate everyone's input --

thanks, Rabin

I guess the first question to ask is what is the model of the relay you are using. If it has two sets of contacts that close and you are only using one set, you could just monitor the other set. You would use a pullup and the contact closure would ground the signal. So a low on any digital pin on the arduino would mean the relay was closed. If it is an SPDT, and you are using only the N.O. contacts, the N.C. contact could be used. If it is an SPST, then putting a small value resistor in series with the relay coil and tapping off of that would let you know if current was flowing through the coil. Then we have reed switches, hall effect sensors.... There are diferent ways to do it, but the easiest or best way will depend on your parameters.

But, then your question might be the most basic one, "how do I read a digital input?) The answer is digitalRead(pin). We are assuming that your arduino is not controlling the relay because otherwise you would know in software whether it was set or not.

Is your concern that the relays are in some remote location and that is why you are trying to figure out how to read two relays with one pin for example? There are ways to do that, too. But I think you are going to need to be more specific about the paramters of your application. Hopefully these questions helped...

You asked about longer wires... that depends on how much longer. If we are talking several feet, single-ended digital doesn't do so well over long distances. You would want to use a differential driver for that.

rabin:
It almost seems that I could use this:
http://arduino.cc/en/Tutorial/DigitalReadSerial

This is even simpler http://arduino.cc/en/Tutorial/InputPullupSerial

Since you are not drawing any current from the circuit I don't see why in principle it shouldn't work using three wires (2 inputs, 1 ground), but as already pointed out it depends on the length (resistance) of the wires. As for monitoring two relays you can just connect them to two different digital inputs (two pinMode() calls in the setup, two digitalRead() calls in the loop).

A true Arduino geek would probably think of something more creative: Xbee, infrared, laser beams... but a wired solution can be tested really quick.