Industrial proximity sensor as input

Greetings and a happy new year..

i have a question on how to connect a proximity sensor to arduino. So i know that a 24V sensor must have some sort of isolation with arduino and i have a optocoupler for that (could use voltage divier but non the less). All i am not sure of is...do grounds from 24V(sensor side) and 12v (arduino side) have to be connected together in order for this to work? Or are ground supposed to be seperated to corresponding power supplys?

Thank yall!

Hi.

If you connect the grounds of isolated parts of your schematic, you are removing that very isolation.
Doesn't make too much sense to me.
So ask yourself if you really need that isolation (perhaps mandatory in your industrial environment).
If you decide to drop the isolation and use your voltage devider, you NEED to have the GNDs connected or else you'd have a floating (i.e. very unreliable) input.
You also have to consider that using an extra transistor (such as an optocoupler) will invert the logic, but that's easy to handle in your Arduino code.

Okay makes total sense..Thank you!

Hi,
Can you post spec of the proxy sensor.
Most have open collector outputs so that they can be connected to a control system of different logic level voltage.

Opto Couplers in an industrial environment make more sense as an interface, in fact most PLCs use Opto Coupled digital inputs for this reason.

Tom... :slight_smile:
PS. @xcg584 A very good question..

These are some quite old sensor..probably older than me haha..I will take a picture of what is on the sensor ticket. Hope it helps.

A quick test: Connect the + to 5 volts, connect the - to Arduino ground, connect the ZE to an Arduino pin set to Input Pullup. Write program to digital read the input pin and Serial.print() the result to the IDE monitor. Test the sensor with any iron/steel material waved near the tip of the sensor.

Paul

will try..thank you!

The sensor is rated for a minimum of 10 volts, so it'll be unlikely to function at 5 volts.

So connecting brown to 5 volts, white to GND and green to the input pin is not recommended.
But connecting it the way Paul_KD7HB advised, but with the brown wire to your 12 Arduino supply (as stated in your 1st. post), should do the trick.
Don't forget to set the pin as an INPUT_PULLUP

Yes i tried it and it works wonderfull..thank you all for the help!