Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HOW TO MEASURE AND 3PHASE AC pic16f877a

Status
Not open for further replies.

darem

Newbie level 5
Newbie level 5
Joined
Oct 6, 2017
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
57
Hi everyone,
pls i need help on this project

i need to measure the voltage from each line and and the phase angle also will be able to select the one with higest voltage to on the load and if they are all the same voltage not less than 180 , the controller should choose any one itself.. i have less knowledge programimng

thanks in advance.
 

Hi,

safety first: are you experienced with high voltage? Do you know about safety regulations of your country? Air gap, creepage distance?

What voltage do you want to measure? line to starpoint? Is star point = earth GND?
Peak? rectified average? RMS?

Do you need an isolated measurement or is it possible to measure star_pint_referenced?
Is it possible to connect microcontroller_GND with star_point?

A picture could help to clarify.

Klaus
 

three phase measurement.JPG
i have attached the picture . i have experience about high voltage .. but in this i want to know the voltage from each line , that is why every of my line will have its own transformer and the voltage i want to measure is 220v . thanks for your responses ..i appreciate
 

I assume the primary windings are not in parallel or all the readings would be the same!

It should work as long as nothing else is connected to the secondaries but may I make suggestions:
The capacitor values are far too high to see anything but the slowest changes in voltage, if you want a faster response, drop them to maybe 100uF.
You probably don't need to use a bridge rectifier, if you connect one side of the secondary windings to ground and use a single diode it should work just as well.
For protection, add a 5.1V Zener diode across R2, R4 and R6 in case voltage surges cause the PIC input to reach >VDD level.

Brian.
 

Didn't yet hear about intended transformer windings ratio. What is it?

The present circuit is effectively measuring Vpk, which is least accurate way to measure AC voltage because it's most affected by waveform distortions.
 

Pls can u help with the circuit .. I dont get that part thanks
 

Hi,

there are many threads with discusiions about mains voltage measurement.
They disscuss:
* safety
* isolation
* measurement methods with benefits and drawbacks.
* circuits and the part value calculations.
* effort in software and herdware.
(I took part at some of these discussions, therefore I see no need to repeat this all here in this thread)

What else do you need?
There´s nothing different whether you measure one phase-to-starpoint or three phases-to-starpoint.
There are many more discussions in the internet, too.

Still a lot of questions of my post#2 are not anwered yet.

Still unclear why you don´t simply use an existing schematic.
As said before: The transformer connection makes no sense.
And I don´t see the use of different resistor values in "B" channel.

Klaus
 

thanks for the responses.. pls can u help with the link to the site, i av searched but havnt seen one with pic that why i put these here. thanks........ the voltage i want to measure is 220vcorrected.JPG

- - - Updated - - -

thanks for the responses .. pls i have search and i havent seen any..pls help me to post the thread it was discussed.
here is the corrected one .the voltage to measure is 220v.. thankscorrected.JPG
 

The last schematic is completely wrong!

You only need ONE diode in each secondary to make a half-wave rectifier so short out D2, D4 and D5.
Diodes D3, D9 and D6 should be ordinary silicon rectifiers. Assuming the peak secondary voltage is < 10V you can use any of the 1N400x types.
Diodes D1, D7 and D8 should be the 5.1V Zener diodes. The idea is they don't conduct at all unless the voltage is too high for the PIC.

As pointed out, this is not the most accurate way to measure the phase voltages but it will give a fairly close approximation of it. The R, Y and B voltages will be approximately 0.7 of the RMS secondary voltages so ideally you want it to be no more than VDD/0.7 = 7.14V.

Brian.
 

Hi,

Links:
do a search on "AC voltage measurement"
https://www.edaboard.com/showthread.php?t=355515
https://www.edaboard.com/showthread.php?t=358780

Please review your circuit:
From post#4:
"a single diode it should work " --> but you use two diodes (plus a zener)
"add a 5.1V Zener diode across R2" --> but you put the zenere else where

***
connect secondary side of transformer (dot) to GND
connect secondary side (non dot) to diode-Anode
connect diode-cathode to capacitor
connect zener in parallel to R2

**
Then you have a peak voltage measurement (as said, it´s prone to errors)
Tau = 100uF x 20k = 2s (this is slow. This may be good or not - it depends on your requirement)
With a mains frequency of 50 Hz you may expect a rippe of more than 0.5%

***
I recommend you to use some free simulation tool, like LTspice.

Klaus

- - - Updated - - -

Hi,

I just did a measurement at our mains voltage:
We have a peak voltage of 318.2V with an RMS voltage of 229.4V
--> The ratio is 1.387, while one expects 1.414.
This is because the top of the sine is "flattened" somehow by rectifying load. (Although we have a very stable mains voltage)

This gives an accuracy error of about -2%.
But if you have some dimmer circuit nearby you may have the error to the opposite side, caused by some switching noise.

I´d say with your circuit you can´t guarantee a precision-error better than +/-5%.

Klaus
 

thanks for your responses here is the corrected diagram.. wat can i do to make it error free3PHASE.JPG
 

Your schematic is now correct except for maybe one thing: You have to press the switch to start it running because the PIC uses an external reset but you are not providing one until the switch closes. What you need to do it ensure the reset line is low until VDD is high enough for the PIC to run normally. There are many ways to monitor the VDD voltage but the simplest is just to assume it will rise cleanly when you switch on and add a delay in the MCLR voltage following it. You can do that by modifying the circuit around the MCRL pin like this:

1. change R10 to 10K.
2. add a diode across it, preferably a small signal type like a 1N4148 or a BAT85, cathode end to VDD.
3. add a capacitor of say 22uF from MCLR to VSS. This is to delay the voltage rising as it charges through R10.
4. add a resistor of 100 Ohms in series with the switch (ONLY the switch).

The MCLR will now follow VDD with a short delay, the current flowing into the capacitor as it charges will keep MCLR low for a brief time. The diode does nothing in normal operation but it ensures there is a safe path for the capacitor to discharge when you switch off. Without it, if VDD drops suddenly it will discharge into the MCLR pin and risk damaging the PIC. The 100 Ohm resistor is to limit the current through the switch, without it the capacitor would be directly shorted out by the switch when it was pressed which could damage it's contacts.

The accuracy of the measurement depends on what you want it to do. At the moment it will give you a reasonable measurement of the voltage on each phase with respect to neutral. If that is all you want the design is finished. The effect of rectifying each phase to DC before measuring it is you lose the shape of the waveform and any phase information. To get a more accurate result you have to analyze the AC waveform which is far more complicated to do and requires rapid sampling by the ADC (many times per AC cycle) and software to monitor the shape of the results.

Brian.
 

Hi,

what do you expect?
Someone to do your job?

We gave all necessary informations and links to informations. But it seems you didn´t read it.
We asked questions about your requirements, but you didn´t answer them.

You give statements that can´t be fulfilled: "error free". There is nothing that can be considered error free. You may minimize them. How? --> read through the given links

Klaus

- - - Updated - - -

****
I often see zener diodes to protect ADCs inputs from high voltage.

I doubt this is a good solution.
* they cause unlinearity. This means errors (mainly DC) and distortion (mainly AC).
* the zener current is noisy
* there is no positive overvotage protection when ADC is powered OFF

I did some measurements on diode current vs diode voltage.
Here the results.
* I only had a BZX85C5V1 by hand, but I think it is comparable.
* For error calculations I used 6700 Ohms which equals the source resistance of the OP´s circuit
zener-error.png
You see
* at 2.7V about 1% error
* at 3.6V about 10% error

Therefore I recommend to use
* a signal diode to GND (for negative input voltages)
* a signal diode to VCC (for positive vervoltages)
* capacitors at VCC to GND (big enough to handle ESD energy)
* for high energy or low value capacitors I additionally recommend an overvoltage protection at VCC

Improvements:
* use schottky diodes for lower voltage drop
* use "low leakage current" diodes for even less error
* use an additional series resistor (maybe 100 Ohms) between diodes and ADC input ... to limit input current.

Klaus
 

hi ,
you asked of the voltage i wanted to measure .. which i said is 220v, you also asked of isolation measuremnt whic is yes... i want it to be isolated cause i will like to power the pic through a battery of 24v.
i dont want any othe information apart from the pic showing only the voltages of each face and if it reaches a certain level say 180 , the output of the pic to on a led and select that voltage.
 

Hi,

measuring AC voltage and don´t care about waveform and accuracy is easy: use your circuit and you are done.

Measuring AC voltage accurately is somehow difficult.
* you need to define "how" accurate you want it (in percent)
* you need to define what value of the AC you want to measure: Peak (like your circuit) - or rectified average - or true RMS
often one wants RMS.
But calculating the RMS_voltage from measured_peak_voltage is only possible if you have a known and stable waveform.

example: If the input is a clean sine waveform then V_RMS = V_peak / 1.414.
But if the sine is distorted somehow: noise, overtone, unsymmetry, peaks ... then accurate calculation is not possible anymore. The factor "1.414" is not valid anymore.
--> We don´t know the expected accuracy, we don´t know about waveform. So we can´t give an error-free solution.

But maybe you don´t want RMS....and indeed you want the pek value, then your circuit is good.
--> We don´t know what value you want to measure. "220V AC" is not enough information.

But things becomming worse with "isolation".
More distortion, more errors, less accuracy...

****
Isolation:
Running the PIC from a battery doesn´t need isolation.
Connecting the battery "minus" with earth GND is safe. If your star point is earth_gnd, too, then I see no problem.
But we don´t know if your star point is earth_GND .. therefore we must believe in you, that you need isolation.

On the other hand, if you need isolation between battery and star point... then you may use an isolating DC/DC converter. So even if the star point voltage is dangerous you may touch the battery.....but you must not touch the PIC_GND in this case. But if you use a transparent plastic case then you can see the display inside, but you can´t touch it. Safe.

Isolating the analog signal while maintaining high accuracy is very difficult - and thus I avoided this over 20 years of engineering precision industrial measurement equipment.

****

The problem with me is: I don´t want to spend time with guessing (maybe in the wrong direction). I don´t like "trial and error".
I need to know the requirement, the specifications and the environment before ..then calculate - then design - then it will work. Till now: always.

Other engineers have their own way to design electronics - and this is OK, too.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top