Build your own autopilot

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-nc-sa/4.0/ Building your own autopilot, including the hardware and software, is a fun and rewarding project. I made the design and tutorial as simple as possible so that anyone can build it.
Minimal hardware
  • ESP32 microcontroller - $4
  • Motor driver - $7
  • 5V power supply (USB) to the ESP32 - $2
  • Wires - $2
  • An actuator driving your rudder
  • Your phone or tablet
Recommended hardware
  • Fuse
  • A box
Software

ESP32 Microcontroller

The ESP32 is a low-cost microcontroller with built-in Wi-Fi and Bluetooth. It is perfect for this project because it is easy to program and has many pins. The ESP32 can be programmed using my web flasher or the Arduino IDE and powered with a 5V power supply. It connects to the motor driver using 4 pins and to your phone via Wi-Fi or Bluetooth. The cheapest source is AliExpress: https://aliexpress.com/item/1005004476867346.html. For faster shipping, you can buy it locally or via Amazon/eBay. I prefer the USB-C version with 30 pins because it is more durable.
ESP32

Motor driver

A motor driver translates the PWM signal from the ESP32 into a high switching current to control the motor direction and speed. I use the IBT-2 motor driver for its availability, price, and support for motors up to 43 Amps. Alternatives include the L298N or L293D. The IBT-2 is available on AliExpress: aliexpress.com/item/4000121484634.html, or from local/online suppliers such as Amazon.
autopilot motor driver

Wires

The wires to connect the ESP32 are called female-to-female jumper wires (Dupont). You need 6 wires to connect the ESP32 to the motor driver, but packs usually include at least 30. The motor driver requires a direct supply from your boat’s battery. Two output wires must be connected to your motor.
autopilot Dupont wires

Power supply

You can power the ESP32 via USB or the VIN pin. A good option is an ESP32 expansion board, which converts 12V to 5V and provides easier wiring. Ensure it supports up to 16V and buy an additional DC plug. https://aliexpress.com/item/1005004673048101.html
expansion board

Actuator

The actuator is the motor that drives your rudder. You can use an existing one or buy new. Steering types:
Tiller steering
A linear actuator is recommended. Specs: 300mm stroke, 50mm/s speed, 200N force (full left to right in ~10s). Example: https://nl.aliexpress.com/item/1005004205595864.html
Wheel steering
Options include wheel drives from Raymarine or second-hand units. Example: ST4000 wheel drive.
Hydraulic
Requires a hydraulic pump (e.g. Hy-Pro 0.8 liter, ~€300). Size the pump displacement to your cylinder volume.
linear actuator

wheel drive

hydraulic pump

Software installation

  1. Go to the flasher page and flash the firmware to your ESP32.
  2. If successful, connect to the ESP32 via Bluetooth using the autopilot app.
  3. The app will then update the firmware, adding support for the built-in compass, NMEA, and wireless remote. After this, the phone is no longer needed.

Phone or tablet

Any phone/tablet with a compass (magnetometer) works. 95% of devices have one—check via a compass app. Verify your device specs at gsmarena.com.

Hardware installation

This section covers wiring the components to the ESP32. For convenience, I use an expansion board.

Wiring the IBT-2 motor driver

The IBT-2 has 8 pins, we use 6: 1. VCC → +5V from ESP32 2. GND → GND from ESP32 3. R_IS → Not connected 4. L_IS → Not connected 5. R_EN → +5V from ESP32 6. L_EN → +5V from ESP32 7. R_PWM → GPIO 32 on ESP32 8. L_PWM → GPIO 33 on ESP32

Compass (IMU)

The supported compass is the ICM20948 (9DOF: accelerometer, gyroscope, magnetometer on X/Y/Z). Recommended: Pimoroni module. Since the chip requires 1.8V, use a breakout board (Pimoroni, SparkFun, Adafruit, etc.) with level shifting for ESP32 (3.3V). Wiring:

  • VCC → 3.3V
  • GND → GND
  • SDA → GPIO 21
  • SCL → GPIO 22
After installation, compass data appears in the app (magnetic north, not true north). Calibrate in Settings → Sensors.

compass

Wireless remote

Requires a 433MHz receiver + remote (must support 3.3V). Wiring:

  • VCC → 3.3V
  • GND → GND
  • D0 → GPIO 12
Example codes:
  • 230821 → -1° (manual adjust, AP=on)
  • 211124 → -10°
  • 880810 → +1°
  • 190728 → +10°
If you order from my shop, I can pre-program these. Otherwise, clone my remote or use this transmitter code: GitHub project

remote receiver

Clutch control

The clutch disconnects the actuator from the rudder—useful for engaging/disengaging the autopilot. Hydraulic: usually a bypass valve. Mechanical: electromagnetic clutches. GPIO13 → HIGH when AP is active (use for relay/MOSFET control). Most clutches: 12V/24V two-wire input.

Rudder Sensor

A rudder sensor greatly improves steering precision (~50% fewer corrections). GPIO39 (VN) reads 0–3.3V from a potentiometer or hall sensor. Configure left/middle/right in the app for calibration. Example sensor: https://www.jovialmarine.com/en/shop/rudder-sensor-5