Detecting when alarm device reverses its polarity

I'd like to try to detect activation of a particular alarm device. The device has two pins, 1 and 2. When the alarm is deactivated, Pin 1 is +24VDC (21-26 volts) and Pin 2 is GND. When the alarm is activated, the device reverses the pin polarity, and Pin 2 becomes +24VDC and Pin 1 becomes GND.

What circuitry and/or code would I need to detect the polarity reversal and treat it as alarm activation?

Bonus: The device actually has two separate-purpose identical-implementation alarms (Alarm 1 Pin 1-2, Alarm 2 Pin 3-4). Ultimately, I'll actually need to detect the activation of Alarm 1, Alarm 2, and both. It may or may not make sense to share certain circuitry (or Arduino input pins) in detecting these separate activations.

You can use an opto coupler. Add a serie diode and a resistor for the selected polarity.

3 Likes

ACS712
or
custom diode bridge

same type LED can be used as Photodiode

Kolaha, I might not be following your circuit diagram correctly, but ... it looks like the Pin 1/Pin 2 input will activate an LED for either polarity, and then the photodiode will activate the Arduino input, so the input will always be activated because, regardless of the polarity, one or the other LED will always be illuminating the photodiode. (Also, I get that "1k" is a 1k ohm resistor, but what is 2k6?)

2k6 is 2.6kΩ. The "k" is inserted in place of the decimal point.

Similarly 1M8 would be 1.8MΩ, and 8R2 would be 8.2Ω.

1 Like

Does this look sane?

This is easier.


A second opto coupler can be added to detect the other state.
Opto transistor to a second Arduino pin, opto LED replaces the 1N4148.
Leo..

Edit: there are currently two threads running for this project, which is against forum rules.

1 Like

I'd probably use two optocouplers, one set up to detect activation and one to detect deativation. That way it is also possible to detect failure of the 24v circuit when the status is neither activated nor deactivated.

2 Likes

Interesting, Wawa. That is, indeed, simpler. But ... why 47k ohm and not ~2k ohm? When I use Digikey's LED Series Resistor Calculator and enter the supply voltage (24V nominal), the 4N25's forward voltage (1.25-1.5V) and the 4N25's forward current (10mA), I get a resistor value of 2250 ohm with a recommended wattage of 0.5 watt (2 x the minimum power of .225 watt). 47k ohm seems like way too much, but I am no circuitry expert.

Edit: Re: your edit: I don't have two threads going about the same problem. I have two threads going for separate problems. But admittedly I'm a n00b and my apologies if I have inadvertently violated forum rules.

Why put more current into the LED, and then waste it in the 10k load on the transistor.

10mA LED current is an optimal value for max CTR (which you don't need in this case).
0.5mA LED current is more than enough to drive the ~150uA pull up current of an Uno pin.

Don't forget to enable pull up with pinMode.
pinMode(optoPin, INPUT_PULLUP);
Leo..

Whatever it is, you will be crusified by any insurance company if and when they find it amongst the ashes.
Then you have others wanting to sue your ass for "playing" with safety devices.
Arduino for one has a policy which forbids the use of their products ( or clones) with such things.

certainly. if alarm system is powered then one of LED lit so you know it engaged, when polarity change the other LED goes on.

1 Like

Not saying you are wrong but …..I would check carefully that alarm output , it is unusual for what you describe to be the case , how are you measuring it? .

Get the user manual for the alarm and have a read .
You should only be using an output specified in the manual unless you use a non contact method , such as detecting the light from a panel light by a separate circuit .
Never modify a fire alarm !!

it is unusual for what you describe to be the case , how are you measuring it? .
Get the user manual for the alarm and have a read .

Indeed, but that's the case. The user manual explicitly states this is how this output works. Furthermore, the user manual says that the screw terminals' labeled DC polarity represents its polarity in the alarm-activated state, opposite its polarity in the deactivated state, and I've confirmed that the screw terminals' DC polarity is currently opposite what's labeled.

You should only be using an output specified in the manual unless ...

Yep

Never modify a fire alarm !!

Absolute not. Never. No modifications planned. This is a screw terminal rated for power-limited devices drawing up to 2.5A. I've decided to go with the optocoupler approach outlined above, so I won't even draw more than 10mA, and then my Arduino-based device will be completely, optically isolated from even that screw terminal.

That makes sense. I hadn't thought of that. I don't know that I'll quite go as high as 47k because some additional reading of the spec sheets and articles about optocouplers suggest that they aren't as reliable below 1mA, but 22.5k would give me 1mA and 23mW, so that seems like a good target. I do wish the spec sheet also provided an absolute minimum activation current instead of just an absolute maximum current.

Yep, thanks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.