2 wire dc inductive sensor interfacing with arduino

Hello! So i want to detect a train and i found this sensor RDS80004 form Honeywell.
Capture
If i supply with 16 V and i use a 1k load resistor i will have 2mA output current for detection and 8mA if it s not detected. how can i connect it to arduino? Datasheet for RDS80004

What sort of train?

This sensor can detect my train because my project is sort of conceptual so it works, i have the approval from my professor, but i don t know how to connect it to arduino

i will have 2mA output current for detection and 8mA if it s not detected.

Put a 510 Ohm resistor in series with the sensor ground lead, and use either a digital or an analog input to monitor the voltage drop. Expect about 1V and 4V respectively. It is a good idea to add a 10K series resistor to protect the Arduino input from overvoltage.

The Arduino ground and sensor ground must be connected together.

Capture

@jim-p @jremington thank you for helping me :slight_smile:

Can you please explain this circuit? I want to use it, but first i would like to understand it. Thank you!

The LM393A is a voltage comparator.
When the voltage at the positive (+) input is greater than the voltage at the negative (-) input, the output will become an open circuit.
When the voltage at the positive (+) input is less than the voltage at the negative (-) input, the output will become connected to ground.

So you see, it works like a voltage controlled on/off switch connected to ground.

The 10K and 22K resistors form a voltage divider putting the negative (-) input to 11V.
According to you, "If I supply with 16 V and I use a 1K load resistor I will have 2mA output current for detection and 8mA if it s not detected"
So when there is 8mA going through the 1K resistor the voltage at the positive (+) input will be: 16V - (8mA x 1KΩ) = 8V
When there is 2mA going through the 1K resistor the voltage at the positive (+) input will be: 16V - (2mA x 1KΩ) = 14V

Thus, when the train is not detected the positive input will be 8V which is less then 11V so the output will be 0V.
When the train is detected the positive input will be 14V which is greater then 11V so the output will be 5V.

Note that the LM393A output is an open collector and requires a pull-up resistor to the desired output voltage, in this case 5V for the Arduino.

Thank you so much! :slight_smile:

Have a nice day!

You too!

@jim-p sorry i have just one more question. What is the utility of that capacitor?

It's called a decoupling capacitor.
When the LM393 switches off and on it will draw a little extra current for a short time.
The capacitor supplies that extra current

1 Like

Thank you again!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.