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.

Measure Mains AC current

Status
Not open for further replies.
Hi again,
Is it that you dont have any uC code to work with yet?
That is one of the problems.I have earlier written the code where the ADC value is sampled and that value is compared with a preset value and action taken but now i realise that i was only measuring the peak value and not rms value,which is what i need.So i am writing that.I will try your circuit with a reduced gain soon.I am waiting for the boost converter boards to arrive,so i can get evrything to integrate and try.

smanches said:
if (adcCurrent > maxCurrent)
dutyCycle--;

It's a bit simplified, but that's all it does. If you're looking for integration formulas, I think the ones DK provided would probably be much better. All I do right now is average the last 4 samples just to reduce the transients and use the value directly to reduce the PWM duty cycle

Who or what is DK ?:confused:
The PIC is having a good function of getting the max value from ADC reads (or so i understand) .My freescale device too has it but then i have to use it in continuos running mode , automatic compare,and value greater than,bits enabled in a register.But i need a window comparator so i think i will figure this out soon.

Thanks for being supportive guys:)

Thnaks and regards
 
That is one of the problems.I have earlier written the code where the ADC value is sampled and that value is compared with a preset value and action taken but now i realise that i was only measuring the peak value and not rms value,which is what i need.So i am writing that.I will try your circuit with a reduced gain soon.I am waiting for the boost converter boards to arrive,so i can get evrything to integrate and try.



Who or what is DK ?:confused:
The PIC is having a good function of getting the max value from ADC reads (or so i understand) .My freescale device too has it but then i have to use it in continuos running mode , automatic compare,and value greater than,bits enabled in a register.But i need a window comparator so i think i will figure this out soon.

Thanks for being supportive guys:)

Thnaks and regards


Hi again,


If all you need to do is calculate the rms from the peak all you have
to do is divide by 1.4142, but many times you dont really need to do
this because the peak stays in proportion to the rms value anyway,
so you can make your setpoints based on the peak value rather than
the rms value.

Hey i like that "DK" for short because it's easier to spell :)
 
Hi

Just to let you know guys...last week i have successfully tested it out..its quite stable for now

Thanks for the immense help....:D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top