Hi guys. Could anyone help with connection 24v relay to arduino? The fact is that I need to check 24v into turnikets and make some action when people pass through turniket. (in this moment in port appear 24v as impulse for 200ms). Could you advice how to properly connect relay (not shield) to arduino?
So you have a relay with spare outputs that aren't connected to anything else? Then wire them up as if they are a button. Use the Arduino internal pullup and you don't need any components except wires.
If there are no spare outputs, then can you change the relay to one that has more pins, or add an extra relay alongside?
An optocoupler is probably the best way to interface with an external circuit. This can be put on either side of the relay (the coil or the output), the choice being driven by which side you know more about the voltage+current available.
If the relay contacts are not used for anything else they don't need to be connected to 24V. (If the relay coil operates from 24V, that's fine since the coil and contacts are isolated.)
You can knock-down 24V to 5V with a [u]voltage divider[/u] (2 resistors). A voltage divider where the total resistance sums to somewhere around 1K to 10K is usually fine. (Lower resistance consumes more current, and if the resistance is too high you can pick-up noise.)
If the 24V is not stable and regulated, add a [u]protection diode[/u].
And, I'm assuming that's +24VDC? The Arduino can be damaged by negative voltages (including AC which swings positive and negative) or by voltages greater than +5V.
The fact is that I need to check 24v into turnikets and make some action when people pass through turniket
Do you mean TOURNIQUET or
?
What , (exactly) , does this mean ?
Can you draw a schematic an post a photo of it?
Do you mean you need a voltage LEVEL-CONVERTER (24V =>5V) ?
Lotusv:
this moment in port appear 24v as impulse for 200ms
Please see the attached schematic. Capacitor C1 is optional. Diodes can be 1N4148 or similar. Also you can use a dual diode, such as BAV99.
That should work