Detect AC or DC on same lead

crutschow

Joined Mar 14, 2008
34,452
Here's the circuit with two optos.
The Out_AC (yellow trace) is only high for the AC input, and the Out_AC_DC (green trace) is high for both AC and DC inputs.

1579398228212.png
 
Last edited:

Thread Starter

LST

Joined Jan 17, 2020
12
At first glance, very nice, crutschow. Thank you! I'll digest it further tomorrow.

As you pointed out, the merging of the other 2 circuit wasn't going to work.
 

AlbertHall

Joined Jun 4, 2014
12,346
Here's the circuit with two optos.
The Out_AC (yellow trace) is only high for the AC input, and the Out_AC_DC (green trace) is high for both AC and DC inputs.
I would suggest adding a reverse connected 1N4148 across the LED in U1 To cope with the leakage in the 1N4004.
 

crutschow

Joined Mar 14, 2008
34,452
I doubt that the low reverse leakage current of a 1N004 will cause any degradation of the opto input LED, since the reverse current dissipation in the LED would be very low.
But adding the diode is fine.
 

panic mode

Joined Oct 10, 2011
2,751
Which BJT and what voltage? The transistor in the coupler only needs to handle the 5V for the micro.
i was responding to Crutschow post about using BJTs as a current source on the AC side of the optocoupler.
so in this case transistor Vce need to tolerate AC peaks plus some reserve. this is much higher than 5V that is on optocoupler output.
 
Top