Arduino ADC Analog read

Hello, my name is Marco Castro. I’m new in this forum.
I am working on the energy monitor device using Arduino UNO, my device uses a voltage sensor ZMPT101B, for the current use of the SCT100 and the line <Emonlib.h>. The prototype is working well, the values ​​that both sensors are correct compared to the reading of the multimeter, the data is displayed on the serial monitor, this data is sent to the web using the Ethernet shield. the data on the web is the same as the data that appears on the serial monitor, but when I disconnect the Arduino USB cable from my computer and check the data on the web, the voltage data show several differences between the actual data regarding the Voaltje Sensor reading data. I try to correct the error by modifying the calibration parameter for the Voltage sensor but the results are not good.
However, if I connect the Arduino USB cable to my computer, the data read from the sensor is correct and the data on the web is correct.
I do not understand what happens.
Can someone help me please?
Thank you.

Have you found a comprehensive data sheet for the ZMPT101B? From what I have found, it is not clear if this device has its own voltage reference, or if it is dependent on the accuracy of the supply voltage.
Clearly, the supply voltage can vary depending on the power source used.

Errors after unplugging the USB connector usually result from a lack of a common ground connection. How do you power your circuit?

Another source of error is the reference for the Arduino ADC, which I’m guessing you are using. By default it uses Vcc as a reference , so if that changes so does the span of the A/D. To fix this use the internal reference .

6v6gt:
Have you found a comprehensive data sheet for the ZMPT101B? From what I have found, it is not clear if this device has its own voltage reference, or if it is dependent on the accuracy of the supply voltage.
Clearly, the supply voltage can vary depending on the power source used.

Hello, thank you for your quick response. Yes, it is true, the technical information for this sensor is not adequate.
The power supply that I am using in this project is the mini Hi-Link 5VDC / 3W, the (+) is connected directly to the VCC of the Arduino USB connector on the lower PCB, the ground connections of the power supply are connected to Arduino GND.
The 5V PIN (OUTPUT) of Arduino is used to provide power to the sensor and the Ethernet shield.

In order to verify if the power supply that I using on this project. I will to use a lab power supply and make some testing.

I will inform you

For your support thanks.

PD: Sorry for my poor English, I speaking Spanish.

DrDiettrich:
Errors after unplugging the USB connector usually result from a lack of a common ground connection. How do you power your circuit?

Hello, thank you for your quick response. In theory all the ground connections are has a common ground but I will check again very carefully.

I will inform you

For your support thanks.

PD: Sorry for my poor English, I speaking Spanish.

hammy:
Another source of error is the reference for the Arduino ADC, which I’m guessing you are using. By default it uses Vcc as a reference , so if that changes so does the span of the A/D. To fix this use the internal reference .

Hello, thank you for your quick response. the prototype use the internal reference of Arduino Uno = to 1.1 volts. I do not now if this reference will be change by the power supply, So I will use a lab power supply in order to check if the problem is in the mini Hi-Link 5VDC / 3W power supply that I using on this poject.

Do you know how. I can to check if the internal referece is correct. ?

I will inform you

For your support thanks.

PD: Sorry for my poor English, I speaking Spanish.

hammy:
Another source of error is the reference for the Arduino ADC, which I’m guessing you are using. By default it uses Vcc as a reference , so if that changes so does the span of the A/D. To fix this use the internal reference .

Only true if the sensor you're trying to sample uses an absolute voltage output. Some sensors work like that, others are ratiometric (i.e. output voltage fluctuates with Vcc) and are best read using the default Vcc as reference.

OPs symptoms suggest that this sensor is indeed an absolute output type.

To use the internal reference, you have to select this in your code, and bring down the output voltage of the sensor to not exceed 1.1V (a voltage divider using two resistors usually does the job).
You will have to calibrate your sensor against the new reference as the 1.1V is stable but its actual value has a tolerance of 10%.