i’m modifying a code from a youtube video i’ve seen recently but i’m not sure on what to do to the code to add another another two voltage sensor.Smart Energy Monitor is the project but i want to add the two voltage sensor for a lighting circuit breaker and socket circuit breaker so there will be main voltage,lighting voltage and socket voltage.Another feature i want to add is notify at blynk when there is no presence of electricity on one of the voltage sensors.Here is the code:
You will need to set up at least 3 instances of EnergyMonitor like this
but each of course has a different name (main, lighting, socket?).
Then you need to use main.voltage(unsigned int _inPinV, double _VCAL, double _PHASECAL); to define the pin for this voltage, so you need to repeat these lines for each supply:
and likewise to extract the values Vrms, realPower, etc. Blynk.virtualWrite(V0, emon.Vrms); etc
I don’t know anything about blynk so I can’t help you with this aspect. You will need to add a test in your sketch bool lowVoltage = lighting.Vrms < 50 ? true : false;
and somehow use lowVoltage in Blynk.
Hi Robert,
I try to create a powermeter (EMONCMS) based on the same code, without blynk. I’m using a zmpt101b, sct-013 and an esp32 with 5v powerd. Input voltage is 230v.
I have problems to calibrate. How to define the calibrate
Values for v oltage and current measurement?
Thanks for Your help.
Uwe
For the emonTx & emonPi, the calibration constant is the voltage or current that would give 1 V at the ADC input. I don’t have an ESP32, so I cannot prove that it is the same, but I think it will be.
This looks as if you’re going in the right direction, but as I wrote above, I know nothing about Blynk. Somewhere, the class method calcVI needs to be called for each instance of EnergyMonitor so that the readings can be refreshed.