Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Tools
Old 17th February 2007, 08:44 PM   #1
Default Energy meter design

hello folks,

im planning to build an energy meter for 230V, 2A and around 5% accuracy using an 8bit AVR microcontroller. My inspiration is AVR465 application note .. http://www.atmel.com/dyn/resources/p...ts/doc2566.pdf


The first challenge that i faced is whether to use a tranformerless powersupply or not..

In the application note mentioned above, a transformerless power supply was used (see power supply.png attachement) where this was the description given "The power supply is based on halfway rectification. During negative half-wavescapacitor C1 is charged and during positive half-waves the capacitor is drained.Zener diode D1 (minus the forward voltage of diode D2) dictates to which voltage C2 is charged. Voltage regulator U1 uses the energy stored in C2 to produce a stable output voltage. Resistor R1 controls the charge and discharge of C1 and also limits the current flow through zener diode D1."

where C1 is 0.68uF Metallised Polyester Capacitor, R1 is 470ohms , D2 1N4004 is Diode, 1A, 400V, D1 is Zener Diode , 500mW, 15V .
C2 is 470 uF electrolytic capacitor, U1 is Linear Regulator, 3.3V.
I wish to replace U1 with 7805 regulator to get 5V output.

I trust Atmel people very much but wished to hear from Senior members of electro-tech-online. please see this and review the circuit( is it safe, would it have any side effects ?)

The second challenge is the current front end. I have a 10:1 current transformer and the one that was specified in the application note was 2500:1 far different from the one i have... So i have decided to use a series resistor 0.1 ohms between line,load and neutral and measure the voltage across the resistor(refer to current.png in attachments) by giving it to microcontroller's inbuilt analog to digital converter through an amplifier built using lm358 with gain just enough to bring it in the range of the in built voltage reference 2.56V in the microcontroller.

for example max current =2A rms
voltage across resistor=2A * 0.1 ohms = 200 mV rms

after an opamp amplifier with gain 4. voltage is 200 mV *4= 800 mV rms=2 *square root(2) *.8 peak to peak approx 2.56 V

I was wondering if this would be a safe way to measure current

suggestions and advice greatly appreciated...
Attached Thumbnails
Energy meter design-design.jpg   Energy meter design-powersupply.png  
__________________
impossible says i'm possible
desperadogear is offline  
Old 17th February 2007, 11:24 PM   #2
Default

This isn't for charging people is it?

If our electricity meter was as simple as that I would just connect all the loads from the live to earth and it wouldn't register. I suppose you could get round this by measuring the live but it's not as safe as the neutral.

Does your meter just take the peak voltage then work out the RMS by multiplying it by root2?

This is fine for linear loads that draw a sinusoidal waveform but it won't work with circuits that draw funny waveforms like lamp dimmers and small DC power supplies or any piece of electrical equipment containing a small DC power supply.
__________________

I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.

Please ask on the open forum if you have a question and I'll be happy to help,
if I know the answer.
Hero999 is offline  
Old 18th February 2007, 01:15 PM   #3
Default

Without looking in any great depth, ( which means I've missed a lot) , I have a couple of points to make. Firstly, resistors have a voltage rating, the standard half-watt ones being 250 volts peak. If you exceed this, they tend to go all nasty and non-linear. Use two or three lower value ones in series for the high voltage bits. The capacitors, at 47uf, look well large enough to cause no trouble, but beware of phase shifts if you use lower values.
If you sample voltage and current close together and multiply, then take the average of a lot of multiplied samples over a full cycle of mains, you wil deal with all the bad waveshape and power factor problems without involving difficult math like square roots.
spuffock is offline  
Old 18th February 2007, 01:31 PM   #4
Default

Quote:
Originally Posted by spuffock
If you sample voltage and current close together and multiply, then take the average of a lot of multiplied samples over a full cycle of mains, you wil deal with all the bad waveshape and power factor problems without involving difficult math like square roots.
Excellent idea but if you want to do that you need to remove the low pass filter and add a full wave precision rectifier to the input. The sample rate should also be at least double the highest harmonic you want to sample. I would probably recomend sampling up to the 50th harmonic so your sample rate would need to be 50×50×2 = 5kHz assuming a 50Hz supply.
__________________

I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.

Please ask on the open forum if you have a question and I'll be happy to help,
if I know the answer.
Hero999 is offline  
Old 18th February 2007, 03:18 PM   #5
Default

You have an ordinary old LM358 dual opamp. The circuit is supposed to have an LMV358 new one which has a rail-to-rail output voltage swing. You have its input incorrectly biased.
__________________
Uncle $crooge
audioguru is offline  
Old 18th February 2007, 07:04 PM   #6
Default

Thanks to everyone for patiently helping me.

Quote:
Originally Posted by hero999
Does your meter just take the peak voltage then work out the RMS by multiplying it by root2?
Im building an energy meter(*prototype*) that measures and displays current, voltage, power, energy seperately on a seven segment display.

For measuring the active power im going to take the average of product of voltage and current samples over a full cycle .

For measuring current/voltage separately i would take the average of squares of instantaneous samples and square root it as Mr.spuffock said.


Quote:
Originally Posted by Hero999
Excellent idea but if you want to do that you need to remove the low pass filter and add a full wave precision rectifier to the input.The sample rate should also be at least double the highest harmonic you want to sample. I would probably recomend sampling up to the 50th harmonic so your sample rate would need to be 50×50×2 = 5kHz assuming a 50Hz supply.
why should i do this . cant i calculate rms value for the un-rectified signal.??
The sampling frequency is dictatated by the microcontroller that im using (AVR ATMEGA8) I can make it maximum 153kHz
for 4 MHz crystal, so no problem..


thank you @audio guru. Im gonna replace lm358 with lmv358

I was wondering what this calibration was. I just know it as the process of setting the tobe measured values of an instrument. AVR465 application note was talking about calibration of energy meter using EEPROm. What is this digital calibration? Would i need this??
__________________
impossible says i'm possible
desperadogear is offline  
Old 18th February 2007, 09:45 PM   #7
Default

Quote:
Originally Posted by desperadogear
The sampling frequency is dictatated by the microcontroller that im using (AVR ATMEGA8) I can make it maximum 153kHz
That's more than high enough, I wouldn't think there's any point in going any higher than 5kHz anyway, this isn't high quality audio, it's mains frequency power.

Quote:
Originally Posted by desperadogear
cant i calculate rms value for the un-rectified signal.??
Of course you can but can the ADC on the PIC measure negitive voltages?

A fullwave presicion rectifier is probably the easiest way of getting round this.


http://www.edn.com/archives/1996/031496/06di1.htm
The above circuit also has the advantage of having gain so you can set it to what you like. You could also save parts by using a quad opamp like the TL082 to build two precision rectifiers (one for the voltage and one for the current).

You'll also need a bipolar power supply but that's easy.
Attached Thumbnails
Energy meter design-xformerless-bipol-psu.gif  
__________________

I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.

Please ask on the open forum if you have a question and I'll be happy to help,
if I know the answer.

Last edited by Hero999; 18th February 2007 at 09:53 PM.
Hero999 is offline  
Old 18th February 2007, 10:21 PM   #8
Default

The TL084 is a quad opamp. The TL082 is a dual. The TL081 ia a single.
__________________
Uncle $crooge
audioguru is offline  
Old 19th February 2007, 03:29 AM   #9
Default

very impressive circuit Mr.@Hero999..I was planning to DC bias the signal to exactly (Vref/2) where Vref is the reference voltage available in the microcontroller, so that zero value would come exactly midway to the ADC value and the positive extreme would be ADC register full and negative extreme would be ADC register zero.

Il give a try to the above mentioned circuit as it would make my job of getting back the voltage from ADC register simpler.
__________________
impossible says i'm possible
desperadogear is offline  
Old 19th February 2007, 05:52 AM   #10
Default

Hero999,
i have redesigned the circuit as you suggested (see circuit2.jpg)
The problem with that circuit is that the component names are not clear in the picture can you help me with that. And can i use IC741 as opamp or any better suggestions. I'd need a gain of 8 such that for 2 A current
the voltage across the 0.1 ohm resistor R2 is 200mV rms (200*1.414 mV Vp) and the output of the opamp would be (200*1.414 *gain mV Vp)=(200*1.414*8)mV Vp= 2.26V which would fall under the reference voltage of the microcontroller Vref=2.56V


. Have also modified my previous design(see circuit1.jpg) where i didnt use dual power supply and used lmv358 but DC biased to adjust the signal to fit between 0 to Vref.

which one is better?? any suggestions?
currently im testing them both ..

ps:
I guess i figured out this auto-digital-calibration thing. Its the ability of the instrument to automatically measure the range of input and adjust the gain and to correct errors such that accuracy is better...
Attached Thumbnails
Energy meter design-circuit1.jpg   Energy meter design-circuit2.jpg  
__________________
impossible says i'm possible
desperadogear is offline  
Old 19th February 2007, 09:59 AM   #11
Default

I se there are various opinions on this . No low pas filters are to be used, unles you are also using input rectifiers. If using rectifiers you are restricted to pure resistive loads, anything with a reactive component wil give ridiculous erors. The inputs should be biased to half the range of the adc. A god way to calibrate is to set up with a resistive load and a couple of multimeters, and bung a fat paper capacitor acros the load. As long as the curent is stil within range of the adc, there should be no change in the power reading.
Excuse the speling, I am fed up with corecting this keyboard which wil not type double leters. Filterkeys is OF.
spuffock is offline  
Old 19th February 2007, 11:47 AM   #12
Default

You can't use an old 741 opamp because it needs at least plus 5V and minus 5V to power it, its inputs don't work when they are anywhere near the positive or negative supply voltage and the output doesn't swing very far.

When biased properly, the LMV358 works fine from a single 5V supply, its inputs work down to 0V and its output swings the full supply voltage (rail-to-rail).
__________________
Uncle $crooge
audioguru is offline  
Old 19th February 2007, 11:01 PM   #13
Default

Quote:
Originally Posted by desperadogear
The problem with that circuit is that the component names are not clear in the picture can you help me with that. And can i use IC741 as opamp or any better suggestions.
It doesn't matter, it's low frequency so use the LM741, TL084, LM324 etc. Do watch the current consumption though if you're using a transformerless power supply as it can't provide more than about 15mA depending on the size of the capacitor.

If you can't read the resistor component labels then just remmeber it's simple an inverting and non-inverting amplifier connected together with diodes in their outputs, the formula for the gain is identical to the formua for an inverting and non-inverting amp.

Quote:
Originally Posted by audioguru
The TL084 is a quad opamp. The TL082 is a dual. The TL081 ia a single.
I knew that, the last number denotes the number of op-amps in the chip.

Quote:
Originally Posted by audioguru
You can't use an old 741 opamp because it needs at least plus 5V and minus 5V to power it
Can't he just use a higher power supply voltage then?

Swap the 5.1V zenners for 12V zenners, assuming the PIC can take 12V, if not use a separate 5V regulator for the PIC.
__________________

I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.

Please ask on the open forum if you have a question and I'll be happy to help,
if I know the answer.
Hero999 is offline  
Old 19th February 2007, 11:18 PM   #14
Default

It gets complicated if you use an old 741 opamp to feed the 5V max input to a pic. With a 5V supply, the output high voltage of the 741 will be very low. With a 12V supply it is much too high.

The Cmos inputs of a PIC have protection diodes that can protect the input from a signal voltage that is too high if you use a series resistor to limit the current.
__________________
Uncle $crooge
audioguru is offline  
Old 21st February 2007, 02:19 PM   #15
Default

:-? im confused now... i tried to get myself lmv358 but its out of stock here and unavailable. Shall i go ahead with IC741 and a seperate 12 supply. Micro controller can take till 5V only...

Quote:
If you can't read the resistor component labels then just remmeber it's simple an inverting and non-inverting amplifier connected together with diodes in their outputs, the formula for the gain is identical to the formula for an inverting and non-inverting amp.
thanks for that.
and i better change to a transformer powersupply to avoid current consumption prob..
__________________
impossible says i'm possible

Last edited by desperadogear; 21st February 2007 at 02:29 PM.
desperadogear is offline  
Reply

Tags
design, energy, meter

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Analog Meter windozeuser General Electronics Chat 19 3rd October 2007 03:44 PM
Energy meter Test bench Schematic. tkvenki Electronic Projects Design/Ideas/Reviews 1 6th December 2005 07:07 AM
Energy Meter design dudeshan Electronic Projects Design/Ideas/Reviews 13 7th November 2004 07:12 PM
Energy Meter design dudeshan Micro Controllers 2 10th September 2004 03:03 PM
Energy Meter design dudeshan General Electronics Chat 1 1st September 2004 06:49 PM



All times are GMT. The time now is 02:21 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker