Hello everyone,
I have a question related to an AC/DC circuit and a microcontroller. The idea is that my PIC microcontroller can detect when the input voltage exceeds 90V. So, I'm thinking of using a bridge rectifier to convert AC to DC, then a voltage divider to step down the voltage, and finally, a comparator (like the LM393) to compare it with a reference voltage.
Has anyone here had experience with this kind of circuit? Could you give me some advice? Thank you all for reading!
Additional Notes (if needed for clarity):
Bridge rectifier (GBU406)→ Converts AC to pulsating DC.
Voltage divider → Reduces high voltage to a safe level for the microcontroller.
Comparator (LM393) → Compares the scaled-down voltage to a reference (e.g., 2.5V) to trigger the PIC when input > 90V.
Can u guys give me somes suggestions for component values (e.g., resistor ratios) or circuit protection (like a Zener diode) if thats in case?
how many components?
How accurate?
How clean is the output signal?
****
I have some experience in designing measurement equippment.
How I´d use it:
* 1 capacitor - 3 resistors (as voltage divider + biasing) --> ADC (microcontroller).
The rest is microcontroller software.
Low part count, highest precision ad accuracy, timing adjustable by softwaer, without soldering.
Note also that many PICs have a built in fixed voltage reference "FVR" and comparators, even some of the cheap 8 pin ones. It could save you some components. Configure the FVR as a reference to the comparator or the ADC then all you need is the resistive divider.
You might want to add R / diode clamps to input signal path in case
input is dirty/transients. The in code just sample R divider to find max
average value for your test purposes.
Consult processor datasheet for input considerations, eg. R1 effect on sampling, if any.