Skip to content

Instantly share code, notes, and snippets.

@vladakru
vladakru / powerMonitorArduino.ino
Last active April 23, 2020 17:48
Sketch za Arduino - Home Energy Monitor
#include <Esp8266.h>
#include "EmonLib.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial1(3, 2); /* RX:D3, TX:D2 */
// Kalibracija Senzora
#define SAMPLE_COUNT 10
#define VOLT_CAL 258.7 //voltage calibration
#define CURRENT_CAL1 61.5 //sensor 1 calibration -- R
@vladakru
vladakru / powerMonitorNodeMCU.ino
Last active April 23, 2020 17:49
Sketch za NodeMCU ESP8266 - Home Energy Monitor - Thingsboard work!
// Code works on Thingsboard, sends telemetry data. //
// Thanks ItKindaWorks on the source code. //
#include <PubSubClient.h>
#include "ESPHelper.h"
#include <Metro.h>
#include <ESP8266WiFi.h> //ESP8266 Core WiFi Library (you most likely already have this in your sketch)
#include <DNSServer.h> //Local DNS Server used for redirecting all requests to the configuration portal
#include <ESP8266WebServer.h> //Local WebServer used to serve the configuration portal
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager WiFi Configuration Magic