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.

ac voltage and current measurement using adc

Status
Not open for further replies.

pisces12

Junior Member level 2
Joined
Dec 2, 2009
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,436
hi...

i have to measure voltage and current from the main ac supply 240 ac by using pic16f877a. the voltage and current input will be measured using built in pic adc. im using voltage and current transformer to scale down the input value to 0-5V range. so, i write this code in order to get back the real value of the current and voltage :

unsigned int temp_v, temp_i, Irms, Vrms;

int

void calc ()
{
temp_v = Adc_read (0);
temp_i = Adc_read (1);
Vrms = temp_v * (240/1023);
Irms = temp_i * (100/1023);
}

is it the conversion is correct?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top