Final project

Presentation

An omnidirectional autonomous mobile robot will be developed, capable of detecting and avoiding obstacles. The system is designed to operate on solid, flat, and stable surfaces. Figure 1 presents the initial conceptual design of the autonomous mobile robot.

Main Design Sketch
Figure 1. Initial conceptual design of the omnidirectional autonomous mobile robot.

The motivation for this project arises from a strong personal interest in robotics, particularly in the field of space robotics. This work is conceived as an opportunity to consolidate fundamental knowledge in mechanics, electronics, and programming, as well as to apply these skills in the design and construction of a functional autonomous vehicle.

The robot will be equipped with four mecanum wheels, which enable movement in any direction depending on the motion applied to each individual wheel. These wheels will be coupled to TT DC motors and complemented with sensor systems located on the lateral, frontal, and rear sections of the autonomous vehicle. Figure 2 shows the overall robot design with the main components integrated. Figure 3 presents a top view of the robot chassis, while Figure 4 illustrates an exploded view highlighting the central components of the system.

Main Design Sketch
Figure 2. Autonomous mobile robot with integrated mechanical and electronic components.
Main Design Sketch
Figure 3. Top view of the robot chassis.
Main Design Sketch
Figure 4. Exploded view of the autonomous mobile robot showing the main components.

Finally, Figure 5 shows the operation of the robot's movement according to the type of motion imparted to its wheels. This information was obtained from Motion Dynamics.

Main Design Sketch
Figure 5. Operation of the robot's movement according to the type of motion imparted to its wheels.

Preliminary Bill of Materials

I wrote a general schedule of activities to organize myself better

ComponentQuantityCost (MXN)Application
TT DC Motor4$59Robot locomotion
L298N H-Bridge Motor Driver1$90Control of motor speed and rotation direction
Rotary Encoders4$43Controlled measurement of vehicle motion
ESP32 DevKit V11$124Main microcontroller
HC-SR04 Ultrasonic Sensor3$53Obstacle detection
LM7805 Voltage Regulator1$48Voltage regulation for motors and sensors
AMS1117-3.3 Voltage Regulator1$12Voltage regulation for sensors
Male/Female Headers1 set$350Electrical connections
Dupont Cables (MM, MF, FF)Various$59Electrical connections
Rechargeable Battery (2500 mAh)2$189Power supply
Power Switch1$29System power on/off
Double-sided Copper Board10x10cm$392PCB fabrication
SMD Resistors 0805Various$0.24PCB components
SMD Capacitors 0805Various$129PCB components

One of the main challenges anticipated during the development of this project is the programming and electronic design of the robot. This is primarily due to the fact that my academic background is not directly focused on these areas, resulting in limited prior experience with the programming languages, development environments, and electronic architectures required for the system. Nevertheless, this project represents an ideal opportunity to acquire and strengthen skills that are not typically addressed within my field of study, contributing significantly to my professional development.

I wrote a general schedule of activities to organize myself better

Fablab WeekMain TasksEstimated Time
Week 1. Project management
  • Project description
  • Creation of the Wheel of Achievements
  • Establishment of the activity schedule
  • Identification of fundamental concepts
  • Conceptual sketching
  • Identification of required project components
  • Website design and programming
2-3 days
Week 2. Computer Aided Design
  • Design of the robot chassis using CAD software
  • Design of required mechanical parts
  • Design of sensor supports
2-3 days
Week 3. Computer Controlled Cutting
  • Cutting of the chassis and necessary components for robot assembly
  • Implementation of adaptations if required
2-3 days
Week 4. Electronic Production
  • Design and fabrication of a PCB to integrate the ESP32 microcontroller, sensor module sockets, and motor connectors
3-5 days
Week 5. 3D Scanning and printing
  • 3D printing of an adjustable support for the MQ-135 sensor
  • 3D printing of a PCB enclosure
2-3 days
Week 6. Embedded Programming
  • Development of a basic motion control program including motor control, sensor data acquisition, and obstacle avoidance logic
3-5 days
Week 7. Computer Controlled Machining
  • Refinement of mechanical components and chassis
3-4 days
Week 8. Electronics Design
  • Development of a basic electronic schematic
  • PCB design including additional protections and status LEDs
3-4 days
Week 9. Output Devices
  • Motor control implementation
2-3 days
Week 10. Mechanical Design
  • Design of a basic drivetrain system
  • Definition of guides for rapid assembly
  • Implementation of active or passive ventilation
2-3 days
Week 11. Input Devices
  • Integration of sensor systems
  • Functional testing and validation of sensor operation
3-4 days
Week 12. Molding and Casting
  • Fabrication of a basic protective enclosure
3-4 days
Week 13. Embedded Networking and Communications
  • Establishment of basic WiFi communication
4-5 days
Week 14. Interface and Application Programming
  • Development of a web-based interface
4-5 days

Mecanum wheels have free rollers positioned at 45° relative to the wheel axis. Independently controlling each of these wheels allows different rotation combinations, enabling the robot to move along the X and Y axes, rotate in place, and perform any simultaneous combination of these movements.

Based on the initial design, a potential project extension is proposed, focused on the development of a gas-mapping robot operating within a controlled environment. This extension is conceived as an enhancement and expansion of the base system, with potential applications in environmental monitoring and the analysis of current real-world problems.

Design for the Gas-Mapping Robot

The gas-mapping robot will be based on the initial autonomous vehicle design, with modifications to integrate additional sensors and functionalities. The main components of the system will include:

  • Chassis: Adapted to accommodate additional sensors and ensure stability during operation.
  • Microcontroller: ESP32 or similar, capable of handling multiple sensor inputs and data processing.
  • Sensors: Integration of gas sensors such as MQ-135 (smoke), SGP30 (CO₂/VOCs), and DHT22 (temperature and humidity) for comprehensive environmental monitoring.
  • Data Storage: Implementation of local data storage using an SD card module, with potential WiFi connectivity for real-time data transmission.
  • Power Supply: Enhanced battery system to support additional components and ensure extended operation time.
Design Proposal for Gas-Mapping Robot Design Proposal for Gas-Mapping Robot

Schedule for Future Work: Robot Upgrade to Gas-Mapping System

Fablab WeekMain TasksEstimated Time
Week 1. Project management
  • Definition of project extension proposal
1 day
Week 2. Computer Aided Design
  • Design of a chassis with modular slots for adding or removing components
2-3 days
Week 3. Computer Controlled Cutting
  • Exploration of alternative materials such as MDF and acrylic
  • Design of a logo or project name on structural materials
1-2 days
Week 4. Electronic Production
  • Design and fabrication of a PCB integrating the ESP32 microcontroller, power regulators, and RGB status LEDs
4-5 days
Week 5. 3D Scanning and printing
  • Design and printing of TPU shock absorbers and a sealed enclosure
2-3 days
Week 6. Embedded Programming
  • Implementation of an exploration algorithm
  • Programming of integrated sensor data acquisition
  • Data storage programming in CSV format via SD card or WiFi
5-6 days
Week 7. Computer Controlled Machining
  • Milling of an aluminum base plate for structural support, weight distribution, and heat dissipation
2-3 days
Week 8. Electronics Design
  • Design of a circuit including battery backup port, overvoltage protection, and real-time power consumption monitoring
4-6 days
Week 9. Output Devices
  • Implementation of a telemetry system using an OLED display to show battery level, operating mode, and system status
3-5 days
Week 10. Mechanical Design
  • Improvement of the traction system using high-grip wheels
  • Implementation of a self-leveling mechanism
3-5 days
Week 11. Input Devices
  • Integration of MQ-135 (smoke), SGP30 (CO₂/VOCs), and DHT22 (temperature and humidity) sensors
  • Data collection through a training mode
3-5 days
Week 12. Molding and Casting
  • Fabrication of protective enclosures for components
2-5 days
Week 13. Embedded Networking and Communications
  • Creation of a local SD card backup database
  • Transfer of datasets to a PC for offline processing
3-7 days
Week 14. Interface and Application Programming
  • Development of a 3D heat map
  • Dashboard creation with real-time graphs
  • Prediction of areas with high smoke concentration within 5 to 10 minutes
  • Display of model confidence
4-5 days

Bill of Materials for Future Work

ComponentQuantityCost (MXN)Application
MQ-135 Gas Sensor1$53Gas and smoke detection
SGP30 Sensor1$199CO2 and VOC detection
DHT22 Sensor1$135Temperature and humidity measurement
SD Card Module1$49Local data storage
OLED Display 0.96"3$103Visualization of robot data
Motor Rotary Encoders2$165Estimation of traveled distance
SD Card Reader Module1$245Local data storage
MicroSD Card 16 GB1$57Data storage
Acrylic SheetsVarious$91Enclosure for controlled environment

Spiral development

As previously discussed, this autonomous mobile robot presents multiple opportunities for future improvement and expansion. Based on this perspective, a Spiral Development is proposed as a visual tool to outline potential milestones and long term development goals, assuming the successful completion of the core project objectives.

Spiral Development

Project Progress

As of the submission of this report, the project is in the early stages of development.

3D Modeling, Printing and Laser cutting

CAD Design

For the robot design, I used SolidWorks. This program allowed me to create the main parts of the car. These consisted of:

  1. Chassis
  2. Side supports for the motors
  3. Top cover

In this way, based on the approximate dimensions of the boards and the size of the motors that would be used, the system was designed in parts and later assembled. The tools used were learned during week 2. From this, the following process was carried out:

  1. Base: The estimated spaces that would be used are placed.
  2. Side design: The side supports are built considering the size of the motors, as well as spaces for screws and fixing the system.
  3. Stepper motor design: The stepper motor is designed to provide the necessary torque and speed for the robot's movement.
  4. Mecanum wheel design: The mecanum wheels are designed to allow the robot to move in any direction.
  5. Top cover design: The top cover is designed to protect the internal components of the robot.

Assembly

Finally, based on the designed parts, the following result was obtained:

This design allowed me to create my files in DXF format for the robot base and STL format for the side and top parts of the car, this being the first part that makes up the project from the design area.

Piece Dimension Testing

Side Supports

To carry out the tests of the car chassis, I first sent the motor bases or supports for 3D printing. In this way, the following result was obtained:

As can be seen, the motors fit very tightly, therefore it was decided to increase the spacing size between the walls, as well as the hole space for the motor output, and reduce the thickness of the base by half (also considering the size of the wheels).

3D printing process

After validating the dimensions and fit of the designed parts through several tests, I proceeded to manufacture all the components using a PRUSA 3D printer. The following printing parameters were used:

My prints required approximately six hours in total to complete, as the project consisted of multiple components and several of them occupied a significant portion of the printer's build volume. Once all the pieces were printed, they were inspected to verify dimensional accuracy and proper assembly with the rest of the system.

Laser Cutting

The chassis required a rigid base capable of supporting the electronic and mechanical components of the robot. After evaluating different options, I selected MDF as the construction material because it is readily available, cost-effective, and provides sufficient structural rigidity for the application.

Additionally, laser cutting allowed me to manufacture the chassis quickly and accurately, ensuring precise dimensions and repeatable results. This process was particularly useful because it enabled the fabrication of clean and consistent cuts while reducing manufacturing time.

Final results

Here is my final result

Spiral Development

Embedded Systems

PCB Design – Planning

A total of three PCB designs will be made.

Brain Board Design

The XIAO ESP32C6 will be used as the brain of the project. Connected to it will be the VL53L0X sensors, WiFi for XBOX controller input, QR code processing, navigation logic, and the transmission of speed or direction commands. This board will be manufactured once.

Components
  • Connected sensors (3× VL53L0X)
  • QR reader (GM65) – subject to change
  • 4.7kΩ pull-up resistors on SDA and SCL
  • 10kΩ pull-up resistors on each XSHUT
  • 100nF capacitors (3 per sensor)
  • 10µF capacitor (to stabilize 3.3V)
PINFunctionConnected to
D4 (SDA)I2C dataSDA of all 3 VL53L0X + 4.7kΩ pull-up to 3.3V
D5 (SCL)I2C clockSCL of all 3 VL53L0X + 4.7kΩ pull-up to 3.3V
D0XSHUT sensor 1XSHUT VL53L0X #1
D1XSHUT sensor 2XSHUT VL53L0X #2
D2XSHUT sensor 3XSHUT VL53L0X #3
D6 (TX)UART TXRX of GM65
D7 (RX)UART RXTX of GM65
D8 (TX2)UART toward RP2350RX of RP2350
D9 (RX2)UART from RP2350TX of RP2350
3.3VPower supplyVIN of all 3 VL53L0X + GM65 + pull-ups
GNDGroundGND of everything

Motor Board Design

A board based on the XIAO RP2350 will be created to connect the motors and receive commands from the ESP32C6 to independently control the four motors. This board will be manufactured once.

  • 100µF and 100nF capacitors in parallel on the motor power supply.
  • 4-output connector toward the 4 driver boards.
PINFunctionConnected to
D0PWM motor 1IN1 driver board #1
D1DIR motor 1IN2 driver board #1
D2PWM motor 2IN1 driver board #2
D3DIR motor 2IN2 driver board #2
D4PWM motor 3IN1 driver board #3
D5DIR motor 3IN2 driver board #3
D6PWM motor 4IN1 driver board #4
D7DIR motor 4IN2 driver board #4
D8 (TX)UART from ESP32C6TX of ESP32C6
GNDCommon groundGND of ESP32C6

H-Bridge Driver Board Design

The DRV8251A driver will be used. This board will be manufactured 4 times, one per motor.

  • DRV8251A
  • 100nF capacitor between VCC and GND
  • 10µF capacitor on VM (motor power supply)
DRV8251A PinConnected to
IN1PWM from RP2350
IN2DIR from RP2350
OUT1Motor terminal A
OUT2Motor terminal B
VMMotor power supply (3V–6V)
GNDCommon GND
nSLEEP3.3V (always active)

The development of the motor control system represented one of the main challenges of this project. During the initial stages, I experienced several issues related to the electronic design and component selection.

My original intention was to use the DRV8251A motor driver. However, after reviewing the electrical requirements of the motors, I determined that their operating voltage was below the minimum voltage required by the DRV8251A to function correctly. Because of this limitation, I selected the TB67H451AFNG motor driver instead.

To achieve independent control of each motor, a dedicated TB67H451AFNG was used. As an additional precaution during assembly, electrical insulating tape was placed underneath each IC to prevent accidental conduction paths or undesired electrical contacts with the supporting surface. After assembly, each driver was tested individually to verify proper operation before integrating it into the complete system.

Design with Altium

This was my procedure for creating my boards. For this, Altium was used and the previously established criteria in the tables were followed, where my schematics were the following:

Brain Board Schematic Process
Motor Board Schematic

PCB Manufacturing

PCB Designs

Regarding the manufacturing of my boards, once the designs were obtained, exactly the same procedure from week 8 was followed. The same parameters were used for each of the tools. In this way, the three main boards were successfully manufactured.

The procedure inside the Monofab:

Finally, once the boards were obtained, the remaining components were soldered, where the result was the following:

Finally, this was the final result:

Inputs and Outputs

VL53L0X Sensor Testing – Individual and Combined

There are different types of distance-measuring sensors; among them is the VL53L0X. First, it was necessary to test a single sensor. For this purpose, the following code was used:

#include <Wire.h>
#include <VL53L0X.h>

#define SENSOR_SDA  6
#define SENSOR_SCL  7
#define XSHUT_PIN   2

VL53L0X sensor;

void setup() {
  Serial.begin(115200);
  Wire1.setSDA(SENSOR_SDA);
  Wire1.setSCL(SENSOR_SCL);
  Wire1.begin();
  pinMode(XSHUT_PIN, OUTPUT);
  digitalWrite(XSHUT_PIN, LOW);
  delay(10);
  digitalWrite(XSHUT_PIN, HIGH);
  delay(50);
  sensor.init(true);
  sensor.setTimeout(500);
  sensor.startContinuous();
  Serial.println("Sensor ready!");
}

void loop() {
  int distance = sensor.readRangeContinuousMillimeters();
  if (sensor.timeoutOccurred()) {
    Serial.println("Error: Timeout occurred");
  } else {
    Serial.print("Distance: ");
    Serial.print(distance);
    Serial.println(" mm");
  }
  delay(100);
}

Motion Programming

For the wheel programming, research was first conducted on the basic movements possible with the purchased wheel type. Based on these observed movements, a code was written to instruct the robot to perform the following maneuvers: forward, backward, left and right lateral translation, clockwise and counterclockwise rotation, full 360° clockwise and counterclockwise turns, diagonal forward-left, forward-right, backward-left, backward-right, and pivoting around both the front and rear axles.

The programming structure is as follows: first, a single motor is controlled; then multiple motors are combined; next, advanced speed calculations are performed; and finally, movements are executed. The first developed code is:

Here you can download the Brain Board code in .zip

This code was loaded into Arduino following the steps learned in the corresponding week, which enabled the observation of the robot's movements.

Robot Kinematics

It is important to understand the kinematic model of the robot. This robot uses standard inverse kinematics. The table below shows the movement direction of each wheel type and the combined motion they produce. Each motor receives a signed value: positive means the wheel spins forward, negative means backward, and 0 means the motor is stopped.

MovementFL (Front Left)FR (Front Right)RL (Rear Left)RR (Rear Right)
Forward++++
Backward----
Left (lateral)-++-
Right (lateral)+--+
Clockwise rotation+-+-
Counterclockwise rotation-+-+
Diagonal forward-left0++0
Diagonal forward-right+00+
Diagonal backward-left-00-
Diagonal backward-right0--0
Front pivot clockwiseGeneral formula scaled with dynamic speeds
Front pivot counterclockwiseGeneral formula scaled with dynamic speeds

The following obstacle scenarios and corresponding responses are proposed:

Active SensorsInterpretationAction
NoneClear pathMove forward
CenterObstacle aheadTurn toward the side with the greater distance to the obstacle
Center + LeftFront and left blockedLateral translation to the right
Center + RightFront and right blockedLateral translation to the left
Center + Left + RightCorridor blockedRotate in place until clear
Left onlyObstacle on the leftLateral translation to the right
Right onlyObstacle on the rightLateral translation to the left

For the integration of three VL53L0X sensors, the proposed program you can find them here: .zip

Rear Wheel Connection Issue and ESP32C6 UART Overheating Investigation

During system integration, I encountered a problem related to the rear wheel movement. To identify the source of the issue, I performed a systematic debugging process in which each subsystem was tested independently.

After verifying the motors, drivers, and software behavior, I concluded that the fabricated PCB contained an unreliable connection between the board and the microcontroller. As a consequence, movement commands were not being transmitted correctly.

To solve this problem, I refabricated the PCB and introduced a minor modification to the original design. The only change consisted of replacing the lower-right pin header arrangement so that it matched the configuration used throughout the rest of the board.

At the same time, I investigated an overheating issue involving the UART communication wiring between the XIAO RP2350 and the XIAO ESP32C6. To isolate the cause, I tested every UART connection individually and then verified communication using dedicated Arduino test programs.

The following code was uploaded to the RP2350:


#define UART_BAUD 115200

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10);
  Serial1.begin(UART_BAUD);
  delay(500);
  Serial.println("RP2350 listo — esperando PINGs...");
}

void loop() {
  if (Serial1.available()) {
    String msg = Serial1.readStringUntil('\n');
    msg.trim();

    Serial.printf("Recibido: '%s'\n", msg.c_str());

    if (msg == "PING") {
      Serial1.println("PONG");
      Serial.println("Respondido: PONG");
    } else {
      Serial.printf("Mensaje desconocido: '%s'\n", msg.c_str());
    }
  }
}
   
        

The following code was uploaded to the ESP32C6:


#define UART_BAUD 115200

#define UART_TX D6
#define UART_RX D7

uint8_t contador = 0;

void setup() {
  Serial.begin(115200);
  Serial1.begin(UART_BAUD, SERIAL_8N1, UART_RX, UART_TX);
  delay(500);
  Serial.println("ESP32C6 listoenviando PINGs...");
}

void loop() {
  Serial1.println("PING");
  Serial.printf("[%d] Enviado: PING\n", contador++);

  unsigned long t = millis();
  while (millis() - t < 500) {
    if (Serial1.available()) {
      String resp = Serial1.readStringUntil('\n');
      resp.trim();
      if (resp == "PONG") {
        Serial.println("PONG");
      } else {
        Serial.printf("Respuesta inesperada: '%s'\n", resp.c_str());
      }
      break;
    }
  }

  if (millis() - t >= 500) {
    Serial.println("Sin respuesta");
  }

  delay(1000);
}

   
        

Once UART communication was verified, I continued testing the system to determine whether the overheating issue was related to power distribution. The boards were connected together with the motor drivers while keeping the motors disabled. Under these conditions, none of the ICs exhibited abnormal temperature increases.

After further investigation, I determined that the root cause was an incorrect pin connection. Once the new PCB arrived and the connections were corrected, all four wheels responded properly and the robot was able to move as expected.

With the hardware issues resolved, I proceeded to upload the final firmware to both boards. UART communication was used to coordinate the behavior required for obstacle detection and autonomous reactions. The software architecture was distributed between the following boards:

  • XIAO ESP32C6
  • XIAO RP2350

As an additional feature, I implemented several demonstration routines to showcase the omnidirectional movement capabilities of the platform. These demonstrations were executed directly from the RP2350.

After validating the sensor readings using objects positioned at different distances, I confirmed that the measured values were consistent with the robot's reactions. Once the sensing and response system was operating reliably, I performed practical tests on different surfaces to evaluate overall system performance.

Finally, I assembled the external structure and permanently secured the motors in place. Screws were used to fasten each component, improving mechanical stability and ensuring reliable operation during movement.

Interface and Application Programming

The original objective for the user interface was to control the robot using an Xbox controller connected through Bluetooth. However, the specific controller available for testing could not be updated to a firmware version compatible with the libraries required for communication with the ESP32 platform.

Because of this limitation, I decided to design and develop a custom digital controller using a XIAO ESP32C6.

This decision was influenced by previous experience acquired during an earlier Fab Academy assignment, where I had already experimented with wireless communication interfaces. Since this type of development is particularly interesting to me, creating a dedicated controller for the omnidirectional robot became an exciting extension of the project.

Considering that the primary objective of the robot was obstacle avoidance, I implemented two different operating modes.

The first mode allows the user to manually control the vehicle through directional commands. In this configuration, the robot behaves as a conventional remote-controlled platform.

Main Design Sketch

The second mode enables autonomous obstacle avoidance. When activated, manual control is automatically disabled and the robot takes control of its own navigation by using data acquired from the distance sensors to avoid collisions.

The first stage of development consisted of creating the graphical controller interface without integrating any functional logic. This allowed me to verify the layout and communication structure independently from the vehicle control algorithms.

Here is the link for the programming of the html in the XIAO ESP32C6 .zip

Once the interface was operating correctly, I used artificial intelligence as a development support tool. Rather than generating the project from scratch, AI was employed to help organize the codebase and ensure that previously implemented movement functions remained intact while integrating new features.

Using Claude, I created a prompt requesting the integration of the different software modules developed throughout the project while preserving functionality, structure, and readability. The resulting implementation was the following:

"I am carrying out an omnidirectional robot project. I use two microcontrollers. The first one is a XIAO ESP32C6 that creates a web interface where a controller is generated to operate the omnidirectional robot. It also reads data from VL53L0X sensors and transmits these instructions through UART communication to my second microcontroller, a XIAO RP2350. I have the following codes. I need you to integrate the ESP32C6 web interface code with the instructions that it previously had so that they are consistent with each other. Likewise, I would like you to review and correct (if necessary) the XIAO RP2350 code so that it matches the information being sent from the ESP32."

Of course, the codes explained previously were copied and pasted.

This was the final result:.zip