A remote-controlled boat, built like a robot
A personal project to build a remote-controlled boat the way I would build a robot cell, with a defined protocol, telemetry and safety stops. Two Raspberry Pi Pico boards run firmware in Rust, and a web app can steer the boat from a browser.
The problem
A cheap RC kit sends stick positions and hopes for the best. I wanted to know what the boat is doing, to configure it without reflashing, and to make sure it stops by itself when the link fails.
What I built
Two boards. boat_drive sits in the hull and drives the motor controller and the rudder servo. boat_rc is a Pico W in a handheld remote with two potentiometers for throttle and steering. They talk over UART.
One protocol for every link. All messages are CBOR maps framed with COBS, so the same commands work over UART, USB serial and Bluetooth Low Energy. Commands get an immediate acknowledgement and a final result; both boards stream state reports with a sequence number; faults arrive as events. A handshake tells the host which board it is talking to, so the web app only shows the controls that board supports.
Safety in the firmware. Throttle and steering commands double as keepalives. If none arrive for two seconds, boat_drive ramps the motor back to neutral, centres the rudder and reports a watchdog event. The remote only arms the throttle once the link is healthy and the throttle knob has been returned to neutral.
A browser remote. A Next.js app connects through WebSerial or WebBluetooth. Besides steering, it calibrates the rudder’s zero point and stores it in the remote’s flash, and it can hold the boat in place using the browser’s location (the GPS of the phone it runs on), a “virtual anchor” in which the firmware clamps the app’s commands to a narrow safe window.
Result
Photos and a video of the boat on the water will follow. The protocol is described in the note A tiny robot protocol.