|
| 1 | +# smartMeterLogger-esp32 |
| 2 | + |
| 3 | +## About |
| 4 | + |
| 5 | +`smartMeterLogger-esp32` connects to a smart meter (slimme meter) and logs the electricity use per minute to an sdcard. |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## How to use |
| 12 | + |
| 13 | +1. Change your credentials in `wifisetup.h`. |
| 14 | +1. (Optional) In `smartMeterLogger-esp32.ino` uncomment `#define SH1106_OLED` if you compile for sh1106 instead of ssd1306 and set the i2c pins (and address) for your oled screen. |
| 15 | +3. Save all files and flash the sketch to your esp32. |
| 16 | +4. Connect your esp32 to the smart meter. [See here how](https://github.com/matthijskooijman/arduino-dsmr#connecting-the-p1-port).<br>Take note that to connect to the esp32 the `DATA` signal has to be inverted and level shifted. |
| 17 | +5. If you added a ssd1306/sh1106 oled screen, the ip address will be visible on the screen.<br>If there is no oled you can check the ip address on the serial port in the Arduino IDE. |
| 18 | +6. Browse to the ip address of your esp32 to see your current energy use. |
| 19 | + |
| 20 | +If you have a garbled screen you most likely compiled for the wrong oled type.<br>Try to comment/uncomment `#define SH1106_OLED` to solve this. |
| 21 | + |
| 22 | +## Needed libraries |
| 23 | + |
| 24 | +- [https://github.com/me-no-dev/AsyncTCP](https://github.com/me-no-dev/AsyncTCP) |
| 25 | +- [https://github.com/me-no-dev/ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) |
| 26 | +- [https://github.com/matthijskooijman/arduino-dsmr](https://github.com/matthijskooijman/arduino-dsmr) |
| 27 | + |
| 28 | +Download and install these in the Arduino libraries folder. |
| 29 | + |
| 30 | +The driver library for a ssd1306/sh1106 oled can be installed with the Arduino library manager. Use the ThingPulse driver. |
| 31 | + |
| 32 | +## DSMR v5 P1 port standard specifications |
| 33 | + |
| 34 | +[DSMR v5.0.2 P1 Companion Standard.pdf](https://github.com/matthijskooijman/arduino-dsmr/blob/master/specs/DSMR%20v5.0.2%20P1%20Companion%20Standard.pdf) |
| 35 | + |
| 36 | +## Hardware |
| 37 | + |
| 38 | +### ESP32: LilyGo TTGO T7 with external antenna |
| 39 | + |
| 40 | +My personal preference is for the LilyGo TTGO T7. The LilyGo TTGO T7 is a good board with 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. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +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. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +See [this LilyGo issue](https://github.com/LilyGO/ESP32-MINI-32-V1.3/issues/4#issuecomment-610394847) about the external antenna. |
| 49 | + |
| 50 | +### Level shifter / inverter |
| 51 | + |
| 52 | +To invert and level shift the signal you can use a bc547 transistor with some resistors. For example like this: |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +See [willem.aandewiel.nl/dsmr-logger-v4-slimme-meter-uitlezer/](https://willem.aandewiel.nl/index.php/2019/04/09/dsmr-logger-v4-slimme-meter-uitlezer/) |
| 57 | + |
| 58 | +### Some board variants |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
0 commit comments