tMEM - Energy monitor with Modbus interface

tMEM is a single-phase, bidirectional energy monitor with Modbus RTU interface. By connecting this device to LK4, we gain an innovative solution for online electricity monitoring and setting events to optimize energy consumption in commercial, industrial and residential spaces. Thanks to its bidirectional operation, the meter can be used in measurements with photovoltaic installations.

The device is sold with a 100A/50mA CT (current transformer) with which it is calibrated to work.

Basic features #

Technical specifications #

Power supply5-12 V DC (connector)
5 V (USB)
Rated AC input voltage230 V
AC current measurement range0 - 100 A
Power measurement deadband3 - 4 W
InterfacesModbus RTU (RS485),
Serial (over USB; 115200 baud)
Dimensions74 x 40 x 30 mm (without DIN handle)
Weight50 g

tMEM is an energy monitor intended for data collection and automation in electrical installations. It does not have MIB certificates, which are characteristic of energy meters. Therefore, it cannot be used for energy billing.

Default setup #

Out of the box, the tMEM is pre-configured with:

These defaults suit most standard installations. However, if you need to adjust the Modbus address, this can be done quickly using the built-in button and status LED located next to the USB port.

Quick Modbus address configuration #

To read the current address:

  1. Click the button once.
  2. The LED will blink to indicate the address.
    (For example, 2 blinks = address 2.)

To set a new address:

  1. Press and hold the button.
  2. After 2 seconds, the LED will blink once.
  3. Continue holding — the LED will blink once per second up to 5 times.
  4. Release the button after the number of blinks that corresponds to your desired address.
    (For example, for address 3, release after the third blink.)

⚠️ If you hold the button for more than 7 seconds, the process is canceled and no changes are made.

For additional configuration options, see the Advanced configuration section.

Integration with LK #

The tMEM integrates seamlessly with LK4 and LK3.5+ devices. It can be powered directly from the LK controller using its 5V and GND outputs. Then, connect it—either alone or together with other Modbus devices—to the LK’s Modbus A+ and B− terminals to establish communication.

Once connected, configure a custom Modbus module on the LK using the ready-to-use configuration preset available in the Downloads section. You can easily modify this preset to read only the parameters you need, such as voltage, current, power or energy values.

Firmware update #

To update the firmware, the tMEM must be placed into bootloader mode. In this mode, the device appears as a mass storage device named RPI-RP2 when connected to a PC. Simply copy the new firmware file to that storage. After the upload, the device will automatically restart and resume normal operation with the new firmware.

Enabling bootloader mode #

You can enable bootloader mode in one of two ways:

💡 Firmware files are available in the Downloads section.

Advanced configuration #

To modify the settings, you will need to connect the tMEM to a computer via USB. The device can be powered through USB, so no additional power connections are necessary.

Required software #

To establish a connection with the pulse counter, you'll need an application that can handle serial communication. Popular choices include:

Example configuration process #

  1. List Available Ports:
    Run pyserial-ports to list the available COM ports before connecting the device. The output might look like:

    COM1
    COM3
    COM15
    COM16
    COM17
    

  2. Connect the Device
    Plug in the tMEM and run the command again. The new COM port (e.g., COM11) will represent the connected device.

  3. Connect to tMEM
    Use the following connection parameters:

    • Baud rate: 115200
    • Byte size: 8 bits
    • Parity: None
    • Stop bits: 1

    Example command:

    pyserial-miniterm COM11 115200

  4. Send Commands
    Once connected, you can issue commands to the device. Each command must be followed by the Enter key. A useful command is ? or help, which provides a list of all available commands (described below).

Command list #

Command Description
address? | a? Get the Modbus address (Slave ID).
address=X | a=X Set the Modbus address. Parameters: X - address to set, number <1, 255>.
ratio_X? Get conversion ratio for sensor. Parameters: X - string 'Voltage', 'Current' or 'Power'.
ratio_X=Y Set conversion ratio for sensor. Parameters: X - string 'Voltage', 'Current' or 'Power', Y - float.
read_sensor Read the sensors readings.
reset_energy Reset energy status.
set_energy=X,Y Set energy status. Parameters: X - value of positive energy (float), Y - value of reverse energy (float).
save_config | sc Save configuration to Flash memory. It should be called after changing the Modbus address and conversion ratios.
read_registers | rr Read Modbus register values.
read_definitions | rd Read Modbus register definitions (name, address, type).
auto_save? | as? Get the value of the auto-save function. This is the interval in seconds at which the counters are saved.
auto_save=X | as=X Set the value of the auto-save function. Parameters: X - value in seconds, number <0, 65_535>, for 0 the function is disabled.
read_status | rs Read the saved status.
write_status | ws Write the status to Flash memory.
bootloader Reboot the device into bootloader mode to update the firmware. When connected to a computer, it will appear as a storage device named RPI-RP2, to which you should copy the firmware file with the extension uf2. Then the device will reboot into normal operation mode.
restart Restart the device.
verbose=X | v=X Turn on or off verbose mode, which displays more messages.
help | ? Display this help message with a list of available commands.

Common use cases #

Some commands are useful only in special cases, which I present below.

Modbus registers #

Below is the list of Modbus registers available in the device.
The content corresponds to the output of the read_definitions command and includes register names, addresses, types, and divisors.

| Name                           | Addr | Type   | Func         | Divisor |
| ------------------------------ | ---- | ------ | ------------ | ------- |
| uptime                         | 3000 | uint32 | 0x04 (IREG)  |         |
| Voltage                        | 3002 | int32  | 0x04 (IREG)  |      10 |
| Current                        | 3004 | int32  | 0x04 (IREG)  |    1000 |
| Power                          | 3006 | int32  | 0x04 (IREG)  |      10 |
| Frequency                      | 3008 | int32  | 0x04 (IREG)  |    1000 |
| PositiveEnergy                 | 3010 | int32  | 0x04 (IREG)  |    1000 |
| ReverseEnergy                  | 3012 | int32  | 0x04 (IREG)  |    1000 |
| V_RMS                          | 3014 | int32  | 0x04 (IREG)  |       1 |
| I_RMS                          | 3016 | int32  | 0x04 (IREG)  |       1 |
| I_FAST_RMS                     | 3018 | int32  | 0x04 (IREG)  |       1 |
| WATT                           | 3020 | int32  | 0x04 (IREG)  |       1 |
| CF_CNT                         | 3022 | int32  | 0x04 (IREG)  |       1 |
| FREQ                           | 3024 | int32  | 0x04 (IREG)  |       1 |
| version_major                  | 3100 | uint16 | 0x04 (IREG)  |         |
| version_minor                  | 3101 | uint16 | 0x04 (IREG)  |         |
| version_patch                  | 3102 | uint16 | 0x04 (IREG)  |         |
| address                        | 4000 | uint16 | 0x03 (HREG)  |         |
| auto_save                      | 4006 | uint16 | 0x03 (HREG)  |         |