3 Replies Latest reply on Jul 2, 2018 6:13 AM by SampathS_11

    RMS Voltage Calculation for AC input

      Hello there,

      I am having PSOCEVAL 1 CY3210 Kit with me. I need to measure the max and min voltages for the ac input signal that i am giving. The signal is a sinusoidal with pk to pk of 3 volts, oscillating in 0.5 to 3.5 volts at frequency 500 Hz. I am using a signal generator to give the input so i am at liberty to set the frequency. I have varied the DC offset as for the voltage input to be only in positive.

      I need to calculate the Vmax and Vmin peak values of the signal. Then Vpeak= (Vmax- Vmin)/2

      Vrms=Vpk*0.7071

       

      This what i am aiming to acheive. I am now using a voltmeter project that i got form the cypress and i am trying to edit the program to be suitable to my need.

      The project is using the input to go through a PGA with 1 gain. Then it is sent through ADCINCVR with 12 bit resolution.

      I am using a simple method to get Vmax and Vmin as follows. I am trying to display both on the LCD.

      if(fVolts>temp1){

      temp1=fVolts; //Vmax

      }

      else if(fVolts<temp2){ //Vmin

      temp2=fVolts;

      }

      The problem is that both values shown are DC bias values and both are same.

      I am attaching the project here. Please help me with this.

       

      Regards

       

      Shravan