A reader asked me last week whether our laser rangefinder modules come with RS-485. They do not. I work at ERDI TECH LTD, we make the modules, and none of our published rangefinder module records lists RS-485 or RS-232 as the module's interface. The 905 nm modules and the compact 1535 nm ones speak UART at TTL level. The larger 1535 nm modules (LRF0815C and LRF1017C are examples) list RS-422.
That does not stop you from putting one on a 485 bus. The factory's answer for the LRF0305C was that any TTL-to-RS485 converter board works, and the wiring is the same for the other TTL models. What matters is what happens at the three joints: the logic level on the TTL side, the direction control, and the polling logic on the host. Here is how I would do each, with code I ran against a fake module before pasting it here.
1. The TTL side of the converter must match the module
"Runs from 5 V" does not tell you the UART level. Read the electrical table for the exact model:
- LRF0305C: the datasheet says UART (TTL 3.3 V).
- LR1200E4: TXD stays at 3.3 V logic even on a 5 V supply, and RXD must not be driven at 5 V. The absolute maximum input is 3.6 V.
- LR1200E2: the factory says TXD/RXD work with 3.3 V or 5 V logic.
- For several other models the manual does not state the level at all. I would not guess; ask before you wire.
Many cheap RS-485 breakouts use a 5 V transceiver, and the receiver-output pin of such a part swings to roughly 5 V. Wired straight to a 3.3 V module RXD pin, that can exceed the 3.6 V limit above. Pick a converter with a 3.3 V logic side, or put a level shifter between them. This is general electronics, not an ERDI claim, but it is the failure I would check first.
2. Direction control: let the last bit leave before you release the bus
RS-485 on two wires is half duplex. The host must enable the driver, send, then switch back to receive before the module answers. Two ways to do it:
- Use a converter with automatic direction control. Nothing to write, and the module sees an ordinary UART.
- Drive the DE/RE pin from the host (an RTS line on a USB adapter, or a GPIO).
If you drive it yourself, the classic bug is releasing DE when write() returns. The call returns when the bytes are in the OS buffer, not when the last stop bit is on the wire. The 8-byte frame used by the LR series (55 AA ...) is 80 bit times: 0.69 ms at 115200 baud, 8.3 ms at 9600. Wait that long, plus a small margin, before you drop DE. That is what time.sleep(self.frame_s + 0.0005) does in the code below.
3. Poll with exactly one request in flight
On a point-to-point UART you can get away with "read whatever arrives". On a bus with latency, or a radio link in the middle, you cannot. A late reply from request N can be taken for the reply to request N+1, and the distance is real but belongs to a different moment. Nothing in the log looks broken.
The simple fix is rule three from our request/response note: keep exactly one request outstanding, flush stale bytes before sending, accept the first valid frame inside the timeout, and treat a timeout as its own fault, separate from a checksum error.
The 8-byte frame, with its two checksums
The LR1000E2 to LR2000E4 family, LRF1200A1, LRF3000A1 and the SPD1200N0/N2/N4 use the same 8-byte frame, hexadecimal, 115200 baud by default:
55 AA FN D1 D2 D3 D4 SUM Single-shot request: 55 AA 88 FF FF FF FF 84. Reply: 55 AA 88 STA FF DIS_H DIS_L SUM. STA = 1 means success; the distance is big-endian and the raw value is metres times ten.
The part that bites: the two directions use different checksums, and the manual says so.
- Host to module:
SUM = (FN + D1 + D2 + D3 + D4) & 0xFF - Module to host:
SUM = (0x55 + 0xAA + FN + D1 + D2 + D3 + D4) & 0xFF
They differ by 0x55 + 0xAA = 0xFF, so a parser that reuses the transmit formula on replies is off by one on every frame. The manuals do not state stop bits or parity for this family; the code below leaves your serial library's 8N1 default, so confirm if your unit disagrees. Also note that LRF1200A1 and LRF3000A1 have an open protocol question on continuous ranging (the request function byte and the reply function byte differ in the manual), so this code sticks to single-shot, which is unaffected.
The code
import time HDR = (0x55, 0xAA) def tx_checksum(fn, d): # host -> module: sum(function + D1..D4) & 0xFF return (fn + sum(d)) & 0xFF def rx_checksum(fn, d): # module -> host: sum(0x55 + 0xAA + function + D1..D4) & 0xFF return (0x55 + 0xAA + fn + sum(d)) & 0xFF def single_shot(): d = (0xFF, 0xFF, 0xFF, 0xFF) return bytes((*HDR, 0x88, *d, tx_checksum(0x88, d))) def parse_reply(buf): """Return (distance_m or None, status, bytes_consumed). Resyncs on 55 AA, drops bad frames.""" i = 0 while len(buf) - i >= 8: if buf[i] == 0x55 and buf[i + 1] == 0xAA: f = buf[i:i + 8] if f[7] == rx_checksum(f[2], f[3:7]): sta, raw = f[3], (f[5] << 8) | f[6] return (raw / 10.0 if sta == 1 else None), sta, i + 8 i += 1 return None, None, max(0, len(buf) - 7) class Rs485Lrf: def __init__(self, ser, de_pin=None, baud=115200, timeout_s=0.25): self.ser, self.de, self.timeout_s = ser, de_pin, timeout_s self.frame_s = 8 * 10 / baud # 8 bytes x 10 bits per byte (start + 8 data + stop) def _send(self, frame): if self.de: self.de(True) # driver enable on self.ser.write(frame) time.sleep(self.frame_s + 0.0005) # wait until the last bit has left the shift register if self.de: self.de(False) # back to receive def measure(self): self.ser.reset_input_buffer() # exactly one request in flight: drop anything stale self._send(single_shot()) deadline = time.monotonic() + self.timeout_s buf = b"" while time.monotonic() < deadline: buf += self.ser.read(8) dist, sta, used = parse_reply(buf) if sta is not None: return dist, sta buf = buf[used:] return None, None # timeout: different fault from "bad checksum" I tested it with a fake serial object: the request bytes come out as 55 aa 88 ff ff ff ff 84; a reply built with the receive formula parses (55 aa 88 01 ff 04 d2 5d decodes to 123.4 m); a reply with one flipped checksum bit is dropped; a reply using the transmit formula is dropped; noise in front of the frame is skipped; STA = 0 returns None; an empty line times out; and DE goes high and then low around each request.
On real hardware, hook it up like this: import serial; s = serial.Serial("COM5", 115200, timeout=0.05), and pass de_pin=lambda on: setattr(s, "rts", on) if your adapter's RTS drives DE/RE (check the polarity of your board). I have not tested a specific converter board, so treat the bench check below as part of the job.
A short bench check before you trust the bus
- Power the module on the bench with a current-limited supply, and measure the TX idle level before you connect anything.
- Connect ground first, then TX/RX, then power.
- Capture raw bytes at the documented baud rate and check the header and checksum by hand before relying on your parser.
- Only then move to the long cable. Do not fix long-cable errors by lowering the baud rate alone; under motor noise the checksum still fails.
Where to look next
- Our wiring and protocol notes (MIT-licensed drivers and docs): https://github.com/ErdiTech/erdi-lrf-drivers
- The RS485 / RS232 question on the website: https://erdilrf.com/rs485-rs232-laser-rangefinder-module/?utm_source=devto&utm_medium=post&utm_campaign=devto-rs485-bus-202611
- UART flow control notes: https://erdilrf.com/knowledge/rangefinder-uart-flow-control/?utm_source=devto&utm_medium=post&utm_campaign=devto-rs485-bus-202611
If your model is not in the list above, send the model name and a raw hex capture of 20 frames to tommy@erdimail.com. A smoothed plot cannot tell me whether the problem is timing or checksum; the raw bytes can.
Disclosure: I am Tommy Yu, an engineer at ERDI TECH LTD (erdilrf.com), which makes the modules discussed. Facts checked against our model documents on 2026-11-18.

