Case study 05Embedded remote-control boat

KObait

A two-board embedded system for a bait boat: a handheld remote and a boat controller joined by a radio protocol of my own, with safety gates in front of the motors.

Status: PrototypeBench-tested, not yet on the water
Role
Hardware integration, firmware for both boards, protocol design and test tooling
Timeline
Mar 2026 to present
Context
Personal hardware project
Layers
Hardware
Links

01 Overview

KObait is a remote-controlled bait boat for fishing. It carries bait out over the water, remembers saved waypoints and releases the bait through hatches. It is also my hardware lab, the place where software habits such as single ownership, explicit contracts and tests meet wiring, radios and batteries.

Where it is now. The system was rebuilt from its first generation into a two-board system with a long-range radio link and a screen on the remote. It is a bench prototype. The radio, displays, positioning and control logic work on the desk, and it has not yet been in the water.

Specification

Boards
Two: a boat controller and a handheld remote
Radio
Long-range link with a protocol of my own
Safety
A lost link stops the boat; gates in front of the motors
Firmware
C++; about 4,500 lines on the boat, 14,000 on the remote, partly generated
Tests
Host-side check scripts and 24 bench diagnostic sketches
  • Only one part of the code may drive the motors, and tests enforce it.
  • A lost radio link stops the boat. Autonomous return is deliberately not built until it is an explicit decision.
  • The radio timing comes from a measured round trip, not from a datasheet.

02 Architecture

Two boards joined by a radio link. On the boat, the safety logic has the last word over anything the remote asks for.

Fig. 05.1

Two boards, one link

Handheld remote

  • HardwareJoystick

    stored calibration, diagonal mapping

  • HardwareButtons, D-pad

    hold opens a hatch, tap closes it

  • FirmwareRemote firmware

    mixing, neutral-to-arm gate, sequenced commands

  • ClientDisplay

    custom UI framework, dirty-region repaint

  • HardwareRadio module

    transparent radio, serial interface

Radio link

Boat controller

  • HardwareRadio module

    transparent radio, serial interface

  • FirmwareBoat state machine

    sole mode owner: 6 modes, 13 stop reasons, failsafe stop when control goes silent

  • FirmwarePropulsion authority

    only motor-signal writer; ramp, pause, calibration

  • HardwareESC controllers

    reverse-capable, two motors

  • FirmwareAutopilot

    heading control to Home, A or B

  • HardwareSensors

    position and heading, with health checks

  • HardwareWater, leak, battery

    latched leak alarm, battery thresholds

  • HardwareBait hatches

    two servos, closed at startup

The remote is the radio master and transmits control frames at a fixed rate; the boat replies only inside a jittered window or with a periodic heartbeat. On the boat, one state machine owns the mode and one propulsion module owns every motor pulse, and host-side tests enforce both. Losing the link stops the boat.

03 Hard problems

  • Radio collisions that looked like dead hardware

    Problem

    The first radio link looked like a dead uplink, even though both modules powered up and answered.

    What I did

    Separate test runs showed that every loss was two transmitters talking over each other. A schedule fixed it, with full delivery and zero checksum errors on the bench.

  • Timing from measured air time

    Problem

    A measured radio round trip made the original control rate and failsafe timeout physically impossible.

    What I did

    I re-derived every timing constant from the measurement. The trade-off, some metres of coasting before the failsafe stop, is documented as an estimate, not a measurement.

  • Stale commands after a reboot

    Problem

    A remote reboot restarted its counters, so the boat could reject frames or treat an old command as a fresh success.

    What I did

    The boat re-baselines once per outage and the remote ignores stale echoes. A session-aware protocol is designed but not yet built.

04 Decisions

Range over water, with framing of my own.
The radio is transparent. It has no packets, checksums or acknowledgements, so the firmware provides them.
Stop, not return-to-home, when the link is lost.
Autonomous movement after losing contact is a product decision that needs an explicit yes, not a default.
A custom UI framework instead of an off-the-shelf one.
The usual libraries need far more memory than the board has, and there is no framebuffer. The framework repaints only the regions that changed.
Optional parts are non-critical.
A display failure once left the boat in an infinite loop with the motor controllers live. Now the boat runs without a display, or without AUTO, instead of halting.
The pairing ID is isolation, not authentication.
It keeps two boats from answering each other's remote. It is not a security boundary, and the protocol documentation says so.

05 What I built

Boat controller

  • Firmware organised around safety: explicit modes, a stated reason for every stop and gates in front of the motors.
  • Waypoint navigation to saved points, gated off until its sensor is verified.
  • Leak and battery alarms, a hardware watchdog and release hatches for the bait.

Radio and protocol

  • A protocol of my own over a transparent radio: framed, checked, paired and tolerant of noise.
  • Commands that are acknowledged, so each one is carried out exactly once.
  • A schedule that keeps the two radios from talking over each other.

Handheld remote

  • A remote with its own screen and UI, built on a framework I wrote for a very small memory budget.
  • A calibrated joystick and a safe arming sequence. The output stays at zero until the stick is healthy and centred.

Tooling

  • Single-purpose bench sketches for every part of the hardware.
  • Host-side Python checks for architecture rules, control logic and protocol behaviour.

06 Status

Today

  • Both boards run their firmware on the bench, and the radio link has been verified in both directions on a desk.
  • Positioning, displays, the remote UI, joystick calibration and sensor baselines are verified on the bench.
  • AUTO is gated off in firmware because one sensor does not respond on the current bench wiring.
  • A second version of the remote interface is written, with a dashboard, a side menu with saved settings and text in five languages, but it has not been flashed to the bench hardware yet. An offline map is a separate prototype.

Notes

No photos of the hardware are published yet. The plate at the top of this page is a schematic illustration, not a render of the boat.

07 What I learned

  • Measure before you tune. The radio's real round trip rewrote every timing constant.
  • On a machine with propellers, safety is structure. One place that can drive the motors, one owner of the mode, and tests that keep it that way.
  • Writing down what has not been tested yet (no water test, no range test) is part of the engineering, not an admission.

08 Stack

  • C++
  • Arduino
  • Python

Built with: credits and licenses

  • Adafruit GFX Libraryby Adafruit Industries

    Graphics primitives on both boards; the remote’s ASCII text uses its 5×7 font.

    UsedBSD

  • Adafruit sensor and display driversby Adafruit Industries

    Sensor and status-display drivers on the boat, through Adafruit’s driver, unified-sensor and bus libraries.

    UsedMIT, BSD, Apache-2.0

  • A sensor-data parserby Mikal Hart

    Reads sensor data on the boat.

    UsedLGPL-2.1-or-later

  • SdFatby Bill Greiman

    SD card storage on the remote.

    UsedMIT

  • Servo and the Arduino AVR coreby Arduino

    Motor-controller signals, serial, I²C, SPI and EEPROM on both boards.

    UsedLGPL-2.1

  • A community display driverby David Prentice

    Drives the remote’s display.

    UsedNo license of its own; bundles BSD and LGPL code

All credits and licenses
Now on repeatMemory RebootVØJ, NarventYouTubeOpen YouTube player
Electricity reactivity

YouTube changes the circuit through player state alone.

Synthwave selection

Memory Reboot

VØJ, Narvent

Opening the player connects to YouTube. Google’s privacy policy