/* METADATA */ {{indexmenu_n>5}} /* METADATA END */ {{page>.:05-mbus-link-internal-hidden}} ====== M-Bus ====== {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:08_safety-instructions_pseudo-ISO-7010-info.png?nolink |(i)}} **Note:** \\ This article refers only to Unipi Edge models equipped with M-Bus. M-Bus (Meter-Bus) is a standardized communication bus and protocol used primarily in energy and utility metering systems to collect data from electricity meters, water meters, or gas meters. It operates in a master–slave topology, where a central device (master) sequentially communicates with individual meters to retrieve readings, status information, or diagnostic data. Advantages include the ability to power some meters directly from the bus, high resistance to interference, long communication distances, and the ease of connecting multiple devices to a single line. Disadvantages include lower data transfer speeds compared to modern systems. Its use is limited mainly to metering and building automation. In practice, M-Bus is used primarily in apartment buildings, industrial facilities, or energy management systems for automatic remote meter reading. Its concept and use are similar to, for example, the RS-485 bus with the Modbus protocol, but it is optimized specifically for metering technology and low-power devices. //Bus load is expressed in unit loads (UL); 1 UL corresponds to 1.5 mA.// ===== Port mapping ===== The available M-Bus ports and their device paths in Linux are listed in the table below. |< 100% 45% 45% >| ^ Variant ^ M1 ^ | M2 - 1x M-Bus 120 UL | /run/unipi-plc/by-sys/mbus.1/tty | | M5 - 1x M-Bus 10 UL | /run/unipi-plc/by-sys/mbus.1/tty | | M6 - 1x M-Bus 60 UL | /run/unipi-plc/by-sys/mbus.1/tty | ===== M-Bus descriptions ===== M-Bus is marked on the case as follows: |< 100% 30% 35% 35% >| ^ Port ^ Terminal markings ^ LED markings ^ | M1 | M1-, M1+, SH | M1 \\ M-Bus | * **Mx+** Positive lead and power supply * **Mx-** Negative lead and ground * **SH** Shielding ===== Differences from standard models ===== M-Bus communication extension can be combined with any model and variation of Unipi Edge. It is identified in the Part number (PN) by the suffix **"-Mx"**, where x is a number. This M-Bus extension changes the minimum power supply voltage from 10.2 V (standalone Unipi Edge variant) to 20 V (Unipi Edge with M-Bus extension). Unipi Edge with M-Bus can be powered from approximately 12 V, but not all parameters are guaranteed across the full temperature range. M-Bus is fitted to Unipi Edge units with the following suffixes in PN: * **-M2** 1 channel max. 120 UL, max. continuous DC current 185 mA (up to 55 °C ambient, see Technical parameters) * **-M5** 1 channel max. 10 UL, max. continuous DC current 25 mA * **-M6** 1 channel max. 60 UL, max. continuous DC current 95 mA ===== General information about installation ===== M-Bus has specific installation requirements and improper installation can cause the bus to not function properly or even shorten the device's service life. Please take a moment to read the information in this chapter. It will simplify the installation, clarify any potential issues, and explain the conditions for which certain system components are designed and how to achieve better results. ==== Topology ==== The controller supplies the bus with 35 V, but the standard specifies a minimum voltage of 24 V for a meter. The 11 V difference acts as a buffer to compensate for any losses caused by current flowing through all the meters. While the standard limits the maximum loop resistance to 60 Ohm, the voltage buffer poses a more significant limitation. ----- Typical copper cables used for M-Bus (JYSTY) have a resistance that depends on the conductor cross-section: |< 100% 19% 27% 27% 27% >| ^ Conductor cross-section (EU) ^ AWG (US) ^ Conductor resistance ^ Cable ^ ^ 0.28 mm2 | AWG23 | 61 Ohm/km | JYSTY 1x2x0.6 / TCEPKPFLE 1x4x0.6 | ^ 0.5 mm2 | AWG20 | 39 Ohm/km | JYSTY 1x2x0.8 / SYKFY 1x2x0.5 | ^ 1.0 mm2 | AWG17 | 20 Ohm/km | JYTY 2x1.0 | ^ 1.5 mm2 | AWG16 | 14 Ohm/km | CYKY 2x1.5 | This internal resistance is the limiting factor that determines the maximum distance from the source to the device. The formula for the maximum distance of a single M-Bus branch is as follows: Ud [V] - 2 * Nu [UL] * Nu [UL] * Rt [Ohm/terminal] * 0.0015 [A] L [km] = 2 * ---------------------------------------------------------------- 2 * Nu [UL] * Rv [Ohm/km] * 0.0015 [A] Where **L** is the distance in kilometers, number of desired meters present on the bus **Nu** in Unit Load, **Rt** is resistance of contacts in Ohm per terminal, **Rv** is resistance of single wire in Ohm per kilometer and **Ud** is voltage loss on the line in Volts (11 V in this case). ---- Illustrative example (the values may not be accurate): 120 Unit Loads can be distributed across a single 700-meter branch with conductor cross-section 0.5 mm2. However, the same load can be distributed across two branches with the source in the middle and each up to 760 m long with the same wire (for total length of 1,500 meters). {{ files:products:edge:mbus:05-mbus_01-mbus-splitting-the-bus.png |Bus topology, master in the center (2 branches) can have 2x total length}} ==== Dealing with interference ==== To minimize interference, it is recommended to use shielded cable for the bus (e.g. JYSTY 1x2x0.6, 0.28 mm2). An unconnected cable shield can couple interference into the bus capacitively. For shielding to have a positive effect, the cable shield must be connected to the building’s ground potential **at a single point**. For this purpose the connector has a third terminal labeled as SH. {{ :files:img_warning-line_o.png?nolink |}} {{ :en:hw:02_safety-instructions_ISO-7010-W012.png?nolink |/↯\}} **Warning:** \\ Risk of electric shock. \\ Make sure that the unit is correctly connected to the PE before connecting the connector with the shielded cable. Otherwise, if PE is not connected and a wiring fault occurs, it is possible to introduce external voltage (even mains!) to the metal enclosure of the unit! Very high levels of interference can be suppressed by connecting a [[https://mou.sr/4uFYrci|ferrite bead]]([[https://cz.mouser.com/en/ProductDetail/Laird/28A0392-0A2?qs=sGAEpiMZZMt1hubY80%2Fs8B30Hz68xqex%2F6OiKJQFues%3D|alt. link]]) to the bus near the master. Depending on the interference, the bead may be fitted around the conductors only, or around the whole cable including the shield. It may also be necessary to try different types of beads. ==== Overvoltage protection ==== M-Bus is isolated from other parts of the device with isolation rated for 1.5 kV DC, and is tested against 2 kV bursts of pulses and 2 kV of voltage surge between bus and PE. This corresponds with protection inside buildings in "safe" parts of a distribution box. If the M-Bus leaves the building's protected lightning protection zone (LPZ), then surge protection at the entry point should be used. This will lower the level of voltage surges to an acceptable limit. The installation will work even without this protection, but this will shorten the lifespan of the product. Typical use cases for using surge protection (Unipi Edge inside building) may include readings of: * Electricity meter inside distribution box on the property boundary * Electricity meter next to converter of solar plant * Meters in other buildings or across the street * Water meter inside water meter shaft near lightning rod * Electricity meter inside single building from different power sources (backup line, diesel generator, ...) Suitable surge protectors include those rated for 36 V systems, such as the following: * [[https://www.prevodniky.sk/product-list-surge-protectors-en.html|Surge protection M-Bus]] {{ :files:img_warning-line_o.png?nolink |}} {{ :en:hw:02_safety-instructions_ISO-7010-W012.png?nolink |/↯\}} **Warning:** \\ Ensure that the PE terminal is connected to the local ground potential. This is especially important when the installation includes no surge protection. In case of failure on the M-Bus or lightning strike in close proximity, the metal enclosure can become a live part and pose a risk to operators. {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:09_safety-instructions_pseudo-ISO-7010-attention.png?nolink |(!)}} **Attention:** \\ The output is not protected against an external voltage source on the M-Bus terminal. External voltage higher than 45 V on terminals Mx+ and Mx- will damage the internal circuits. ==== Current protection ==== The integrated short-circuit protection limits the current between the bus terminals to a maximum of 3 A for the whole duration of a short circuit. This limit is guaranteed for at least 50 ms. Overcurrent protection of the output will not allow the bus to be supplied indefinitely with a current greater than 5 UL (7 mA) over the limit specified in the product datasheet. ----- A short-circuit and overcurrent are indicated by ERR LED. At the same time, the output is disconnected and a restart is attempted after 3 seconds. It is appropriate for the application to detect this state and to shut down the power supply of the bus with the commands below after several unsuccessful attempts. {{ :files:img_warning-line_b.png?nolink |}} {{ :en:hw:09_safety-instructions_pseudo-ISO-7010-attention.png?nolink |(!)}} **Attention:** \\ Repeated automatic restarts into a short circuit at high ambient temperatures can physically damage the unit. === Error LED === The error state (ERR LED state) can be found in the file: cat /run/unipi-plc/by-sys/mbus.1/led.err/brightness ERR LED behaviour description |< 100% 30% >| ^ Bus state ^ ERR LED state ^ | Power off | Off | | Correct communication | Off | | Short-circuit | Very short blink, long gaps | | Overloaded (e.g. exceeded maximum load) | Long blink, long gaps, ratio depends on overload | | Unspecified problem with M-Bus | On | Visualization of these states can be found in [[#led_indication|LED indication]]. === Bus power supply === The power supply of the bus can be controlled with: * Power off the M-Bus line echo disabled | sudo tee /sys/devices/platform/unipi-mbus/state * Power on the M-Bus line echo enabled | sudo tee /sys/devices/platform/unipi-mbus/state /* Be aware that for multichannel M-Bus variants the power supply is shared for all channels. After disabling the power supply all channels will be turned off! */ === Behavior during overcurrent === Each Unipi Edge has a tolerance band of approximately 10%, above which the overcurrent protection is tripped. This is due to manufacturing tolerances, and to guarantee function in all specified operating conditions (e.g. temperature, short-circuit protection,...). If the connected load exceeds the datasheet limit, the bus may still work. However, a replacement unit may not work under the same conditions, because of manufacturing tolerances. **If the bus is overloaded this way, it does not meet the requirements for correct function, and any support requests and/or complaints /*regarding 'it worked before'*/ will not be taken into account.** ---- Some devices without batteries can consume more UL than standards define. It can be difficult to determine the current on the bus. The active current can be measured by inserting a 6.8 Ohm resistor Rs in series with the bus. The resistor should have a power rating of 2 W. Then measure DC voltage loss Ur across the resistor. The active load is defined by the following formula: Ur [V] Ibus [UL] = -------------------------- = Ur [V] * 98 [UL/V] Rs [Ohm] * 0.0015 [A/UL] At a given value of resistance, the load is approximately 1 UL for every 10 mV measured. Parts of the bus may stop communicating while the resistor is inserted. This is expected: the measurement is needed only once, when diagnosing, and the resistor is then removed. {{ files:products:edge:mbus:05-mbus_02-mbus-measure-overcurrent.png |Diagram with resistor in series with the bus at the start (near M+), measuring voltage drop across the resistor}} Example: Measured voltage 600 mV corresponds to current of approximately 60 UL on the bus. ==== First meter failure ==== The standard allows bus operation even with one damaged meter; This is known as the **first failure** state. For this property to take effect, the installation of the bus must be designed to have a reserved buffer of at least 67 UL (100 mA) for the damaged meter. This mechanism is currently possible only for M2 (120 UL) variants. ===== Technical parameters ===== {{page>en:hw:technical-parameters-edge-mbus-hidden}} ===== Standards ===== Unipi Edge with M-Bus complies with following standards: * EN IEC 60730-1 * EN IEC 61000-6-2 * EN IEC 61000-6-3 * EN 13757-2 ===== LED indication ===== ==== M-Bus power supply turned off or no communication ==== If M-Bus power supply is turned off or no communication is currently active on the M-Bus, all M-Bus LEDs will be turned off: ;#; //M-Bus turned off// ;#; {{ files:products:edge:edge_m-bus_off.gif?500 |M-Bus TX, RX, ERR off}} ==== Correct communication ==== If at least one meter is connected and a program on the unit is reading it, the LEDs may look as follows: ;#; //Correct M-Bus behavior// ;#; {{ files:products:edge:edge_m-bus_normal_run.gif?500 |M-Bus TX, RX blinking, ERR off}} ==== Short-circuit or overload ==== ERR LED blinking or turned on indicates that M-Bus is in error state. Some examples are shown below. //Animations are for illustration purposes only. The on/off ratio depends on the error type and severity.// ;#; //M-Bus overloaded// ;#; {{ files:products:edge:edge_m-bus_overload.gif?500 |M-Bus TX, RX off, ERR blinking}} ---- ;#; //M-Bus short-circuit// ;#; {{ files:products:edge:edge_m-bus_error_short-circuit.gif?500 |M-Bus TX, RX off, ERR blinking shortly}} ---- ;#; //Unspecified problem with M-Bus// ;#; {{ files:products:edge:edge_m-bus_err_on.gif?500 |M-Bus TX, RX off, ERR on}}