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.
Power supply | 5-12 V DC (connector) 5 V (USB) |
---|---|
Rated AC input voltage | 230 V |
AC current measurement range | 0 - 100 A |
Power measurement deadband | 3 - 4 W |
Interfaces | Modbus RTU (RS485), Serial (over USB; 115200 baud) |
Dimensions | 74 x 40 x 30 mm (without DIN handle) |
Weight | 50 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.
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.
To read the current address:
To set a new address:
⚠️ 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.
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.
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.
You can enable bootloader mode in one of two ways:
bootloader
.💡 Firmware files are available in the Downloads section.
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.
To establish a connection with the pulse counter, you'll need an application that can handle serial communication. Popular choices include:
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
Connect the Device
Plug in the tMEM and run the command again. The new COM port (e.g., COM11) will represent the connected device.
Connect to tMEM
Use the following connection parameters:
Example command:
pyserial-miniterm COM11 115200
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 | 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. |
Some commands are useful only in special cases, which I present below.
address=X
command to change it to a unique one.auto_save=X
should be used, resulting in their state being periodically saved to permanent memory. Be mindful of flash memory wear, as it has a limited number of writes (rated for 100k). Therefore, when using this feature you need to choose a value that is an acceptable compromise. The default value of 600 (seconds) should allow for about 2 years of operation.set_energy=123.123,0.345
will set positive energy status to 123.123 kWh and reverse energy to 0.345 kWh.
address=X
, ratio_X=Y
, auto_save=X
, you must use save_config
to save changes to permanent memory. Otherwise, they will be lost upon power loss or device restart.
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) | |