Interfacing optoelectric proximity sensor with arduino

sheel:
I have experience in programming and arduino of over a year now. But I am pretty new to electronics.

TomGeorge:
Hi,
OP Diagram.


So you have NO current limit resistors, you need current limit resisitors
Can you tell us your electronics, programming, arduino, hardware experience?

Tom... :slight_smile:

Just to verify the circuit, when I replaced the sensor with a limit switch, the problem remained.
But when I added a delay of 100 milliseconds, the program worked with limit switch.
But it still fails with sensor.

TomGeorge:
Hi,
Is this how your circuit is constructed?

If so, unplug the USB port and do not use it until you know about current limit resistors for LEDs, and I am worried about the 24V supply for the sensor yet direct connection to the arduino input.
Tom... :slight_smile:

TomGeorge:
Hi,
Is this how your circuit is constructed?

If so, unplug the USB port and do not use it until you know about current limit resistors for LEDs, and I am worried about the 24V supply for the sensor yet direct connection to the arduino input.
Tom... :slight_smile:

Just to verify the circuit, when I replaced the sensor with a limit switch, the problem remained.
But when I added a delay of 100 milliseconds at the end of the loop(), the program worked with limit switch.
But it still fails with sensor.