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.
Relays should work, as long as whatever is powering the tower lights has enough output to power the lights and relay coils as well. Likely it will.
One option is to use optocouplers to provide isolation. They are an LED and photodiode in a DIP package. Wire the LED in parallel with a tower light, using an appropriate series resistor (~ 2K2 ). You can then use the photodiode side of the opto to trigger your 5V circuit.
Or there’s the real simple approach if you can use a common ground and don’t need isolation. Use a couple of resistors as a voltage divider to drop the 24V down to 5V.
Thank you for your detailed answer.
Optocoupler I think they get trigged just by low currents.
How can I wire 24V relay(s) or voltage divider with Arduino and the tower light ?
Thank you.
And what the switch is for ?
If you can explain the role of a pull down resistor here ?
Should I press it everytime I want to get a signal ?
and how it will be wired ?
Excuse my lack of knowledge.
When the relay is on you have 5v on your input. When the relay is off your input is floating at an unknown voltage. Floating inputs are bad. The pull down resistor weakly pulls the input to ground in this case. 10K Ohm is a good choice. Search the internet for a diagram
Just as well I gave you two other options then. Both draw less than 15mA which will imperceptibly dim the lights.
I tried to work with only one relay, and make this code to display its status, but the only thing I get is when relay is “ON” when it’s hight in all cases : with or without 24V power supply.