Hayee
Member level 2
Hi All,
I want to measure the Grid voltage in microcontroller and for this purpose I am using opto coupler for isolation and output of opto coupler will be based on input current. following is the circuit
I am using real hardware not proteus for results. also I am using pic18f452 microcontroller and MPLAB for programming
I am getting some results but they are not accurate. following is the chart where I showed the grid voltage "column C" and voltage at uC pin "column D" after optocoupler output. "Column F" is the ADC value which I am getting.
Then divide this ADC value with scaling factor 2.91 to get real voltage value "column H".
"column G" shows the voltage if we apply formula on "column F" that is Vout = (ADC value *5)/1023, it means voltage at ADC pin and voltage calculated in microcontroller are different. What is the cause of this? Am I missing something here?
Also "Column J" shows the actual ADC value according to the "Column D" value. after multiply "column J" value with scaling factor 2.91 I am getting "column K" values.
Hope you guys understand what I am trying to convey.
Need your suggestions to improve the accuracy of this
I want to measure the Grid voltage in microcontroller and for this purpose I am using opto coupler for isolation and output of opto coupler will be based on input current. following is the circuit
I am using real hardware not proteus for results. also I am using pic18f452 microcontroller and MPLAB for programming
I am getting some results but they are not accurate. following is the chart where I showed the grid voltage "column C" and voltage at uC pin "column D" after optocoupler output. "Column F" is the ADC value which I am getting.
Then divide this ADC value with scaling factor 2.91 to get real voltage value "column H".
"column G" shows the voltage if we apply formula on "column F" that is Vout = (ADC value *5)/1023, it means voltage at ADC pin and voltage calculated in microcontroller are different. What is the cause of this? Am I missing something here?
Also "Column J" shows the actual ADC value according to the "Column D" value. after multiply "column J" value with scaling factor 2.91 I am getting "column K" values.
Hope you guys understand what I am trying to convey.
Need your suggestions to improve the accuracy of this