Skip to content

A LoRaWAN enabled Energy monitoring device using ESP32 and PZEM004T Energy Monitoring Module.

Notifications You must be signed in to change notification settings

WGLabz/LoRaWAN-Energy-Meter

Repository files navigation

Energy Meter with LoRaWAN

A LoRaWAN enabled Energy Meter using TTGO ESP32 board and PZEM-004T Energy Monitoring module.

Libraries Used:

  1. Arduino-LMIC
  2. U8glib Library for OLED
  3. SoftwareSerial

ESP32 Pin Diagram:-

image

Connection Diagram:-

image

The Energy Meter data is sent to TTN as raw bytes and decoded in TTN using the following piece of code in decoder in Payyload Format,

function Decoder(bytes, port) {
    var decoded = {};

    var voltage = (bytes[0] << 8) + bytes[1] +(bytes[2] / 10.0);
    var power = (bytes[3] << 8) + bytes[4];
    var energy = (bytes[5] << 16) + (bytes[6] << 8) + bytes[7];


    decoded.voltage = voltage;
    decoded.current = voltage > 0 ? power / voltage : 0;
    decoded.power = power;
    decoded.energy = energy;
    
    return decoded;
}
}

About

A LoRaWAN enabled Energy monitoring device using ESP32 and PZEM004T Energy Monitoring Module.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published