In addition to the optical IR output, many electricity meters also have an RS485 interface through which consumption data is made available, for example, to control a home solar power system. Depending on the region and energy provider, the data is provided either via the well-known MODBUS RTU protocol or via the so-called SML protocol (Smart Message Language). Here, I’d like to show how to use an ESP32 (Feather Huzzah32), an SSD1306 OLED, and an RS485 Wing to read, decode, and display this data.
Connecting the MeterTo connect the ESP32 to the meter via RS485, I used an RS485 Wing with an isolated interface. The meter’s RS485 ports are protected by a plastic cover. This cover is usually secured with a seal. Do not open this cover yourself. This can be dangerous, and a damaged seal can lead to significant problems with your utility provider. It’s best to ask an electrician for help. They can connect the cable to the meter’s RS485 ports and reattach the seal.
Now you can connect the meter’s ports A and B to the wing’s ports A and B.
OLED DisplayThe measured values are displayed on an OLED display. This display must be connected to the I2C interface of the microcontroller board:
The RS485 Wing has 2 DIP switches and a toggle switch, which must be configured as follows:
- S1: ON - OFF - OFF - OFF
- S2: ON
- S4: ON - ON - ON - ON
I wrote a small program that displays the current power (which is negative in my case due to the PV system) as well as the meter readings for consumed and fed-in electricity on the OLED and outputs them via the UART. I use the SML-Parser library to decode the received SNL protocols. The display is controlled using the well-known U8g2lib.
It is possible to display additional data, such as the manufacturer or grid frequency. However, this often requires unlocking this data by entering a PIN code on the meter. You can obtain the PIN code from your utility provider.
Furthermore, the OBISHandler in the program must then be expanded to include the corresponding protocol sequences.










Comments