define(`TITLE', `M-Bus Master, Part 2 (Electricity)')
define(`DATE', `2013-09-09')
define(`CONTENT', `
Finally, this MeterBus transceiver is connected to an Arduino Ethernet board and talks to an M-Bus equipped electric powermeter
The power meter was configured to M-Bux address 0x21, and so the initialize command, sent through the Arduino and the transceiver has been answered correctly:
so 10 40 21 61 16
success
SO RESP: E5
so
is the command for the firmware to send the following octets on the bus, success
is the acknowledgement, that this has been done and SO RESP:
is the prefix for the octets received from the bus.
According the the manufacturers documentation the M-Bus command REQ_UD2
(see here in the M-Bus documentation should be used to request all the measurement data from the powermeter, and it works:
Here without any consumer load:
so 10 5b 21 7c 16
success
SO RESP: 68 38 38 68 08 21 72 99 51 00 13 2E 19 21 02 01 00 00 00 8C
10 04 06 00 00 00 8C 11 04 00 00 00 00 02 FD C9 FF 01 E3 00 02 FD DB
FF 01 00 00 02 AC FF 01 00 00 82 40 AC FF 01 00 00 EB 16
Here with an electric kettle as consumer load:
so 10 5b 21 7c 16
success
SO RESP: 68 38 38 68 08 21 72 99 51 00 13 2E 19 21 02 02 00 00 00 8C
10 04 06 00 00 00 8C 11 04 00 00 00 00 02 FD C9 FF 01 DE 00 02 FD DB
FF 01 56 00 02 AC FF 01 CD 00 82 40 AC FF 01 00 00 0A 16
In the above answer of the powermeter the important measurement values are highlighted:
[table]
Data,measurement category,multiplicator and unit,
06 00 00 00
,total consumption,0.01kWh,0.06kWh
DE 00
,voltage,1V,222V
56 00
,current,0.1A,8.6A
CD 00
,power,0.01kW,2.05kW
[/table]
Here is the firmware for the Arduino.
This is a closer look into the response data structure:
(Manufacturer IDs can be found here.)
[table]
Octet(s), Field, Meaning
68 38 38 68
, Preamble with lentgh,
08
, C Field,
21
, A Field,
72
, CI Field, variable data response
99 51 00 13
, Ident. No.,
2E 19
, Manufacturer, FIN = Finder GmbH
21
, Version,
02
, Medium, Electricity
02
, Access No,
00
, Status,
00 00
, Signature,
8C
, DIF, ext; instantaneuos value; 8 digit BCD
10
, DIFE, tariff 1; storage 0
04
, VIF, Energy; 10^(4-3)Wh
06 00 00 00
, Value, 0.06kWh
8C
, DIF, ext; instantaneuos value; 8 digit BCD
11
, DIFE, tariff 1; storage 1
04
, VIF, Energy; 10^(4-3)Wh
00 00 00 00
, Value, 0
02
, DIF, 16bit integer
FD
, VIF, ext; true VIF is next; see table for secondary VIF
C9
, VIFE, ext; Voltage; 10^(9-9)V
FF
, VIFE, manufacturer specific next VIFE
01
, VIFE,
DE 00
, Value, 222V
02
, DIF, 16bit integer
FD
, VIF, ext; true VIF is next; see table for secondary VIF
DB
, VIFE, ext; Current; 10^(11-12)A
FF
, VIFE, manufacturer specific next VIFE
01
, VIFE,
56 00
, Value, 8.6A
02
, DIF, 16bit integer
AC
, VIF, ext; Power; 10^(4-3)W
FF
, VIFE, manufacturer specific next VIFE
01
, VIFE,
CD 00
, Value, 2.05kW
82
, DIF, ext; 16bit integer
40
, DIFE, tariff 0; storage 4
AC
, VIF, ext; Power; 10^(4-3)W
FF
, VIFE, manufacturer specific next VIFE
01
, VIFE,
00 00
, Value, 0
0A
, Checksum,
16
, Stopbyte,
[/table]
')