Hi, I need a schematic or idea, which would protect my machine against
any overvoltage/undervoltage fault. Idea is to switch off the relay
when uC reads high output. So I need an arrangement that could produce
high output (say 5volts), when voltage exceeds 240volts or falls below
180volts ac.
Thanks for any suggestion
I assume that you have a transformer, full wave rectifier and voltage
regulator making the Vcc for the micro to run on and to power the relay.
The AC voltage before the regulator makes a nice safe place to see the
line voltage reduced by the transformer. The 5V you run the micro on
should be good enough to serve as the reference for the comparison.
Lets say you have this:
----- Vx
! Vur
-+-->!-----+------ to caps etc
( !
( !
( !
+----GND !
( !
( !
( !
---->!-----
I suggest this:
+5V
!
\
Vur /
D1 R1 ! \ 10K
Vx---->!----/\/\/--+-----------!-\ ! Logic
! ! >---------+------ To Micro
/ +5V---!+/ LM311
R2 \ !
/ GND
!
GND
D1 = 1N914 or the like
R1 and R2 are about 10K such that:
180 = K * (0.7 + 5V * (R1 + R2)/R2)
K = the transformer's turns ratio
The voltage is too low, if the micro doesn't see the Logic go low for at
least:
0.707 = cos(Angle/2)
Angle = 90 degrees
The voltage is too high if the micro sees the Logic go low for:
0.707 * 180/240 = cos(Angle/2)
Angle = 116 degrees
The micro can time the low pulses.
I avoided measuring at the peak because the rectifier draws a pulse of
current at the peak to charge the caps. This would make the peak
measurement lower than the true value because of the resistance of the
transformer.