Hi All.
I need a simple circuit to allow a micro-controller to detect if 120VAC power is present. Fast turn on / turn off isn’t that critical, just reliable detection, preferably using a digital input rather than an analog one.
I'm thinking of the circuit in attached jpg. My goal is to saturate the transistor during its ‘on’ time so that the voltage across C1 rises to a solid logic High as it charges. During the portion of the 60 Hz cycle where the transistor is off, the time constant of C1 / R3 should prevent the output from sagging too much.
When the 120VAC goes away, it might take a time constant (C1/R3) or a little longer for the output to drop below Vin-low-max for the Teensy. That doesn’t matter for my application.
Appreciate any thoughts from those who have done this before.
Thanks.
I need a simple circuit to allow a micro-controller to detect if 120VAC power is present. Fast turn on / turn off isn’t that critical, just reliable detection, preferably using a digital input rather than an analog one.
I'm thinking of the circuit in attached jpg. My goal is to saturate the transistor during its ‘on’ time so that the voltage across C1 rises to a solid logic High as it charges. During the portion of the 60 Hz cycle where the transistor is off, the time constant of C1 / R3 should prevent the output from sagging too much.
When the 120VAC goes away, it might take a time constant (C1/R3) or a little longer for the output to drop below Vin-low-max for the Teensy. That doesn’t matter for my application.
Appreciate any thoughts from those who have done this before.
Thanks.