Giter VIP home page Giter VIP logo

hwhardsoft / dlms-mbus-reader Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 41 KB

Arduino MBUS Reader for electricity meters with DLMS COSEM interface. Demo code for MBUS Slave feather wing and MBUS Slave MKR shield

Home Page: https://www.zihatec.de

License: GNU General Public License v3.0

C++ 84.51% C 15.49%
arduino arduino-mkr dlms dlms-cosem esp32 mbus mbus-reader mbus-slave meter rp2040

dlms-mbus-reader's Introduction

DLMS-MBUS-Reader

Arduino MBUS Reader demo for electricity meters with DLMS COSEM interface (as they are common in Austria, for example). Demo code for our MBUS slave boards for Arduino MKR boards, Raspberry Pi Pico and Feather Boards (including ESP32, RP2040, nRF52840, Cortex M0 ....).

Example Data output of an connected electricity meter

Hardware

Electricity meters with an MBUS interface include a rudimentary MBUS master. In order to be able to read the meter, an MBUS slave is required. I've used our MBUS Slave wing for feather boards and/or MBUS slave shield for Arduino MKR boards

MBUS Slave Wing MBUS Slave shield for Arduino MKR Raspberry Pi Pico HAT

MBUS Slave Raspberry Pi Pico HAT: https://www.hwhardsoft.de/english/projects/m-bus-pico-hat/

MBUS Slave Feather Wing: https://www.hwhardsoft.de/english/projects/m-bus-featherwing/

MBUS Slave Arduino MKR Shield: https://www.hwhardsoft.de/english/projects/m-bus-mkr-shield/

The code was tested with the following boards:

  • Arduino MKR Wifi 1010
  • Adafruit Feather Huzzah32
  • Adafruit Feather nRF52840
  • Adafruit Feather M0 Express
  • Sparkfun ESP32 Thing Plus
  • Sparkfun Thing Plus RP2040
  • Raspberry Pi Pico

Connection

On many electricity meters, the MBUS is provided via an RJ12 Jack. The MBUS is brought out on pins 3 and 4. The two MBUS signals must be connected to the terminal block of the MBUS-Slave wing or shield. The polarity does not have to be taken into account since the MBUS on the slave has no polarity.

RJ12 Pinout

Key

The user data in the MBUS protocol is encrypted. For decryption you need a corresponding key from your energy supplier. The 16-byte key is usually provided as a hex string. This string must be stored as a byte array in the key.h file.

For example

key from supplier: 36C66639E48A8CA4D6BC8B282A793BBB

in key.h:

static const unsigned char KEY[] = {0x36, 0xC6, 0x66, 0x39, 0xE4, 0x8A, 0x8C, 0xA4, 0xD6, 0xBC, 0x8B, 0x28, 0x2A, 0x79, 0x3B, 0xBB};

Remarks

The code was tested with Kaifa MA309M and Sagemcom T210-D (both data Lower Austria). In other countries and regions (e.g. Vorarlberg, Austria) the structure of the user data may differ and an adjustment of the program may be necessary.

Libraries

Install the following library through Arduino Library Manager

Arduino Crypto Library by Rhys Weatherley

Credits

Based on ESP32/8266 Smartmeter decoder for Kaifa MA309M code by FKW9, EIKSEU and others

License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.