Skip to main content

Connect Eastron SDM230 to Ubidots over Modbus RTU

Read voltage, current, power and kWh from an Eastron SDM230 over Modbus RTU with Node-RED and send them to Ubidots. Includes the full register map.

Written by Sergio M
Eastron SDM230 single-phase DIN-rail energy meter

The Eastron SDM230 is a single-phase, DIN-rail energy meter that publishes voltage, current, active power, power factor and cumulative kWh over RS-485 using Modbus RTU. This guide gives you the full input-register map, the IEEE-754 conversion the meter's values require, and a Node-RED flow that forwards the readings to Ubidots over HTTP.

The register addresses below were verified against Eastron's SDM230 Modbus protocol document. Eastron has changed register maps between hardware revisions, so confirm your variant — SDM230-Modbus, SDM230M, V2 or V3 — against the current document before you rely on an address in production.

Requirements

  • An active Ubidots account.

  • An Eastron SDM230 with the RS-485 (Modbus) output.

  • A Modbus RTU master with Node-RED and the node-red-contrib-modbus nodes installed, plus a USB or onboard RS-485 interface.

1. Wire the meter and the RS-485 bus

Connect the SDM230 to your power network according to your requirements. Below is a brief connection schematic; for detailed instructions refer to the datasheet.

Eastron SDM230 wiring diagram showing line and neutral terminals

Once the power lines are connected, connect the SDM230 to the Modbus master via the RS-485 interface. Terminate the bus with 120 Ω at both physical ends only, and run the pair in a separate conduit from the power conductors. If the meter does not answer, swap A and B — the labelling is not standardised between vendors.

SDM230 RS-485 A and B terminals used for the Modbus RTU bus

Which baud rate, parity and slave ID does the SDM230 use?

From the factory the SDM230 communicates at 9600 baud, no parity, one stop bit, with slave ID 1. All four are changeable from the meter's front panel or by writing the holding registers below, and the master has to match all four exactly. Set them on a desk before the meter goes into the panel — it is far harder once it is behind a cover.

Setting

Default

Holding register

Baud rate

9600

40029 (0x001C)

Parity

None

40019 (0x0012)

Stop bits

1

40019 (0x0012)

Slave ID

1

40021 (0x0014)

2. Configure the Modbus master in Node-RED

Make sure your Node-RED installation features the "Modbus Read" node. If not, head to the node-red-contrib-modbus page for installation instructions.

Navigate to the Node-RED interface on your Modbus master device and search for "Modbus" in the node palette.

Node-RED node palette filtered to the Modbus nodes

Add a "Modbus Read" node to your flow. Once placed, double click on it and then click the "Add new modbus-client..." button. This will display the Serial configuration for the Modbus master:

Node-RED modbus-client serial configuration dialog

Configure the serial parameters to match the meter. In this guide the following settings were used:

  • Baud rate: 9600.

  • Unit ID / slave ID of the meter: 1.

  • Parity: none, 1 stop bit.

Serial parameters set to 9600 baud with slave ID 1

After saving, you return to the "Modbus Read" node configuration. Set FC to FC 4: Read Input Registers, Address to 0 and Quantity to 2 to read "Line to neutral volts".

Modbus Read node configured for SDM230 input register 0, line to neutral volts

SDM230 Modbus register map (input registers)

All SDM230 measurements live in input registers, read with function code 04. Three rules matter:

  • The Modbus address is the register number minus 30001. Total active energy is register 30343, so the address is 342 (0x0156).

  • Every value is a 32-bit IEEE-754 float spanning two consecutive registers, so always request a quantity of 2. An odd starting address or quantity lands mid-value and the meter returns an exception.

  • The default word order is most significant register first. It can be changed through the meter's "Register Order" holding register.

Parameter

Register

Address (hex)

Address (dec)

Unit

Line to neutral volts

30001

0x0000

0

V

Current

30007

0x0006

6

A

Active power

30013

0x000C

12

W

Apparent power

30019

0x0012

18

VA

Reactive power

30025

0x0018

24

VAr

Power factor

30031

0x001E

30

Phase angle

30037

0x0024

36

°

Frequency

30071

0x0046

70

Hz

Import active energy

30073

0x0048

72

kWh

Export active energy

30075

0x004A

74

kWh

Import reactive energy

30077

0x004C

76

kVArh

Export reactive energy

30079

0x004E

78

kVArh

Total active energy

30343

0x0156

342

kWh

Total reactive energy

30345

0x0158

344

kVArh

Why does the reading need to be converted to a float?

Because the meter returns a 32-bit IEEE-754 float split across two 16-bit registers, and the Modbus Read node hands you those raw bytes rather than a number. The two registers have to be recombined into a 32-bit word and reinterpreted as a float before the value means anything — that is what the function below does, for the meter's default most-significant-register-first order.

Drag and drop a "function" node for each reading and connect it to the output of the matching "Modbus Read" node:

Three Modbus Read nodes in the Node-RED flow

Modbus Read nodes wired to function nodes in Node-RED

Double click on any of the "function" nodes and paste the following code. You only have to replace the variable name:

// Access the msg.payload which contains the object
const bufferArray = msg.payload.buffer;

// Extract bytes from the buffer array
const highByteFirstRegister = bufferArray[0] & 0xFF;
const lowByteFirstRegister = bufferArray[1] & 0xFF;
const highByteSecondRegister = bufferArray[2] & 0xFF;
const lowByteSecondRegister = bufferArray[3] & 0xFF;

// Combine bytes into a 32-bit integer (big-endian)
const combinedValue = (highByteFirstRegister << 24) |
(lowByteFirstRegister << 16) |
(highByteSecondRegister << 8) |
lowByteSecondRegister;

// Convert to floating-point number using IEEE 754 format
const float32Buffer = new ArrayBuffer(4);
const float32View = new DataView(float32Buffer);
float32View.setUint32(0, combinedValue, false); // false for big-endian

// Replace variable name here instead of "voltage"
const voltage = float32View.getFloat32(0, false); // false for big-endian

// Replace variable name here instead of "voltage" (the key)
return { payload: { voltage: voltage } };

Do the same for the other function nodes, changing the variable names to match the registers you are reading. Then add one more "function" node and connect the output of the previous function nodes to its input:

Function nodes joined into the node that sets the Ubidots auth header

Double click on that node and add the following, replacing UBIDOTS-TOKEN with your Ubidots token:

msg.headers = {
'Content-Type' : 'application/json',
'X-Auth-Token' : 'UBIDOTS-TOKEN'
}
return msg;

Note: Newer versions of Node-RED implement header configuration natively, so this step may not be required.


3. Send the data to Ubidots

Drag and drop an "http request" node and a "debug" node and connect them to the previous nodes as shown below:

Complete Node-RED flow with http request and debug nodes

Double click on the "http request" node and fill in the fields as:

  • Method: POST is required to send data.

  • URL: https://industrial.api.ubidots.com/api/v1.6/devices/<your-device-label> — replace the placeholder with your device label.

Node-RED http request node posting to the Ubidots API

Click "Done" to save and then "Deploy". You will see a new device in Ubidots carrying the variables above:

Ubidots device showing the SDM230 variables received over Modbus

If you also read active power (register 30013) and reactive power (30025) and label them active-power and reactive-power, the Power Diagram widget will render the four-quadrant diagram for this meter — which is also the quickest way to prove the installation is wired the right way round.

Troubleshooting

Why is the meter returning nothing, or values that are obviously wrong?

Almost every SDM230 Modbus problem is one of six things. Work down the list in order:

  • Reading holding registers instead of input registers. Measurements are input registers — function code 04, not 03.

  • An odd address or quantity. Floats span two registers; both the starting address and the quantity must be even.

  • Address off by the register offset. The address is the register number minus 30001, not the register number.

  • Mismatched serial settings. Baud rate, parity, stop bits and slave ID must all match the meter exactly.

  • A and B swapped. Not standardised between vendors; swapping them is safe to try.

  • Wrong word order. If values come back as NaN, infinity or an absurdly tiny number, the two registers are being combined in the wrong order.

Frequently asked questions

Which Modbus register holds total energy on the SDM230?

Total active energy is register 30343, Modbus address 0x0156 (342 decimal), in kWh. Like every other value it is a 32-bit float across two registers, so read a quantity of 2 starting at 342.

Does the SDM230 use input registers or holding registers?

Both, for different things. All measurements are input registers (3xxxx), read with function code 04. Holding registers (4xxxx) hold configuration only — baud rate, parity, node address and register order — and are read with function code 03 and written with function code 16.

My values come back as NaN or a very small number. What is wrong?

That is the signature of a byte or word order mismatch, not a wiring fault. The SDM230 sends the most significant register first by default. If your master assumes the opposite, swap the two 16-bit words before reinterpreting the result as a float, or change the meter's "Register Order" holding register to match your master.

Can I put several SDM230 meters on one RS-485 bus?

Yes. Modbus allows node addresses 1 to 247, and the practical limit for one SDM230 segment is 32 nodes over up to 1200 m. Give every meter a unique slave ID, keep the baud rate identical across the bus, and terminate with 120 Ω at the two physical ends only.

Do I have to use Node-RED to reach Ubidots?

No. Node-RED is used here because it is free and runs on almost anything, but any Modbus master that can make an HTTP or MQTT request works. For a hardware gateway instead of a software one, see the Teltonika TRB140 gateway or, for a cellular RS-485 link, the SenseCAP Sensor Hub 4G.

Is the SDM230 single-phase only?

Yes. The SDM230 is a single-phase meter measuring one line-to-neutral circuit. For three-phase installations Eastron's SDM630 exposes the same style of IEEE-754 input registers with per-phase values, and the Node-RED conversion function on this page applies unchanged.


Register addresses and communication defaults on this page were last verified against Eastron's SDM230 Modbus protocol document in August 2026.

Did this answer your question?