I am not getting correct voltages from Voltage sensor

Hello,

I am try to ready ac voltage but my sensor is giving me very off voltage.
i have searched the net for the sensor. in the video the guy just uses an oscilloscope to calibrate it but since i dont have an oscilloscope so i could'nt get it calibrated fine.

here is what i am getting.

Provided Voltage : Sensor Show This Voltage

240 215
230 211
220 206
210 205
200 200
190 195
180 190
160 184
150 180
100 155
50 110

here is the video;

here is the sensor;
https://hallroad.org/product/single-phase-ac-voltage-sensor-module/

here is the code used;

#include "EmonLib.h"             // Include Emon Library

#define VOLT_CAL 148.7

EnergyMonitor emon1;             // Create an instance

void setup()
{  
  Serial.begin(9600);
  
  emon1.voltage(1, VOLT_CAL, 1.7);  // Voltage: input pin, calibration, phase_shift
}

void loop()
{
  emon1.calcVI(20,2000);         // Calculate all. No.of half wavelengths (crossings), time-out
  
  float supplyVoltage   = emon1.Vrms;             //extract Vrms into Variable



  Serial.println(supplyVoltage);
}

I don't know anything about the EmonLib, but the [u]map()[/u] function should help if the voltage out of the "sensor" is linear. You might want to take the raw ADC readings (finding the peak or RMS or whatever) and map the ADC reading to voltage, rather than mapping the wrong voltage to the right voltage.

DVDdoug:
I don't know anything about the EmonLib, but the [u]map()[/u] function should help if the voltage out of the "sensor" is linear. You might want to take the raw ADC readings (finding the peak or RMS or whatever) and map the ADC reading to voltage, rather than mapping the wrong voltage to the right voltage.

can you please explain a little

Do you have a multimeter?

Could it be that OP is using a mains to DC sensor, while the EmonLib is expecting a common AC transformer.
Leo..

He should meter his mains ACV to be sure he gets the full 240/250VAC. I have used Tripplite power conditioners to clean up and level 120VAC and here I use a UPS to do the same + powerout shutdown time.

GoForSmoke:
Do you have a multimeter?

Yes i have a multimeter.

Wawa:
Could it be that OP is using a mains to DC sensor, while the EmonLib is expecting a common AC transformer.
Leo..

I am using AC voltage.

GoForSmoke:
He should meter his mains ACV to be sure he gets the full 240/250VAC. I have used Tripplite power conditioners to clean up and level 120VAC and here I use a UPS to do the same + powerout shutdown time.

I am using a variable AC transformer to change the voltage to see the readings

Umair78:
I am using AC voltage.

Yes I know you're trying to measure 230volt AC.

But EmonLib is programmed for an AC/AC transformer, and it seems you're using an AC/DC module.
Do you have a datasheet for that module.
Leo..