Communications — UART Output¶
The board's interface to your system is a single UART on the host connector
(J7). With the default firmware it emits a plain ASCII distance stream
that any flight controller or onboard computer can read — this page is the
complete spec for that stream.
Alternate firmware changes this link's protocol
The ACO firmware variant (beta)
makes this same UART speak MAVLink v2 at 115 200 baud (running collision
avoidance on-board and sending OBSTACLE_DISTANCE to a flight controller)
instead of the ASCII stream below.
Physical¶
- Connector:
J7(see Hardware → Host UART). Board TX (pin 3) → host RX, GND (pin 4) → host GND. - Format: 8 data bits, no parity, 1 stop bit (8N1), no flow control.
- Direction: one-way (board → host).
Baud rate — important¶
Configure your host for ≈921 600 baud.
- 921 600 is chosen because it's the fastest rate typical flight-controller UARTs and USB-UART adapters receive reliably.
- ⚠️ Some older material / a boot banner may mention 115 200 — that's stale. Use 921 600.
Wire format (ASCII)¶
For every sensor with new data, the board prints a header line then eight rows of
eight integers. Distances are in millimetres; 0 means invalid / no
return (see Measurement validity).
- Header: literal
--- CHfollowed by the channel digit0–7and---. - Each of the 8 rows: 8 integers → an 8×8 = 64-zone grid for that channel, row-major, in the sensor's own frame.
- Frames stream at the ranging rate (15 Hz per sensor); channels are printed round-robin as each sensor reports new data.
So the full stream is, per channel, an 8×8 matrix of millimetre distances — one matrix per sensor, updating at 15 Hz.
Example output¶
A live capture looks like this — each channel's 8×8 grid arrives in turn and the
sequence repeats at 15 Hz. Here CH3 sees an object ~0.4 m dead center against a
wall ~2 m out; CH5 sees mostly open space (0 = no return):
--- CH3 ---
2015 2011 1998 1205 1199 1990 2005 2018
2012 2004 1210 812 809 1201 1995 2010
2008 1998 815 498 495 810 1988 2003
1995 1201 495 402 399 492 1199 1996
1990 1198 493 401 398 490 1197 1991
2006 2000 818 500 497 812 1990 2004
2013 2007 1215 820 817 1208 1998 2011
2019 2014 2003 1220 1214 1996 2009 2021
--- CH4 ---
3050 3044 3061 3072 3038 3040 3055 3066
3041 3033 3052 3060 3029 3035 3049 3058
... (8 rows total)
--- CH5 ---
0 0 0 0 0 0 0 0
0 0 3810 3805 0 0 0 0
0 0 3798 3792 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
Each value is a right-aligned integer (millimetres) in a fixed-width column, so columns line up and are whitespace-separated. Only channels with a connected, ranging sensor appear.
Reading it directly¶
Any serial terminal or a few lines of code will do — no special tooling:
# any serial terminal, 921600-8N1, e.g.
screen /dev/tty.usbserial-XXXX 921600
# or: minicom -D /dev/ttyUSB0 -b 921600
To turn the grids into 3-D points or obstacle data, see Integration.
Measurement validity¶
The board emits 0 for any zone that is not a real measurement (no/low
signal, out of range, etc.). Treat 0 as "no return", never as "obstacle at
0 mm". All non-zero values are valid distances in millimetres.