Created
August 1, 2017 04:18
-
-
Save ItKindaWorks/a75969cd7b385c440cf86b5a0a68c86e to your computer and use it in GitHub Desktop.
A simple arduino program for measuring and calibrating AC voltage and current sensors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3 | |
#include "EmonLib.h" // Include Emon Library | |
#define VOLT_CAL 148.7 | |
#define CURRENT_CAL 62.6 | |
EnergyMonitor emon1; // Create an instance | |
void setup() | |
{ | |
Serial.begin(9600); | |
emon1.voltage(1, VOLT_CAL, 1.7); // Voltage: input pin, calibration, phase_shift | |
emon1.current(0, CURRENT_CAL); // Current: input pin, calibration. | |
} | |
void loop() | |
{ | |
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out | |
float currentDraw = emon1.Irms; //extract Irms into Variable | |
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable | |
Serial.print("Voltage: "); | |
Serial.println(supplyVoltage); | |
Serial.print("Current: "); | |
Serial.println(currentDraw); | |
Serial.print("Watts: "); | |
Serial.println(currentDraw * supplyVoltage); | |
Serial.println("\n\n"); | |
} |
Are there schematics coming?
Where is download?
Hello, I want to measure the current with the SCT-013-030 sensor and send the data to the ThingSpeak platform using python and an ESP32... does anyone know where I could find information about that, please? Thank you very much in advance
Hello, I want to measure the current with the NB-IoT Current Meter75A sensor and send the data to the ThingsBoard platform using python or another language does anyone know where I could find information about that, please? Thank you very much in advance
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are there schematics coming?