+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Junior Member level 2
    Points: 743, Level: 5

    Join Date
    Dec 2009
    Location
    malaysia
    Posts
    22
    Helped
    0 / 0
    Points
    743
    Level
    5

    ac voltage and current measurement using adc

    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?

    •   Alt14th January 2010, 11:27

      advertising

        
       

  2. #2
    Full Member level 2
    Points: 2,441, Level: 11

    Join Date
    May 2008
    Location
    KERALA
    Posts
    128
    Helped
    26 / 26
    Points
    2,441
    Level
    11

    Re: ac voltage and current measurement using adc

    Hi pisces12,

    You can't find the rms in that way. You need to take many samples and find the rms value. See this application note from MICROCHIP:
    http://ww1.microchip.com/downloads/e...tes/00939a.pdf

    (it is ww1) or search for AN939 appnote in GOOGLE.



+ Post New Thread
Please login