Skip to content

smartMeterLogger-esp32 connects to a smart meter and logs the electricity use per minute to an sdcard. Saved data can be viewed in a html5 compatible browser. Compiles in the Arduino IDE.

License

CelliesProjects/smartMeterLogger-esp32

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
img
 
 
 
 
 
 
 
 
 
 
 
 

smartMeterLogger-esp32

Codacy Badge

About

smartMeterLogger-esp32 connects to a smart meter (slimme meter) and logs the electricity use every minute to an sdcard. Saved data can be viewed in a html5 compatible browser on your phone/laptop/desktop. You can also compare the current day to a day in the past.

Compiles in the Arduino IDE.

See also the companion app M5EnergyUse that shows the current use and totals for the day on a M5Stack v1.

Screenshots

homepage

daggrafiek

select

compare

How to setup and flash

Use the latest Arduino IDE and the latest ESP32 Arduino Core.

  1. Format an sdcard with a fat32 filesystem and insert the card in the reader.
  2. Open the sketch and change your credentials and system setup in setup.h.
  3. (Optional) In setup.h uncomment #define SH1106_OLED if you compile for sh1106 instead of ssd1306 and set the i2c pins (and address) for your oled screen.
    If you do not use a oled you can leave this setting as it is.
  4. Save all files and flash the sketch to your esp32.
  5. Connect your esp32 to the smart meter.
    Take note that to read from the smartmeter the DATA signal has to be inverted and level shifted.
  6. If you added a ssd1306/sh1106 oled screen, the ip address (or an error) will be visible on the screen.
    If there is no oled you can check the ip address on the serial port in the Arduino IDE.
  7. Browse to the ip address of your esp32 to see your current energy use.

If you have a garbled oled screen you most likely compiled for the wrong oled type.
Try to comment/uncomment //#define SH1106_OLED in setup.h to solve this.

Needed libraries

Download and install these in the Arduino libraries folder.

The driver library for a ssd1306/sh1106 oled can be installed with the Arduino library manager. Use the ThingPulse driver.

DSMR v5 P1 port standard specifications

DSMR v5.0.2 P1 Companion Standard.pdf

Needed or supported hardware

ESP32: LilyGo TTGO T7 with external antenna

SmartMeterLogger is developed on LilyGo TTGO T7 boards. The LilyGo TTGO T7 has an external antenna connector and a decent 3.3v LDO.
Without an external antenna the WiFi signal tends to be too poor to be of any use over longer distances and/or through several walls. The board will have to modified slightly to enable the external antenna.

T7 pic

Below you can see how to enable the external antenna. Move the zero ohm resistor from position 1-2 to position 3-4. Or remove the resistor and solder position 3-4 closed.

external-config

See this LilyGo issue about the external antenna.

SD card reader

card reader

Using the default pins. Use an EMPTY fat32 formatted sdcard on the first boot.

Level shifter / inverter

To invert and level shift the signal you can use a bc547 transistor with some resistors. For example like this:

invert-and-level-shift

See willem.aandewiel.nl/dsmr-logger-v4-slimme-meter-uitlezer/

Some board variants

board no oled

board sh1106

board ssd1306

About

smartMeterLogger-esp32 connects to a smart meter and logs the electricity use per minute to an sdcard. Saved data can be viewed in a html5 compatible browser. Compiles in the Arduino IDE.

Topics

Resources

License

Stars

Watchers

Forks