pisces12
Junior Member level 2
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?
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?