Skip to the content
2 layers99.5 × 99.5 mmSchematicKiCadProyect, the printed circuit board in 3D

SchematicKiCadProyect

dduarteCE/Robot-vacuum1

Embedded Linux robotic vacuum system built with Yocto on Raspberry Pi 4, featuring autonomous navigation, audio playback, and remote control through a web interface.

Size
99.5 × 99.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
42
Nets
72
Pads
172
Tracks, vias
415, 36
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
12 Mar 2026
Updated
27 Apr 2026

Overview

SchematicKiCadProyect is an open-source printed circuit board by dduarteCE, from the dduarteCE/Robot-vacuum repository on GitHub, published under the MIT licence. It is a 2-layer board of 99.5 × 99.5 mm with 42 parts on 72 nets, routed with 415 tracks and 36 vias.

It is built around the L298N, PAM8403DR and MPU-6050, with the HC-SR04 and FDMS8350LET40 among its other parts. Its parts include 14 resistors, 10 ICs, 5 diodes, 5 connectors and 1 transistor. It belongs with the audio and music and computers and single-board computers boards of this library.

Main components

5

README

README.md

Robot Vacuum: Autonomous Vacuum Cleaner Embedded System

This repository contains the complete system for an autonomous robot vacuum built on a Raspberry Pi 4, using a custom Linux image created with Yocto. The system includes autonomous navigation, low-level hardware control, a secure web interface for remote control, and audio playback.

For a detailed description of the software design and Yocto image decisions, see the Design Document (DI). For a summary of the technologies used, see the Continuous Learning Document (AC).


Table of Contents

  1. System Overview
  2. Hardware Architecture
  3. Software Architecture
  4. Web Technology Stack
  5. Embedded Operating System (Yocto)
  6. Compilation and Deployment
  7. Dynamic Library API (librobot.so)
  8. Architecture Diagrams and Evidence

1. System Overview

FeatureDescription
Autonomous CleaningReactive zig-zag coverage algorithm with alternating turn direction.
Manual ControlDirectional D-pad control via HTTPS, with ventilator activation/deactivation.
Web InterfaceDashboard with registration, login, remote control, coverage map, and music player.
HTTPS SecuritySelf-signed certificate automatically generated on first boot.
AuthenticationPasswords hashed with SHA-256 (10,000 iterations) and salt, with session management via cookies.
Inertial Sensor (IMU)MPU-6050 for orientation tracking and accelerometer-based motion detection.
2D Mapping64x64 fixed grid that records detected obstacles with awareness of the robot's orientation.
AudioMusic player and synthesized notification tones for system events.
Automatic StartupThe system starts automatically on boot thanks to a SysVinit script in the Yocto image.

2. Hardware Architecture

The robot is built around a Raspberry Pi 4 running a minimal, custom Linux image.

  • Processor: Raspberry Pi 4 (BCM2711).
  • Sensors:
    • 3 × HC-SR04 ultrasonic sensors for obstacle detection.
    • 1 × MPU-6050 Inertial Measurement Unit (IMU) via I²C for pose tracking.
  • Actuators:
    • 2 × DC motors controlled by an L298N H-bridge driver.
    • 1 × Vacuum motor (centrifugal blower) controlled by a MOSFET.
  • Motor Control:
    • Speed controlled by hardware PWM (GPIO 12 and 13).
    • Direction controlled by GPIO pins.
  • Audio: PAM8403D amplifier with output via a 3.5mm jack.
  • Indicators: 4 × status LEDs for system on, autonomous mode, manual mode, and obstacle detection.

For a complete breakdown of components and GPIO mapping, see the hardware documentation. Evidence of the cross-compilation can be found in the yocto-image-recipies/evidence/ directory.


3. Software Architecture

The application uses a multi-threaded architecture for concurrent, real-time control.

text
main thread ──► web subsystem (libmicrohttpd + GnuTLS)
                 │
                 └── MHD-single — handles all HTTP requests on a
                                  single internal thread (lock-free handlers)

background pthreads:
├── sensor        — 20 Hz (ultrasonics) + 100 Hz (IMU) + speed integration
├── navigation    — 100 Hz (motor/LED control, pose integration, autonomous FSM)
├── map           — 10 Hz (2D grid update with obstacle projection)
└── audio         — 10 Hz (playback state + notification tones)

Inter-thread communication is done via seqlock-based snapshots, which allow lock-free reads from multiple threads and writes from a single thread per state slot. This design avoids shared critical sections between real-time threads.


4. Web Technology Stack

LayerComponentRole
HTTP(S) ServerlibmicrohttpdEmbedded server daemon to handle REST API requests.
Security LayerGnuTLSProvides TLS/SSL encryption for HTTPS communication.
AuthenticationAuthentication ModuleManages password hashing (SHA-256 with salt) and user storage.
Session ManagementSession ModuleManages in-memory session tokens with an inactivity timeout.
FrontendHTML, CSS, JSUser interface rendered in the browser, which consumes the robot's REST API.

5. Embedded Operating System (Yocto)

The operating system is a custom Linux image built with Yocto (version Scarthgap 5.0.15).

  • Base Image: core-image-minimal for a minimal resource footprint.
  • Target Machine: raspberrypi4.
  • Metadata Layers:
    • meta-raspberrypi: Base support for the Raspberry Pi.
    • meta-rpi4-config: Specific configuration for the RPi4 (e.g., WiFi).
    • meta-robot: Recipe to compile and install the robot application.
  • Init System: SysVinit, with a script to launch the robot application on boot.

6. Compilation and Deployment

The build process is done in two main phases: building the Yocto image and cross-compiling the application.

Building the Image and SDK

bitbake is used to build the operating system image and the cross-compilation SDK.

bash
# 1. Initialize the Yocto environment
source oe-init-build-env rpi4

# 2. Add the necessary layers
bitbake-layers add-layer ...

# 3. Build the image
bitbake core-image-minimal

# 4. Build the SDK
bitbake core-image-minimal -c populate_sdk

Cross-Compiling the Application

Once the SDK is installed, the robot application can be compiled.

bash
# 1. Load the SDK environment
. /opt/poky/5.0.15/environment-setup-cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi

# 2. Use CMake to compile the project
cd robot-6.0.1 && mkdir build && cd build
cmake ../
make && make install

For more details on the build process, see the Yocto build notes.


7. Dynamic Library API (librobot.so)

The core of the system is encapsulated in the librobot.so dynamic library, which provides a C API to control all the robot's hardware. Below is a summary of its functionality, based on the robot_test.c test program.

ModuleMain FunctionsDescription
Ventilatorventilator_on(), ventilator_off()Controls the vacuum motor.
LEDsled_blink(led_num, duration_ms)Allows individual blinking of the status LEDs.
Ultrasonic Sensorsultrasonic_get_distance_cm(sensor_num)Gets the distance in centimeters from one of the three HC-SR04 sensors.
Motorsmotor_set_speed(motor_num, speed), motor_set_direction(motor_num, dir), motor_stop(motor_num), motor_brake(motor_num)Provides full control over the wheel motors, including speed (0-100%), direction (forward, backward), stop, and active brake.
IMU (MPU-6050)mpu6050_read_accel(mpu, &ax, &ay, &az), mpu6050_read_gyro(mpu, &gx, &gy, &gz)Reads raw accelerometer and gyroscope data from the IMU sensor via the I2C bus.
Audioaudio_play_file(filepath), audio_pause(), audio_resume(), audio_stop(), audio_set_volume(vol_percent)Manages the playback of MP3 audio files, allowing pause, resume, stop, and volume adjustment.

8. Architecture Diagrams and Evidence

  • Architecture Diagrams: The original hardware and software architecture diagrams are located in docs/InitialPlanOfDevelopment.pdf. Although some details may have evolved, they provide a good overview of the conceptual design.

  • Compilation Evidence: Logs and artifacts demonstrating the cross-compilation process with Yocto are located in the yocto-image-recipies/evidence/ directory.

  • Project Progress Images: Below are some images that document the development and status of the project:

    Image of the initial prototype on the breadboard: Initial Prototype

    PCB design in KiCad: PCB in KiCad

    Assembled and running robot: Assembled Robot

Parts

42
QtyValueFootprintReferences
11220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3, R4, R7, R10, R11, R12, R13, R14, R15
7PC817Package_DIP:DIP-4_W7.62mmU1, U2, U3, U6, U7, U8, U9
4LEDLED_THT:LED_D5.0mmD1, D2, D3, D4
3HC-SR04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2, J3, J5
2Battery_CellTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalBT2, BT3
2Motor_DCTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalM1, M2
2SpeakerConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalLS1, LS2
1100Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR9
110KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6
14.7KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR5
15020 Centrifugal BlowerTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalM3
1AudioJack_TRRSConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1DLED_THT:LED_D5.0mmD5
1FDMS8350LET40Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalQ1
1L298NPackage_TO_SOT_THT:TO-220-15_P2.54x5.08mm_StaggerOdd_Lead4.58mm_VerticalU4
1MPU-6050Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalU10
1PAM8403DConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalU5
1Raspberry_Pi_4Connector_PinHeader_2.54mm:PinHeader_2x20_P2.54mm_VerticalJ1

Similar boards

  • 2 layers96.6 × 100 mmQuadRaptor, the printed circuit board in 3D

    QuadRaptor

    abdosalem490/QuadRaptor

    148 parts2MIT
  • 2 layers165.1 × 95.3 mmPico concole v2 daughter board, the printed circuit board in 3D

    Pico concole v2 daughter board

    Crem2y/pico-console-v2-pcb

    pico console v2 board (firmware : https://github.com/Crem2y/pico-console-v2)

    232 parts1MIT
  • 2 layers68.6 × 58.4 mmDC project, the printed circuit board in 3D

    DC project

    Mohamed-Adel-ELshiemy/PCB

    DC motor PCB Design with all files needed and make my foot print from scratch

    7 parts
  • 2 layers153.5 × 161.3 mmSPECTRODRIVE CİRCUİT, the printed circuit board in 3D

    SPECTRODRIVE CİRCUİT

    omersoner-dev/SPECTRODRIVE

    Light-following robot with PCB design, sensor integration, and Bluetooth control

    23 parts
  • 2 layersRobot Electronic Design, the printed circuit board in 3D

    Robot Electronic Design

    ErickMorales1312/Proyecto-IMTC

    IoT project for Autonomous Firefighting and Fire Detection System

    14 parts
  • 2 layersPlan, the printed circuit board in 3D

    Plan

    runariel/Fuzzy_Car

    Planing to make a self driving car by Arduino

    67 parts1
  • 2 layers43.2 × 17.8 mmBeaverworksGit, the printed circuit board in 3D

    BeaverworksGit

    AyaanZ1/beaverworksGit

    hello.

    9 parts
  • 4 layers53.3 × 59.6 mmProject-04-Predictive Maintenance system PCB, the printed circuit board in 3D

    Project-04-Predictive Maintenance system PCB

    Darshan7052006/PCB-Design-Projects

    Collection of PCB designs created using KiCad. Includes power supplies, embedded systems, sensor boards, and hardware projects with schematics, PCB layouts, manufacturing files, and documentation.

    32 parts

Questions

How big is the SchematicKiCadProyect PCB?

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

What parts does the SchematicKiCadProyect use?

42 parts, built around the L298N, PAM8403DR, MPU-6050 and HC-SR04. 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 SchematicKiCadProyect KiCad files?

From the dduarteCE/Robot-vacuum repository on GitHub, at the commit this page was made from: the board is docs/SchematicKiCadProyect/Schematic.kicad_pcb and its schematic docs/SchematicKiCadProyect/Schematic.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the SchematicKiCadProyect design in my own project?

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