connect optocoupler output to MCU input pin and LED

Thread Starter

Lavanya.R

Joined Dec 9, 2014
20
I have deisgned a PCB which will accept sensor voltage ranging from 5-24VDC, and attempting to monitor the status of a Capacitive Proximity sensor (24V o/p) via one of the Digital Inputs of microcontroller. To ensure isolation between the input and the controller side, I've employed an opto coupler. I've attached the schematic I've been utilizing. Despite this setup, the LED connected to the digital pin isn't illuminating. Upon measuring the voltage across the digital pin during a logic HIGH state, I observed a drop of 1.8V. Could someone kindly provide insight into why the LED fails to illuminate?
The LED i'm using in this pcb is, in which one LED indicates input status, the other will indicate digital output generated by the controller
https://www.digikey.in/en/products/detail/kingbright/WP934CA-2GD-90/3084288

Additionally, I require some information: Can I interface an Inductive Proximity sensor alongside the Capacitive Proximity sensor, as depicted in the attached schematic?

1714813546066.png

so after searching google finally arrived to a circuit, but want to make sure, this time it will work before making PCB. So can one tell me is this right circuit to proceed
updated circuit:

1714815508739.png
 

Ian0

Joined Aug 7, 2020
10,269
Are you testing it with 5V or 24V?
At 24V you will get 5mA through the optoisolator diode, which should give about 2.5mA through the LED which will not be too bright, but you should see it.
At 5V, it will be rather dim.
 

AnalogKid

Joined Aug 1, 2013
11,196
It looks like the four optocoupler input diodes are connected backwards. IF the sensor can supply sufficient current at 24 V, Then the input anode goes to the 24 V signal through a current-limiting resistor, and the cathode goes to GND.

Also,, on the output side: Is the Current Transfer Ratio (CTR) of the optocoupler sufficient to guarantee enough transistor current to drive the LED and a low enough output voltage to satisfy the MCU input? Per the schematic:

Opto input diode Vf = 1.5 V
LED Vf = 2 V

The opto input current is 22.5 / 10,000 = 2.25 mA.
The LED current is 1.3 / 100 = 13 mA
This would require a CTR of 578%

ak
 

Thread Starter

Lavanya.R

Joined Dec 9, 2014
20
Are you testing it with 5V or 24V?
At 24V you will get 5mA through the optoisolator diode, which should give about 2.5mA through the LED which will not be too bright, but you should see it.
At 5V, it will be rather dim.
Both...
 

dendad

Joined Feb 20, 2016
4,503
For a start, can the sensor sink enough current?
Also, as has been mentioned, the Zener diodes are the wrong way around. You do not need the Zeners as the opto has back to back LEDs on its input.
If you want wide input voltage range, the 10K resistors shown are too high. So are the 2 x 2K2 resistors. The optos can take 50mA max so try using a single 560R series resistor on the opto inputs to turn the opto's LED on therefor the opto transistor too. An ultra bright LED on the output will let you get away with less output current too, therefore you can use a higher value LED resistor..
 
Top