Skip to main content

SPD1200N4 UART protocol and integration

SPD1200N4 905 nm Laser Ranging Module

Typical applications: Night vision, Thermal imaging, Civil optics.

At a glance​

Protocol familyFamily A (55 AA, polled)
Default baud115200 bps, 8N1
Frame8 bytes
Distance unit on the wiremetres x 10
Measurement range (datasheet)see specification

Specification​

Values come from the ERDI datasheet for this model. Where the datasheet gives a condition, it is shown.

ParameterValueCondition
Laser wavelength905 ± 5 nm
Ranging accuracy±0.3 m (≤100 m) · ±0.3 m + D×0.7‰ (100–1,200 m)
Measurement frequencyOn request
InterfaceUART-TTLCustomizable
Supply voltage3.3–5 V
DimensionsOn request
WeightOn request
Protection ratingOn request
Laser safety classOn request
Operating temperatureOn request
Ranging distance0.2–1,200 mStrong sunlight or low visibility may reduce range

Pinout and wiring​

The pin table for this exact variant is in the model datasheet (see Resources). The connector and wire specification is in the specification table above.

Cross TX and RX (module TX to host RX), share ground, and power the module from a supply that matches the supply voltage in the specification table. See Wiring and power.

Protocol summary​

  • Frame: 8 bytes, header 55 AA, then function code, four data bytes, checksum.
  • Default baud: 115200 bps, 8 data bits.
  • Transmit checksum: lower 8 bits of function code + D1..D4 (the header is not included).
  • Reply checksum: lower 8 bits of header H + header L + function code + D1..D4 (the header is included). The two formulas differ on purpose.
  • Reply to a ranging command: 55 AA <fn> STA FF DIS_H DIS_L SUM. STA = 1 means the measurement succeeded.
  • Distance: DIS_H:DIS_L is the measured value in metres multiplied by 10.
CommandRequest frame
Single-shot ranging55 AA 88 FF FF FF FF 84
Continuous ranging55 AA 89 FF FF FF FF 85
Stop ranging55 AA 8E FF FF FF FF 8A
Angle measurement55 AA 8A FF FF FF FF 86

The full frame description is in Family A protocol. Try it without installing anything in the browser serial monitor.

Code examples​

pip install erdi-lrf # PyPI, MIT
erdi-lrf --port /dev/ttyUSB0 --model SPD1200N4 measure
from erdi_lrf import ErdiLRF

with ErdiLRF("/dev/ttyUSB0", "SPD1200N4") as lrf: # COM3 on Windows
r = lrf.measure() # single-shot (0x88)
print(f"{r.metres:.3f} m", "raw", r.raw)

Platform status​

Only rows with evidence say Verified. See the compatibility matrix for what that means and where the evidence is.

PlatformStatusGuide
Python (erdi-lrf)UntestedPython / Raspberry Pi / Jetson
Arduino / PlatformIOUntestedArduino / PlatformIO
ESPHome / Home AssistantUntestedESPHome
ROS 2UntestedROS 2
ArduPilot (Lua script)UntestedArduPilot
ArduPilot native driverNo driver yetArduPilot

Known issues​

  • The datasheet states that request and reply checksum scopes differ but does not print the transmit formula. The erdi-lrf driver uses the family A transmit formula, which reproduces every example frame the datasheet does print.
  • UART logic level is not stated as a separate field for most models. Supply voltage is not the UART voltage: check the module's TX level against your host before wiring, or ask us.

Resources​