From 12ecc34890539de9d263288ca72e2a2e901b7fe0 Mon Sep 17 00:00:00 2001 From: simonox Date: Sat, 18 Feb 2023 17:20:13 +0100 Subject: [PATCH] gitignore --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 4 +++ .../energy-monitor/energy-monitor.ino | 26 ++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 software/firmware/energy-montior/energy-monitor/energy-monitor.ino diff --git a/.DS_Store b/.DS_Store index bc5780a2398c0181511ff93eb5938a79288247b6..c8755608a5d25f73c5e8799cc39be1b4c5042d4e 100644 GIT binary patch delta 209 zcmZoMXfc=|#>B!ku~2NHo+2aL#DLw41(=u_*(UQaz82(Q$Y4lhC}K!qCB`mu~2NHo+2aD#DLwC4MbQb^Rv9zEW#nova#VW<7Rdaeh#3T&4L`? ZnJ4p$SPC!z0V4wg6O?Az93irX836KA5Uv0K diff --git a/.gitignore b/.gitignore index 3fae665..1a4f782 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,8 @@ dist docs/_* site +# macOS +.DS_Store + +# Misc TODOS.md diff --git a/software/firmware/energy-montior/energy-monitor/energy-monitor.ino b/software/firmware/energy-montior/energy-monitor/energy-monitor.ino new file mode 100644 index 0000000..a6906aa --- /dev/null +++ b/software/firmware/energy-montior/energy-monitor/energy-monitor.ino @@ -0,0 +1,26 @@ +/* +SCT-013 Sensor - Power meassurement, based on Thomas Edlinger's code for "www.edistechlab.com" +Required libraries (Tools -> manage libraries) + - EmonLib libary V1.1.0 by OpenEnergyMonitor +Based on EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3 +*/ + +#include "EmonLib.h" +EnergyMonitor emon1; +const byte current1Pin = A0; // ADC-PIN +const byte voltage = 230; // Power voltage in Europe = 230 V + +void setup() { + Serial.begin(115200); + analogReadResolution(ADC_BITS); // activate 12 Bit resolution for our ESP32 + emon1.current(current1Pin, 4); // Pin and Calibration +} + +void loop() { + double Irms = emon1.calcIrms(1480); + Serial.print(Irms*voltage); + Serial.print(" Watt - "); + Serial.print(Irms); + Serial.println(" Ampere"); + delay(1000); +} \ No newline at end of file