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.

[SOLVED] Will this circuit work for sensing AC Voltages Using Micro-controller?

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,591
Hello! Everyone,

I want to measure the variable AC Voltage, which can vary from 0Vrms to 240Vrms (Frequency is 50Hz)

So will the following circuit circuit work?

AC Sense Circuit.PNG

As i have to measure the 240V at maximum which means 240*1.4142 = 339.411 V = 340V Peak Voltage
So i have to drop down the 340V peak voltage to 5V which is done with the help of Voltage Divider circuit, with R5 = 100k and R6 = 1.5K, and using this i can convert 340V into 5V (340*1.5/(101.5) )

Then i used a diode to clip the negative cycle of the AC signal, I am using 1N4148 diode and it's dropping my voltage by around 1.12-1.18V, is there any other diode which has less Forward Voltage Drop.

So my question is, will this circuit work? Any suggestion.

I am using PIC for measurement and taking samples at every millisecond and after taking sample for 40ms ( 2 complete cycle i will convert these values into VRMS value)

Now I am getting the ADC Count as follow:

0,0,0,0,9,31,52,72,94,243,528,758,913,973,934,798,581,305,10,0,0,0,0,0,11,33,50,70,92,213,502,738,903,971,943,815,606,334,38,0

As you can see there are 5 zeros only but it should be 10, and previously i am getting these value which were as follow:

738,853,865,783,606,359,84,0,0,0,0,0,0,0,0,0,0,26,242,511,719,842,870,797,,633,395,109,0,0,0,0,0,0,0,0,0,0,13,278,543

In circuit i just added this chassis.

AC Sense Circuit.PNG

Please suggest how can i connect AC circuit with micro-controller.
Any other suggestion.
 

Hi,

this has been discussed many times here.
Is there really the need to discuss it again?
A similar measurement is in about every UPS and in every inverter.

What´s wrong with the already given solutions?

Klaus
 
Hi,

this has been discussed many times here.
Is there really the need to discuss it again?
A similar measurement is in about every UPS and in every inverter.

What´s wrong with the already given solutions?

Klaus

Yes you are right, i should take the already suggested circuits from the threads already present.
Will take care of this next time, but this circuit looks much cheaper, and the good thing is that it is working without any problem in proteus and now i am in process to build this circuit in real.
Actually my problem was that, i must get 10 zeros for one cycle of ac, as i am clipping of the negative half cycle, but when i placed a chassis ground my readings gets disturbed and i only get 5 zeros for one cycle which i think was wrong, and i want to know the reason behind that.

Now everything is working fine in proteus, as suggested in some other thread, instead of using ground/chassis reference directly i used a 1MOhm resistor to ground, and then it started working properly, i think such thing is not required in real hardware.
 

Hi,

It seems you like to ask us a riddle.

What resistor are you talking about? --> show a schematic.

Klaus
 
Case 1:

Case1.PNG

As you can see i disconnect the resistor R1, i am getting 10 zeros in adc count ( Taking adc samples per second), which is fine but voltage calculated is higher than the actual voltage.

Case 2:

Case2.PNG

As you can see i directly connected the terminal with ground, which is wrong if we consider the real circuit.
In this i am getting 8 or 9 zeros but RMS voltage calculated by PIC is correct and matches with the AC Voltmeter.

Case 3:

Case3.PNG

Getting 10 zeros and working fine.
In this i used 1MOhm Resistor to connect with DC ground, i read this in your previous post.
https://www.edaboard.com/threads/361359/#post1547397

there is the left side of the schematic referring to GND (Symbol)
and there is the right side (mains) of the schematic. It has no connection to GND. Some simulators have problems with this.
--> a very high ohmic resistor (100M) between both sides could help to run the simulation.

In either way I see a possible problem with the scope. I assume it references it´s signals to GND, which is impossible with Input "A" = mains side.
 

Hi,

Safety first!
Mains AC voltage is dangerous. If you are not experienced with this danger, please stop playing around with mains voltage.

If you are experienced, then decide:
--> Do you want isolation between mains and microcontroller?
--> If Yes, how do you want to achieve it?

****
the given circuit doesn´t work for AC measurement on microcontrollers.
* AC means positive and negative voltages
* The microcontroller ADC input is positive only
--> therefore you need to "modify" the AC signal somehow.

My recommendation is here: https://www.edaboard.com/threads/355515/#post1520931

But there are several other solutions. Please read through post#7 of the above thread.


Klaus
 
You are pretty good in omitting essential details from your schematic.

The "very high ohmic resistor topic" in your previous thread is referring to a pure simulation problem. Your present circuit is however hiding a real problem: How is uC circuit ground related to AC ground, are they connected? As KlausST mentioned, a serial topic at Edaboard.

The circuit as shown leaves the ADC input floating, this probably won't work in simulation but gives unpredictable result in a real circuit. A reasonable correction would use a high voltage diode like 1N4007 in series with R5 instead.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top