Skip to the content
2 layers191.9 × 68.4 mmControl ROV, the printed circuit board in 3D

A Flask-based control system for a Raspberry Pi 4 ROV, featuring real-time video streaming, PID depth stabilization, and a web-based telemetry dashboard.

Size
191.9 × 68.4 mm
Copper layers
2
Thickness
1.6 mm
Parts
35
Nets
67
Pads
179
Tracks, vias
463, 14
Pours
3
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
6 Feb 2026
Updated
19 Feb 2026

Overview

Control ROV is an open-source printed circuit board by tdominguezmasciale, from the tdominguezmasciale/Control_ROV repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 191.9 × 68.4 mm with 35 parts on 67 nets, routed with 463 tracks and 14 vias.

It is built around the TRI 1-2413, MCP3208-BI/P and L7805, with the MPXA6115A6U among its other parts. Its parts include 11 connectors, 4 resistors, 4 ICs, 4 diodes and 4 transistors. It belongs with the robots and motor control boards of this library.

Main components

4

README

readme.md

ROV Control System

This project implements a local network-controlled ROV system. It features a web-based control interface, real-time video streaming, depth control via PID, and inertial measurement capabilities. The system is built around a Raspberry Pi 4B as the central processing unit. This project can be run without hardware connections for testing purposes.

ROV Testing in Water
Build and working ROV running the control system.

Components and Technologies Used

Hardware

  • Raspberry Pi 4B: Main processor serving as both web server and GPIO manager for hardware control.
  • ESCs: Blue Robotics BESC-R1 electronic speed controllers for T100 thrusters.
  • Thrusters: Blue Robotics T100 thrusters for ROV propulsion.
  • IMU MPU6050: GY521 module with MPU6050 inertial measurement unit (accelerometer + gyroscope).
  • Relays: SONGLE SRD-05VDC-SL-C relays for safe control of external loads.
  • ADC Converter MCP3208: Analog-to-digital converter for pressure sensor and analog signals.
  • Web Camera: Real-time video capture and streaming.
  • Depth Sensor MPX5100DP: Differential pressure sensor for depth measurement.

Frameworks and Libraries

  • Flask: Web server framework for control interface.
  • HTTP: Communication protocol between web interface and ROV.
  • MJPG-Streamer: Real-time JPEG streaming over IP network.
  • RPi.GPIO: Raspberry Pi GPIO control library.
  • Custom Libraries:
    • pid.py: Discrete PID controller for depth control.
    • esc.py: ESC motor controller for thruster speed/direction.
    • adc.py: MCP3208 analog signal reading.
    • filters.py: Signal filtering for motor control.
    • mpu6050.py: MPU6050 accelerometer/gyroscope handler.

Setup and Installation

  1. Update System

    bash
    sudo apt update && sudo apt upgrade
  2. Install Python and Flask

    bash
     sudo apt install python3-full -y
     sudo apt-get install python3-flask
  3. Install MJPG-Streamer: A utility that allows streaming video from a USB camera via HTTP, used for real-time visualization of the ROV's surroundings.

    bash
    sudo apt install build-essential libjpeg-dev imagemagick libv4l-dev git cmake uvcdynctrl -y cd ~
    git clone [https://github.com/jacksonliam/mjpg-streamer.git](https://github.com/jacksonliam/mjpg-streamer.git)
    cd mjpg-streamer/mjpg-streamer-experimental
    make
    sudo make install
  4. Enable Interfaces

    bash
    sudo raspi-config 

    And navigate to: Interfacing Options → Enable I2C → Enable SPI.

  5. Configure pigpiod Service: pigpiod is a utility that runs the pigpio library as a background process. This allows precise control of the Raspberry Pi's GPIO pins, necessary for sending PWM signals to the motors or ESCs. Enabling it as a service allows it to start automatically with the system and be ready before running the backend.

    bash
        sudo apt install pigpio
        sudo systemctl enable pigpiod
        sudo systemctl start pigpiod
  6. Configure Automatic Startup

    bash
        sudo nano /etc/rc.local

    Add the following (adjust paths as needed):

    bash
    #!/bin/sh -e
    
    sleep 5
    
    cd /home/tobias/mjpg-streamer/mjpg-streamer-experimental
    ./mjpg_streamer -i "./input_uvc.so -r 640x480 -f 30" -o "./output_http.so -w ./www" &
    
    sleep 10
    cd /home/tobias/ControlROV_01/
    python /home/tobias/ControlROV/app.py &
    
    exit 0

    This automatically launches the video server and the Flask backend at system startup. The sleep command ensures that the camera and network are ready before starting the processes. It is important to note that the paths used (/home/tobias/...) must be adapted to the file structure of the system where the project is implemented.

  7. Verify Services at Startup: This allows checking that the rc.local file executes correctly at startup, including the camera and Flask server.

    bash
    systemctl status rc-local.service
  8. IP Address Assignment Configure your router's DHCP settings to assign a static IP to the Raspberry Pi based on its MAC address (e.g., 192.168.0.160).

After this setup is done, the website will load on power on so we can directly access it via the browser of a device in the same network, in the IP address of the RaspberryPi, in the port 5000.

Pinout Configuration

FunctionGPIO PinPhysical PinConnected To
CS (Chip Select)GPIO 8Pin 24ADC MCP3208
CLK (Clock)GPIO 11Pin 23ADC MCP3208
DOUTGPIO 9Pin 21ADC MCP3208
DINGPIO 10Pin 19ADC MCP3208
Digital Output 1GPIO 5Pin 29Digital Output
Digital Output 2GPIO 6Pin 31Digital Output
Digital Output 3GPIO 16Pin 36Digital Output
Digital Output 4GPIO 26Pin 37Digital Output
PWM Channel 0 (A)GPIO 12Pin 32PWM MDI for ECU
PWM Channel 1 (A)GPIO 13Pin 33PWM MS for ECU
PWM Channel 1 (B)GPIO 19Pin 35PWM MDD for ECU
PWM Channel 0 (B)GPIO 18Pin 12Auxiliary PWM (Camera)
SDAGPIO 2Pin 3MPU-6050 Accelerometer
SCLGPIO 3Pin 5MPU-6050 Accelerometer

Boot Status Indicator (GPIO 16)

To provide a "plug-and-play" experience without a diagnostic screen, GPIO 16 (connected to a relay and high-intensity light) is activated as soon as the backend begins its boot sequence. Once the Flask server is fully initialized and the network is ready for connections, the light turns off automatically, signaling that the ROV is ready for operation.

ESC Wiring Standardization

Maintaining consistent wiring ensures predictable motor rotation direction:

Motor Phase to ESC Connection:

  • Phase 1 (ESC): Blue (motor)
  • Phase 2 (ESC): Green (motor)
  • Phase 3 (ESC): White (motor)
ESC ColorMotor Color
YellowBlue
BlackGreen
RedWhite

Project Structure

bash
    ControlROV/
    ├── app.py                 # Main Flask application
    ├── pid.py                 # PID controller implementation
    ├── esc.py                 # ESC motor controller
    ├── adc.py                 # MCP3208 ADC interface
    ├── filters.py             # Signal filtering utilities
    ├── mpu6050.py             # IMU interface
    ├── static/                # Web static files
    │   ├── style.css/ 
        ├── scripts.js/       
    ├── templates/      
    │   └── index.html          # HTML
    ├── PCB/                    # PCB diagrams and schematics
    │   └── Modelos3D           # 3D Modeles
    │   └── PCB.kicad_pcb
    │   └── PCB.kicad_pro
    │   └── PCB.kicad_sch

Software Architecture

This section details the software design of the ROV control system, focusing on the interaction between the Backend (hardware logic/control) and the Frontend (web-based user interface).


High-Level Architecture

Although the Flask server and hardware control run on the same Raspberry Pi 4B, the system is conceptually divided into three layers to ensure clear separation of responsibilities:


High-Level Architecture.

  • ROV (Logic & Hardware): Low-level Python scripts interacting with motors, ESCs, and sensors via GPIO, I2C, and SPI.
  • Server (Flask): The bridge that manages state, processes requests from the user, and communicates with the hardware layer.
  • Web Page (Frontend): The pilot's dashboard for real-time monitoring and manual control.

Backend: Control and Communication (Python & Flask)

The backend acts as the brain of the ROV. It manages sensor data acquisition, real-time video streaming, and the PID control loop for depth stabilization.

Main Responsibilities

  • Control Logic: Execution of the discrete PID algorithm and motor mixing.
  • Hardware Interface: Communication with the MCP3208 (ADC) and MPU6050 (IMU).
  • API Management: Handling HTTP routes for bidirectional data flow.
  • Streaming: Integration of MJPG-Streamer for low-latency video over IP.


Backend flow diagram.

PID Depth Control Graph
Real-time visualization of the PID controller maintaining depth stability.

API Routes

The following endpoints allow the Frontend to interact with the ROV's logic:

RouteMethodDescription
/GETServes the main user interface (index.html).
/gamepad_dataPOSTReceives axes and button data from the controller.
/update_pidPOSTUpdates $K_p$, $K_i$, and $K_d$ coefficients in real-time.
/read_allGETReturns all 8 ADC channel values in JSON format.
/togglePOSTSwitches the state of a specific GPIO output (e.g., lights).
/toggle_pidPOSTEnables or disables the depth stabilization loop.
/get_all_dataGETFetches telemetry (pitch, roll, depth, motor states).
/system_commandPOSTExecutes OS-level commands like Reboot or Shutdown.

Frontend: Web-Based User Interface

The frontend is built using HTML, CSS, and vanilla JavaScript. It uses asynchronous HTTP requests to update telemetry and send commands without refreshing the page.

Key JavaScript Functionalities
General FunctionSpecific FeatureJS ActionBackend Request
PID TuningUpdate coefficientsForm SubmissionPOST /update_pid
TelemetryUpdate readingssetInterval()GET /get_all_data
Manual ControlGamepad inputupdateGamepadStatus()POST /gamepad_data
GPIO ToggleAuxiliary triggerstogglePin(pin)POST /toggle
DataloggerRecording datastart-btn clickClient-side logic
SystemPower off / ressetsystem_comand()POST /system_command

Parts

35
QtyValueFootprintReferences
7Conn_01x03_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ2, J4, J5, J6, J13, J14, J16
4DDiode_THT:D_A-405_P10.16mm_HorizontalD1, D4, D5, D6
4NPNPackage_TO_SOT_THT:TO-92L_HandSolderQ1, Q2, Q3, Q4
4RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R3, R4
4SANYOU_SRD_Form_CRelay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK1, K4, K5, K6
11TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalV1
1C_PolarizedCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC1
1Conn_01x02_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ3
1Conn_01x04_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-4-5.08_1x04_P5.08mm_HorizontalJ7
1Conn_01x07_PinTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-7-5.08_1x07_P5.08mm_HorizontalJ15
1Conn_02x20_Odd_EvenPCB:MODULE_RASPBERRY_PI_4B_4GBJ1
1FusePCB:Fuse_20x5F1
1GY-521PCB:GY-521ACC1
1L7805PCB:TO255P1020X450X2000-3U3
1MCP3208Package_DIP:DIP-16_W7.62mm_SocketU1
1MPXA6115ASensor_Pressure:CFSensor_XGZP6897xU4
1TRI1-2413PCB:XL4005_DC-DCU2

Similar boards

  • 4 layers160 × 118 mmHellen88bmw, the printed circuit board in 3D

    Hellen88bmw

    rusefi/hellen88bmw

    307 parts2
  • 2 layers59.1 × 14 mmVacuumSensor, the printed circuit board in 3D

    VacuumSensor

    JulienDevillers/vacuumSensorPCB

    PCB for vacuum sensor for DIY pick and place machines

    12 partsMIT
  • 2 layers83.8 × 81.3 mmPressure sensor, the printed circuit board in 3D

    Pressure sensor

    IsuriWeerarathne/Smart-BioGas-System

    This Project is about a microcontroller-based hardware project on automated biogas system which done as a group project.

    7 parts1
  • 4 layers100 × 100 mmESP32-Eurorack Audio, the printed circuit board in 3D

    ESP32-Eurorack Audio

    ctag-fh-kiel/esp32-eurorack-audio

    Open source eurorack audio module based on ESP32

    173 parts71
  • 2 layers150.5 × 127 mmEurorack engine, the printed circuit board in 3D

    Eurorack engine

    sinneb/esp32-hvcc

    Heavy compiler (hvcc) sources running on ESP32-DevKitC powered eurorack module

    81 parts29
  • 2 layers100 × 100 mmTroll-8, the printed circuit board in 3D

    Troll-8

    ctag-fh-kiel/troll-8

    Arduino-Based μSynth / μMidiController Development Platform

    94 parts14
  • 4 layers100 × 100 mmPlantomation V2, the printed circuit board in 3D

    Plantomation V2

    Synthron/Plantomation

    DIY plant watering system

    203 parts10

Questions

How big is the Control ROV PCB?

It measures 191.9 × 68.4 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Control ROV use?

35 parts, built around the TRI 1-2413, MCP3208-BI/P, L7805 and MPXA6115A6U. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Control ROV KiCad files?

From the tdominguezmasciale/Control_ROV repository on GitHub, at the commit this page was made from: the board is PCB/PCB.kicad_pcb and its schematic PCB/PCB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Control ROV design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).