Hi everyone.
How can I mensure the current in an especific analogic pin?
In the exemple who follow the Emon.lib (current only), the reference pin, it's "1", and when print the Irms variable, it's print's the current of the pin 1, how can i print the current, of an especif pin? For example, i have 10 current sensors, who was conect in the analog ports of my arduino (0-9), if i send "9" prnts the current of the sensor, who was conected at the por A9 in the arduino, if I send 4, prints the value os analog por 4...
I using this scketch as model:
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3 #include "EmonLib.h" // Include Emon Library EnergyMonitor emon1; // Create an instance void setup() { Serial.begin(9600); emon1.current(1, 111.1); // Current: input pin, calibration. } void loop() { double Irms = emon1.calcIrms(1480); // Calculate Irms only Serial.print(Irms*230.0); // Apparent power Serial.print(" "); Serial.println(Irms); // Irms }
Re: Multiple pins current sensor
You need to expand your sketch to set up, then scan, all 10 inputs: