Voltage reading is -1, sample imbalance

Hi Bob.

Iotawatt is such a great project! I made the board based on the .sch circuit from github, using the small size wemos D1 module.

The VT uses a 10V AC transformer, and the Fluke multimeter measures a voltage of 10.34Vrms.

Then follow the docs/VTconfig.html to configure, but in the calibration interface, the voltage shows as -1.

I looked up the source of -1 in the source code, after uncommenting the code below, the debug info shows that the sampling is imblance.

What causes such a failure, and how to debug and troubleshoot it?

Thanks and kind regards.

Probably the bias voltage is not half of the reference voltage.

Thanks for pointing out.

Sure enough, at the input end of the op amp, power supply voltage is 3.314V, and two 4.99K (0.1%) resistors are used to divide the voltage. The midpoint voltage is 1.657V, but the output reference voltage of the op amp is 1.771V, a difference of 0.114V.
I’ll try replacing a new LM358.

Thank you very much!

The problem is solved, after replacing the LM358, it can work normally.
With minimal hardware, such a powerful feature is achieved. It’s amazing.

The Vref of MCP3208 shares the power supply voltage. If the ADC uses an independent 3.0V reference voltage and the bias voltage is 1.5V, can it work?

Thanks.

Yes, that would work. The ESP32 prototype does that. You might just as well consider using a 1.5V Vref and 10 Ohm burden resistors. Many CTs work better with lower burden values and some require 10Ohm to achieve their specifications.

Thanks for the guidance.
This may improve the sampling stability, I am going to try it with a Vref of 2.048V.
If the Vref of the MCP3208 uses a precision voltage source, can the 2.5V reference input (CH0 of U1, in sch v5.0) voltage reference be removed? One more sampling channel can be added for current detection.

However, I am more looking forward to the release of the ESP32 version.

I think so. But understand that the Vref uses a very high precision component. Just using a 1% LDO won’t do it. Another consideration these days is that any VRef value can be used, as long as you configure it. High precision parts are getting hard to find in any quantities, so depending on a particular reference value could become a problem.

Problem is there is no room in the datalog to record it. Be very careful with modifying the datalog. Changing the record size can have major impact on speed and reliability.

If the configuration can be customized, it will further enhance the flexibility and facilitate our DIY. Great like :+1:

It is recommended that if the Vref of the ADC is customized, the voltage is calculated directly through the ADC value and Vref. The reference voltage input for U1 ch0 is no longer necessary.

Thanks.

If you change the ADC reference value, the IoTaWatt will recognize the new value. The value of the voltage reference shunt can be set in the config with the “refvolts” parameter.

Thanks for the thoughtful reply.
A few tries are going to be done next, new boards are being designed.