Press "Enter" to skip to content

M-Bus Master Hat Mods

Overview

Out of the box an M-Bus Master Hat:

  • Expects to be powered via the connected Raspberry Pi (using both 3.3V and 5V sources).
  • Provides an EEPROM at I2C address 0x50 to allow the Hat to be detected by the Raspberry Pi.
  • Allows the M-Bus Power to be configured via GPIO 26 (this is Broadcom GPIO 26, not wiringPi GPIO 26).

All of these capabilities can be modified on the latest models (v1.2 onwards). This document provides instructions to make these mods – although bear in mind that any mods are done at your own risk, and these additional capabilities aren’t warrantied.

If you’re not confident modifying a Hat yourself and would like us to supply a Hat with any of these capabilities, or supply the components, contact us.

Backpowering a Pi

A micro USB port can be added to the M-Bus Master Hat, along with circuitry to allow the Hat itself to be directly powered by USB, and to back-power the Raspberry Pi.

The components you will need to make this mod are:

  • USB Micro female surface mount socket
  • 10K 0603 resistor
  • 47K 0603 resistor
  • DMG2305UX MOSFET (SOT-23 footprint)
  • DMMT5401 dual PNP transistor (SOT-26 footprint)

The USB socket should be soldered onto the pads on the top side of the board, on the left-hand side, next to the text “M-Bus Master Pi Hat …”.

The other components should be soldered within the outlined section marked “USB”. The component locations are:

  • R20 10K
  • R21 47K
  • Q6 DMMT5401
  • (Q7 v1.2/Q5 – v1.3+) DMG2305UX

Q6 pin 1 is marked on the board with a longer line above it.

Disable/Enable Hat EEPROM

The Hat EEPROM is enabled using the pads marked “HAT” in the row marked “GPIO” on the top of the board. Usually, these 2 pins are jumpered to enable the EEPROM to allow the Pi to identify the Hat. It might be desirable to disable the Hat EEPROM if you’re running the M-Bus Master Hat with another Hat connected to the Pi at the same time – in which case they may both have EEPROMs at address 0x50, so will clash.

To disable the EEPROM, the pads can be unjumpered. A 1×2 2.54mm pitch pin header can be added to the board to enable these pads to be jumpered/unjumpered more easily.

GPIO controlling M-Bus Power

The GPIO used to control M-Bus Power is selected using the remaining pads on the row marked “GPIO” on the top of the board. One of the pins marked with a number (which corresponds to the Broadcom GPIO on the Raspberry Pi) must be connected to a pad marked “EN”. By default GPIO 26 is connected to EN.

The GPIO26 jumper can be replaced with another GPIO jumpered to EN. A 1×12 2.5mm pitch pin header can be added to the board to enable the GPIO to be changed more easily. Alternatively a 1×14 2.54mm pitch pin header can be added to the board to provide easy access to both the M-Bus GPIOs and EEPROM pads.

Running multiple M-Bus Master Hats

It is not currently possible to use multiple M-Bus Master Hats connected to the Pi at any one time. This may be possible with a future hardware revision.

Schematic

A full schematic of the M-Bus Master Hat is available. Note that this is for boards v1.4+. Previous boards used a very similar schematic (although components may have been renumbered).