help birthday present

hi

I need a bit of help. I am working on a birthday present, and it needs to be done before 30th of April. it’s a circuit consisting of an esp32 dev module, ZMPT101B AC Voltage Sensor, SCT-013-030 Non-Invasive AC Current Sensor and a few resistors and capacitors. its function is to measure the output of 2 separate solar inverters, so I bought 2 current sensors 1 for each solar inverter. I got the code from this site: https://community.createlabz.com/knowledgebase/wireless-energy-monitoring-system-using-esp32-with-blynk-mobile-app/?unapproved=119&moderation-hash=23412a710a486ebdbf5196718692b717#comment-119.

I made it so far that the esp32 is giving me the information of 1 current/voltage sensor like the project on the site i mentioned. but I need 2 current sensors, and if I want to do it correctly, I also need to connect the second voltage sensor. but it’s not necessary.

my question is how do I change the code to add another virtual pin in blink with the reading of the second current sensor. and in the best case also an extra virtual pin for the second voltage sensor (not strictly necessary)

I am a coding noob, so I hope you can help me with this. all the info is in the link like schematics and such. I also added my code without Wi-Fi password of course :wink:

I have all the components so no worries about that

greetings from holland.

EnergyMonitoring.ino (1.56 KB)

I don't think Arduino support virtual pins. They are all actual, real, physical pins.

Paul

There is no way we can help if that’s April 30th 2020.

yes the Arduino works with real pins but the app blynk uses virtual pins. you assign an output to virtual pin 1 in blink for example, and then you can add a gauge in the app or another readout that will display the readout of the sensor

Paul_KD7HB:
I don't think Arduino support virtual pins. They are all actual, real, physical pins.

Paul

why not its not that complicated. But i just don’t know how to do it correctly. just talk me through

larryd:
There is no way we can help if that’s April 30th 2020.

jimvogelzang:
why not its not that complicated. But i just don’t know how to do it correctly. just talk me through

Because April was last month. It's already the end of May

Create another instance of EnergyMonitor, then define your two new inputs in setup()

EnergyMonitor emon;
EnergyMonitor emon2;


void setup() {
  Serial.begin(9600);
  emon.voltage(35, vCalibration, 1.7); // Voltage: input pin, calibration, phase_shift
  emon.current(34, currCalibration); // Current: input pin, calibration.
  emon2.voltage(37, vCalibration, 1.7); // Voltage: input pin, calibration, phase_shift
  emon2.current(36, currCalibration); // Current: input pin, calibration.
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(5000L, myTimerEvent);
}