Continue to Site

# AC main voltage sampling

Status
Not open for further replies.

#### gehan_s

##### Member level 3
hey all,

i have to design an accurate power meter that measures power drawn by a PC. i am hoping to sample the AC voltage using a 3 resistor devider which converts the AC voltage into a 0 to 5V sin wave which is then converted to digital by a PIC18F.

i am hoping to power the PIC using the USB from the same PC. the problem arrises at this time because i think the 2 grounds (AC and USB) does not match. how can i overcome this problem.

can i use a transformer to step down and isolate the two circuits (AC line and PIC) and then use the resistor devider ?????? if i do that will it decrease the quality of the readings ?????

thanks !!!!!!

#### FvM

##### Super Moderator
Staff member
Transformer introduce some phase error and waveform distortion and may be problematic for high accuracy measurement, but I guess, it's the best option for your project if the current measurement is isolated by a transformer as well. In case of an unisolated shunt current measurement, a direct voltage divider would be the obvious solution.

#### gehan_s

##### Member level 3
this project is to measure power taken by a software when it is running under different loads so it has to measure very slight variations in current and voltages.

since you mentioned current, we are thinking of using a hall sensor IC. the one we are thinking about is acs712 IC. but i think this is not precise enough. can you suggest a different IC for this or mention a better method to measure current.

for measuring voltage can we use a resistor voltage devider to the AC mains to step it down (-2.5V to 2.5V), then use a linear optocoupler to isolate the 2 circuits and shift the sinusoidal wave 2.5V and then give that to the PIC. will this work ????

ransiluj

### ransiluj

Points: 2

#### Tunelabguy

##### Full Member level 5
this project is to measure power taken by a software when it is running under different loads so it has to measure very slight variations in current and voltages.

since you mentioned current, we are thinking of using a hall sensor IC. the one we are thinking about is acs712 IC. but i think this is not precise enough. can you suggest a different IC for this or mention a better method to measure current.

for measuring voltage can we use a resistor voltage devider to the AC mains to step it down (-2.5V to 2.5V), then use a linear optocoupler to isolate the 2 circuits and shift the sinusoidal wave 2.5V and then give that to the PIC. will this work ????
Are you in the same class as the author of this thread? You seem to be working on the same project.

#### ransiluj

##### Member level 1
Are you in the same class as the author of this thread? You seem to be working on the same project.

yes we are in same project. There is one more guy who is doing the microcontroller part. All together there are 3 members in our group.

Status
Not open for further replies.