Skip to main content
Explore ERDILRF

Press ↑↓ to move, Enter to open, Esc to close.

Laser Rangefinder Serial Protocol: Frames & Checksums

Short answer: Select a laser rangefinder protocol by the exact model and document revision. The examples below cover the linked LR2000E2 and LRF200H manuals; they are not a protocol inventory for the whole catalog. The 1535 nm LRF0610C document shows a different command format. Check wiring, configured baud rate, frame length, status, units and checksum together before integration.

ERDI LR2000E2 laser rangefinder module
LR2000E2, one of the modules discussed here. Specifications and price.

LR2000E2 ranging example: the 55 AA command/response frame

The linked LR2000E2 User Manual v1.2 (cover date 2025.10), section 8, pages 6-8, shows 8-byte 55 AA single-shot, continuous and stop-ranging exchanges on page 7, with default 115200 bps and 8 data bits specified on page 6. This example covers those ranging exchanges, not every configuration command or acknowledgement, and does not automatically apply to other LR, SPD or LRF models. Check configuration acknowledgements against their own command tables; the page 8 LD constant-on reply entry requires written clarification before implementing that acknowledgement. Confirm the delivered configuration and current controlled revision.

55 AA <function> <D1> <D2> <D3> <D4> <checksum>

For LR2000E2, the manual lists 55 AA 88 FF FF FF FF 84 for single-shot ranging, 55 AA 89 FF FF FF FF 85 for continuous ranging and 55 AA 8E FF FF FF FF 8A to stop. A single-shot or continuous distance reply uses 55 AA <fn> STA FF DIS_H DIS_L SUM; STA = 1 indicates success. The two-byte distance is high byte first and the reported value is the measured distance in metres multiplied by ten, so 0x0429 means 106.5 m. These are model-specific examples (manual p7). For a stop-ranging reply, check the documented stop status; do not convert its FF FF fields into a distance.

LR2000E2 checksums: different covered bytes for transmit and reply

For the LR2000E2 frames above, manual pages 6-8 specify different checksum ranges for command and response frames:

  • Transmit checksum (what your microcontroller sends): sum of the function code plus the four data bytes, lower 8 bits. SUM(Function Code + D1 + D2 + D3 + D4) & 0xFF.
  • Reply checksum (what the module sends back): sum of both header bytes plus the function code plus the four data bytes, lower 8 bits. SUM(0x55 + 0xAA + Function Code + D1 + D2 + D3 + D4) & 0xFF.

For these LR2000E2 frames, using the command byte range to validate a reply will produce a different checksum because the reply includes both header bytes. Keep the two byte ranges separate and validate the status and distance fields as well. A valid checksum alone does not prove a valid measurement.

Check the LR2000E2 ranging checksum arithmetic

For the documented single-shot request, (0x88 + 0xFF + 0xFF + 0xFF + 0xFF) & 0xFF = 0x84. For a ranging reply, sum the seven bytes before its checksum, including 55 AA, and keep the lower eight bits. Then check the status byte before converting the distance. Match a driver’s frame handling to the model, command and manual revision before using it.

LRF200H example: 5C distance output and separate setting commands

The linked LRF200H PDF, section 5, pages 4-6, documents UART at 460800 bps (adjustable), 8 data bits, 1 stop bit and no parity. Its distance output is the 4-byte little-endian frame 5C <distance low byte> <distance high byte> <checksum>. For this output frame, the checksum is (~sum(distance_bytes)) & 0xFF, excluding the 5C header. The same document also lists 6-byte 5A setting/read command and reply examples and an IIC interface; the 4-byte distance stream is not the format of every message.

Worked checksum example on that same frame, 5C 02 11 EC: the distance bytes are 0x02 and 0x11, the header byte 0x5C is not part of the sum. 0x02 + 0x11 = 0x13; inverted (one’s complement) and masked to 8 bits, ~0x13 & 0xFF = 0xEC, which matches the frame’s trailing checksum byte exactly. That confirms the checksum is computed over the distance-byte pair only.

For the documented LRF200H distance frame, 5C 02 11 EC means 4354 cm, or 43.54 m. The manual defines 0xFFFF as the out-of-range output. Do not treat this as a valid distance, or copy the centimetre scale to another model without its own protocol document.

Continuous vs single-shot: which to use

  • Single-shot: use an on-demand mode only when it is documented for the exact model and configuration. The LR2000E2 p7 example uses function 0x88.
  • Continuous ranging: use a documented steady output mode when repeated measurements are required. LR2000E2 p7 uses 0x89 and documents 0x8E to stop; LRF200H has a separate active distance output and setting protocol. Confirm mode commands and configured rate from the applicable manual.

Frame format quick reference

Checked model exampleDocumented frameDocumented UART baudDistance units / limitation
LR2000E2, manual v1.2 pp6-855 AA, 8-byte single/continuous/stop-ranging exchanges115200 bps default; configurable0.1 m per distance count; check STA
LRF200H, PDF pp4-65C, 4-byte distance output; separate 5A, 6-byte setting/read examples460800 bps, adjustableCentimetres for the shown distance output; 0xFFFF means out of range
LRF0610C, PDF pp3-555 start / CMD / LEN / parameters / CHK; 6-byte command examples and variable reply lengths115200 bps stated; confirm configurationDifferent protocol; confirm the command field, units and controlled revision

Sources checked 2026-10-13: LR2000E2 User Manual v1.2, pp6-8; LRF200H PDF, pp4-6 and update history p8; LRF0610C PDF, pp3-5. The LRF200H history lists V2.1 dated 2025-03-06; the linked LRF0610C PDF has no confirmed revision identifier in this review. LRF0610C uses a different 55 command format with an XOR check; its public LEN wording and connector power labels need written clarification before implementation. These examples do not establish protocol or driver support for unlisted models.

Check field length before decoding: a host-only exercise

Complete-frame validation and field decoding are separate checks. A conversion routine can return an integer from incomplete input; silently slicing extra bytes can hide a boundary error. Validate the expected field size before interpreting it. Choose that size, byte order, signedness, scale and invalid-value rules from the exact command and controlled model document.

This standalone Python exercise deliberately defines a synthetic unsigned, two-byte, little-endian field. It assumes a bytes input. It is not a distance or baud-rate decoder for any ERDILRF model, and its integer has no physical unit. It does not read a serial port or check a complete frame, status or checksum.

def decode_demo_u16_le(field: bytes) -> int:



    if len(field) != 2:



        raise ValueError("expected exactly two bytes")



    return int.from_bytes(field, "little", signed=False)

Try four synthetic byte sequences: empty input, 80, 80 04 and 80 04 FF. The first, second and fourth raise ValueError; only 80 04 returns 1152. This demonstrates the chosen host-side length contract, not a supported device setting or a valid measurement. Do not recover a malformed frame by truncating it to fit this example.

For a real integration, validate the complete documented frame and its status/checksum, then extract fields at the documented boundaries. Confirm the model, command and revision before choosing a decoder. A passing synthetic example does not establish electrical, timing, firmware or hardware compatibility.

Driver case study: a short frequency field can look like a valid number

A length check also matters inside an existing driver. In ErdiTech/erdi-lrf-drivers, pinned commit 96b8aca, read_frequency() slices the first two reply-data bytes and converts them with int.from_bytes. That conversion accepts empty or one-byte input. A subsequent calculation can therefore return a plausible number even when the expected two-byte field is incomplete.

The proposed guard below belongs immediately after the parsed reply is returned inside that method, before the existing conversion. It follows the driver’s existing short-reply error style. This is a patch candidate, absent from the pinned version, not an SDK release or a validated device decoder.

if len(reply.data) < 2:



    raise NoReplyError(f"{self.spec.model}: short frequency reply {reply.frame.hex(' ')}")

In a finite host-side comparison, the original method returned 1152 for an empty field and 288 for 03. With the candidate guard, both raised NoReplyError. For 03 00, both versions returned 288; for 03 00 FF, both also returned 288. These numbers used a synthetic base value of 1152; they are test arithmetic, not a supported measurement rate for any module.

This candidate checks a minimum field length and preserves the pinned method’s existing treatment of extra bytes. It deliberately differs from the strict two-byte exercise above. It does not establish whether an extra byte is valid on the wire. Frame length, command, status, checksum and field boundaries still require the exact model’s controlled protocol document and captured device data.

The comparison ran four original-method cases and six candidate cases. The additional candidate cases confirmed that an unsupported capability and a missing frequency base raise UndocumentedError before the injected command runs. The real method and its capability check ran, but construction and serial access were bypassed and parsed replies were injected. The frame parser, transport, physical hardware, firmware, ROS and PX4 were not tested. Confirm the delivered model, interface and document revision before adapting this candidate to a real integration.

Frequently Asked Questions

Why does my checksum check fail even though the module answers correctly?

Check the exact frame type and covered bytes, along with wiring and configured serial settings. In the LR2000E2 example, commands sum function and data bytes while replies also include both header bytes. Use the checksum range specified for the command or reply you are handling.

What’s the difference between family A and family B protocols?

Select by the model and command type. LR2000E2 documents 55 AA ranging exchanges; LRF200H documents 5C distance output plus separate 5A settings. LRF0610C uses a different 55/CMD/LEN format. Select by exact model and revision.

Does the same frame format mean the same units across every model?

No. Use the distance scale and invalid-value rules in the exact model document. The checked LR2000E2 example uses 0.1 m per count; the checked LRF200H distance output uses centimetres and 0xFFFF for out of range. These units are not inferred for other models.

Should I use single-shot or continuous ranging?

Use a documented single-shot mode for on-demand measurements and a documented continuous mode for repeated output. Confirm the available commands and configured rate for your exact model; these examples do not establish that an entire family supports or lacks a mode.

Is there an open-source driver I can use instead of writing my own decoder?

Choose a driver whose documented model and protocol revision match your module. Review its license and version, then validate captured frames, status, checksum, distance units and invalid-value handling against the model manual before integration.

Need a protocol clarified for your specific model?

ERDI is the manufacturer behind ERDILRF. Send the exact model, delivered configuration, firmware or document revision, interface option and a short captured frame to tommy@erdimail.com or contact ERDILRF for written clarification. Use the UART-TTL integration guide only for a confirmed TTL configuration; RS422 needs its own electrical interface review.

Explore knowledge

Related technical guides

Models mentioned in this article