Convert 24VDC(Proximity sensor) TO 5VDC(Arduiono Input)--NEUBIE

Hi all,

I mostly deal with Industrial PLCs so never had the need to convert my 24vdc signal to 5vdc.

I've seen a lot of ways to go the other way ie Relays.

Here is a quick sketch I came up. Going to start sourcing the parts to build it, but before I do. I was wondering if anyone has come up with it already.

and no using 5vdc sensors is not an option :slight_smile:

I'm attaching the image of it. Don't know how to post it with in the thread :confused:

Thanks.

Angel
California, USA

It might be best to use an opto coupler to avoid ground(loop) problems.

Opto transistor emitter to Arduino ground, collector to a digital input with the internal pullup resistor enabled.
Opto LED with a suitable current limiting resistor (1k or 2k2) to the 24volt source.
Leo..

In the circuit you posted, you don't need anything more than the resistive voltage divider R1 and R2. Connect the 24V and Arduino grounds together and the R1/R2 junction to the Arduino input.

Check the data sheet for the sensor -- many have open collector outputs, which makes interfacing to a 5V circuit completely trivial (no extra parts at all).

Opto-coupler is the go. One opto-coupler, one resistor.

I did my 24V to 5V with resistors but give my vote to the idea of opto.

Needed mine for the same reason as you industrial to arduino using an 827C-D5NP18D 10-30 VDC to read the stroke of a bar shear for a parts counter that could count in multiples of any number I gave it. (ultimate batch counter)

I did suffer ground issues in the prototype that I could have avoided with the opto method.

. I tried the R1/R2 for now an that works like a charm.

Looking into the Opto coupler as well from what I'm reading it will prevent me from frying my Arduino.

Thanks to all of you for your feedback. Much appreciated.

:slight_smile:

-Angel

so whats your opinion resistor or optocoupoler