This repository documents the development of a line-following robot based on an STM32 microcontroller.
The project integrates embedded control, analog sensing, and a graphical desktop interface for sensor calibration and monitoring.
Line-Following.Robot.mp4
To implement an autonomous system capable of following a black line on a white background using reflective sensors and an embedded control algorithm. The approach includes a calibration phase assisted by a desktop interface built with Qt, which allows users to verify sensor functionality and power supply stability.
- Reading reflective sensors via ADC
- Calibration of maximum and minimum values for each sensor
- Line error calculation and control logic
- Motor control using PWM signals
- Structured serial communication protocol
- Periodic transmission of data to the PC
- Automatic detection and connection to serial ports
- Real-time reading of sensor values
- Display of detected minimum and maximum values
- Graphical indicators of signal intensity
- Monitoring of system voltage
Communication between the microcontroller and the PC is handled through a structured packet format including delimiters, size, data, and checksum verification.
Packet structure (bytes):
[START][SIZE][DATA][CHECKSUM][END]
Types of data transmitted:
- Sensor calibration values
- Real-time sensor readings
- System voltage level
- Message type identified via control field
- Education in mobile robotics and embedded systems
- Prototyping of basic autonomous vehicles
- Testing of control algorithms (P, PD, PID)
- STM32 microcontroller board (e.g., F401 series or similar)
- Reflective sensor module
- Motor driver and geared motors
- Stable power supply
- Integration of PID control for smoother trajectories
- Sensor session recording in CSV format
- Real-time visualization with plots or graphs
- Wireless data transmission (Bluetooth, WiFi)
- Logic for handling curves or intersections
Josh Sebastián López Murcia
Julián Humberto Lozada Silva