I'm creating a logic based circuit and below is my schematic.
The circuit first steps down a 24 VDC input to about 3.7 VDC using a 150K ohm resistance and a 5.1V Zener diode.
This 3.7 VDC is fed to the input of optocoupler PC817 pin 1 and 2.
On the output, I wanted to read the high and low through an Arduino connected to pin 3 and 4 of the optocoupler. I was planning to pass in 5 VDC from the Arduino to one of its digital I/O pin through the optocoupler.
Is there anything wrong here? I'm not able to read the high on the output of the optocoupler. I checked that the voltage around pin 1 and 2 is 3.7v.
I reduced the resistance to about 4K since i didn't have the exact 4.7K as mentioned in the comments below. I also tried 5.6K, however seems like the optocoupler doesn't work in any case.