Hello everyone,
I am working on a project based on Arduino, but currently stuck.
I have three 24V lights to monitor, sent by a tower wired to a machine. My idea is to use a relay to convert first 24 voltage to 5V, so I can then work with Arduino, reading realy status.
I know how to let Arduino do the processing, but the problem is how I can get the data from the three patrol lights.
I thought of wiring 4Pin DC Power Relay with each 24V signal the following way
Relay coil with tower wires (VCC and GND)
Relay contacts with Arduino Pins (NO, COM, NC)
Still don't know if I made the right choice choosing a relay or not. I'll be grateful if you help me on this point.
24VDC ?
I’d use a resistor and opto to isolate the 24 from the Arduino input.
.
Or a voltage divider with common 0V if you’re not worried about isolation.
What's the difference between an opto and a relay ?
And how can I wire it to my tower light in this case? and how many opto do I need ?
Is there a specific optocoupler to use ?
I alrealy mentioned it.
For what I want, is just to track data from a tower light. I thought of using a relay but @lastchancename suggests an optocoupler.
A relay is one solution and it might be the best & easiest solution if the 24V is AC. You can use the built-in pull-up resistors and then wire the relay contacts to ground the input when the relay is activated (or you can use the NC contacts to reverse the logic).
A regular electro-mechanical relay is pretty foolproof because it's just an electrically-isolated and electrically operated switch. (Solid state relays are something like a high-power optical isolator and they don't always work in place of a regular switch.)
An opto-isolator (obviously) provides isolation, as does a relay, so you don't need a common ground between the lighting and the Arduino. Most other solutions require a common ground, which probably
If it's 24VDC and well regulated a Voltage Divider (2 resistors) is the cheapest and easiest solution. It's the ratio of the resistors that's important but resistors that sum-up to about 10K is a good start.
If the voltage is not "solid" you can use an over voltage protection circuit (a resistor and diode). But increase the resistor to about 10K). With lower resistance you get more current and you have to start calculating the power dissipated by the resistor, etc.
...I use the resistor & diode method in 12V automotive applications because the 12V varies.
For all the concerns you listed, and good reasons in addition, you are probably better off with optoisolators.
As @DVDdoug mentions in #11 above. One way to do it. IMO for you and this, the best optoin.
The tower side is just like running an LED off the 24 volts that the lamps take. A suitable series current limiting resistor is all you need to add. A reasonably wide variation of the 24 volts will be well tolerated.
The Arduino side is equally simple, no more than (and maybe not even) a single resistor to add.
There will be no electrical connection between the tower and the Arduino, unless you want to make one. Not necessary.
The only component this arrangement puts at any real risk of damages is the optoisolator.