Skip to main content
Version: ACS CC

Mobile Drawing Robot with Automatic Canvas Calibration

A mobile drawing robot that reproduces digital images on a physical canvas using automatic border detection.

info

Author: Denis-Dumitru Sarca
Github Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-Denis-bit

Description

This project consists of a mobile robot capable of drawing digital images on a physical surface. The robot receives a processed drawing path from a PC and follows the generated trajectory using a differential drive system. The drawing area is delimited using a black border placed around the canvas. The robot uses IR reflective sensors to detect this border and estimate the available drawing surface. Based on the detected canvas dimensions, the input image is scaled so that it fits inside the physical workspace. The robot uses two powered wheels for movement and a third caster wheel for mechanical support. A servo motor controls the pen mechanism, allowing the system to lift or lower the pen while following the drawing path.

Motivation

Thought it would be a fun way to start my journey in embedded development. I also find it useful in different scenarios, since it has the automatic drawing surface detection.

Architecture

The system is divided into two main parts: the PC application and the embedded firmware running on the STM32 board. The PC application is responsible for image processing. It loads the input image, converts it into a simplified drawing path and scales the result according to the canvas dimensions detected by the robot. The generated path is then sent to the microcontroller through a USB serial connection. The STM32 Nucleo-U545RE-Q board receives movement commands and controls the hardware modules. It drives the two DC motors through a motor driver, reads encoder feedback for position estimation, reads the IR sensors for black border detection and controls the servo motor used for lifting and lowering the pen.

MAIN ARCHITECTURE COMPONENTS: PC image processing module USB serial communication module STM32 command parser motor control module encoder feedback module encoder feedback module canvas calibration module pen control module

Log

Hardware

STM32 Nucleo-U545RE-Q 2 sau 4 motoare DC cu encodere driver motoare roti omnidirectionale roata caster servo pentru marker senzori IR pentru detectarea marginii canvasului baterie convertor buck

Schematics

Schematics

Bill of Materials

| Device | Used for tension adjustment | [price](7 ron) | | Device | The motors | [price](46 ron) | | Device | Motor driver | [price](47 ron) | | Device | Servomotor | [price](13 ron) | | Device | IR sensor | [price](12 ron) | | Device | sasiu + roti | [price](41 ron) |

Software

LibraryDescriptionUsage
embassy-stm32STM32 hardware abstraction layer from the Embassy frameworkUsed for GPIO, UART, PWM, timers and ADC configuration
embassy-executorAsync executor for embedded Rust applicationsUsed for running concurrent firmware tasks
embassy-timeTime utilities for embedded async applicationsUsed for delays, timeouts and movement timing
embedded-halStandard hardware abstraction traits for embedded systemsUsed to keep hardware interfaces modular
defmtLightweight logging framework for embedded systemsUsed for debugging firmware behavior
panic-probePanic handler for embedded RustUsed for debugging runtime errors
heaplessFixed-capacity data structures without dynamic allocationUsed for command buffers and path data
serdeSerialization frameworkUsed for encoding and decoding commands
postcardCompact binary serialization format for embedded systemsUsed for sending drawing commands from the PC to the STM32
imageImage processing library for RustUsed on the PC side for loading and processing input images
serialportCross-platform serial communication libraryUsed on the PC side for USB serial communication with the robot
clapCommand-line argument parserUsed on the PC side for configuring image input and serial port

https://www.youtube.com/watch?v=_SbTXNRn7qA