Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mains under voltage detector

Status
Not open for further replies.

ssaguiar

New Member
Hi to all.

I am working in a poject in wich a pic controls an electric oven.
In the original circuit, there is a mains sensor so, if the mains power drops below some level, the pic turn off the oven.
The circuit pictures are attached below.
I just don't understand how this circuit is suposed to work and why it uses 2 pis of the pic (pin 4 - RA3 and pin 9 - RC7/AN9).
Ra3 is an input/output only pin and pin 9 is an input/output or analog.
In the circuit, the main voltage is rectified by D1, D2, D3 and D4, wich generates V_IN1 and V_IN2.
V_IN1 is regulated by a 7.5 Volts Zener diode and pass thru he circuit made by Q3/D2/R8 to generate the pic's suply.
V_IN2 pas by the circuit composed by D6/D5/C2 to generate the -12 Volts supply for the reles and buzzer.
The ground is made by the comon conection point at C1/D4 and D5/C2.
At the mains rectifier circuit, the mains voltage pass trhu the 1M / 2200 capacitor and the 47R resistor and the 150 K resistor and feeded to the R3 and R4 resistors.
Then, one circuit go to pin 9 thru the circuit composed by R5 (1K1 / 1% resistor) and D3 (3.9 Volts Zener). This pin can be analog pin or i/o pin.
The other circuit, composed by D1 Zener, R1, Q1 and R1 make the circuit wich goes to the pin 4, wich is an i/o pin.

I just don't get how this circuit work.
Can anybody help to analyse this?

Thanks
 

Attachments

  • circuit1.jpg
    circuit1.jpg
    78.7 KB · Views: 221
  • circuit2.jpg
    circuit2.jpg
    23.1 KB · Views: 206
  • circuit3.jpg
    circuit3.jpg
    32.2 KB · Views: 192
Last edited:
I would have thought it's quite simple?, the digital input is used to detect the zero crossing point of the mains, the analogue input actually measures the voltage.
 
I would have thought it's quite simple?, the digital input is used to detect the zero crossing point of the mains, the analogue input actually measures the voltage.

Thanks, my friend, for your answer.
Let's see if I understand how the circuit works.
The zener diode is to keep the voltage, at transistor's base, at a secure level (max 3.9 Volts).
When the main's voltage is above 0, the transistor is saturated and the level, at the pic's pin is 0.
When the main voltage arrives at 0, the transistor will not conduct and the level, at the pic's pin will be 1.
Is this correct?
For the other circuit, the one that goes to the ad pin, the zener diode is to keep the max voltage at the pic's pin, at 3.9 Volts, and the 1K1 resistor with the 10K resistor, make a voltage divider.
Is this alo correct?

So, in the software, when the pic's i/o pin is at logical level 1, it's time to read the mains voltage.
I start to read the a/d, after the i/o pin goes to 0, and at this point, for some time, while the level at the i/o pin is 0, I keep reading the a/d.
After that, I pick the higher value read and this will represent the voltage at mains power supply (for the positive ac semi-cycle wich represents 1/2 of the total mains voltage).

Is this right?

Thank you very much.
 
Last edited:
That's pretty well it, but normally you would just time the ADC read after zero crossing, rather than multiple reads.

The VERY old (16C84) EPE project for a mains power meter used a preset to adjust the reading point to match peak voltage, I built one way back when.
 
Ok.
In our country, the mains power is cycled at 60Hz, so the period is 16.67 ms.
Then, I wait for the crossing 0 Volts and wait 1/4 of this time (4.17ms), so I will be at the peak of the semi-cycle (almost).
Even if I don't get exactly the peak of the semi-cycle, I think that there is no problem because the radings will be allways relative to this timming.
When I detect the 0 volts, I don't know if the next semi-cycle will be positive or negative. As can be seen in the schematics, the 150K resistor is conected directly to the mains, so, the voltage, after the zero pass, can be either positive or negative. If I read after the zero crossing, how to know if I am reading the right semi-cycle?
 
Ok.
In our country, the mains power is cycled at 60Hz, so the period is 16.67 ms.
Then, I wait for the crossing 0 Volts and wait 1/4 of this time (4.17ms), so I will be at the peak of the semi-cycle (almost).
Even if I don't get exactly the peak of the semi-cycle, I think that there is no problem because the radings will be allways relative to this timming.
When I detect the 0 volts, I don't know if the next semi-cycle will be positive or negative. As can be seen in the schematics, the 150K resistor is conected directly to the mains, so, the voltage, after the zero pass, can be either positive or negative. If I read after the zero crossing, how to know if I am reading the right semi-cycle?

It's fed from a bridge rectifier, so all readings are positive.
 
It's fed from a bridge rectifier, so all readings are positive.

The voltage, wich arrives at this circuit, is feed from one of the mains wires (W?), thru the 150 K resistor. The brige delivers V_IN1 and V_IN2 (positive and negative).
Using an osciloscope, I can see the waveform at the common point between R3(10K) ,R4(10K) and R?(150K) and i'ts an alternate waveform with a total amplitude of 20 volts (+10 to -10 Volts).
 
Sorry, I hadn't noticed the bridge was that way round :D

So simply read each half cycle, and ignore the low one.

Or does the zero crossing pulse only work every full cycle?, scope that.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top