About my project
This project involves the design and manufacture of a surveillance and security robot. I look forward to exploring different programs and tools that will help me achieve my goals. Manufactured using 3D printing, it is based on the design of a Mars rover configured with six tires. The robot incorporates a dual security camera and is controlled using Wi-Fi communication. The chassis design was achieved using generative design techniques in Autodesk Inventor, inspired by the bone structure of an armadillo, which has allowed for a significant reduction in volume and weight compared to traditional designs. Furthermore, the platform is built on a Xiao ESP32 C3 microcontroller module, using motor drivers and ultrasonic sensors. This development seeks to combine operational efficiency, versatile mobility, and advanced aerodynamics, ideal for security tasks and autonomous or semi-autonomous patrol. I look forward to exploring different programs and tools that will help me achieve my goals.
Identification of the problem
Insecurity in Peru has become a worrying issue, affecting the lives of citizens and damaging the country's economy. From common robbery to extortion and organized crime, crime creates a widespread sense of fear that affects businesses and, therefore, investments.
The high level of insecurity generated by violence and crime hinders economic growth and poverty reduction. Insecurity deters foreign and domestic investment, limits economic growth, and increases businesses' operating costs due to additional security measures.
The structure of the robot
The robot structure combines the all-terrain mobility principles of space rovers with the structural efficiency of natural organisms, thus achieving a 3D design that is not only robust and adaptable, but also aerodynamic. In this research, Autodesk Inventor software is used with generative design tools to optimize the weight and strength of the structure.

Materials and methods
This section describes the design and manufacturing process of the police robot, divided into three key components: the mechanical part, the electronic part and the computer part. Each of these areas has been developed using specific tools and advanced design techniques, integrating biomimicry principles and remote control technologies.

Activity schedule
The schedule of activities is detailed below.
Project design
1.-Mechanical design
The robot's structure combines the all-terrain mobility principles of space rovers with the structural efficiency of natural organisms, achieving a design that is not only robust and adaptable, but also aerodynamic. In this research, Autodesk Inventor software with generative design tools is used to optimize the structure's weight and strength.
1.1 Preliminary design


1.2 Generative design
Continuing with the "Inventor" software, we'll use one of its most advanced tools for structural mechanical design. Generative design is a technique that uses artificial intelligence and algorithms to create multiple design solutions based on certain parameters such as weight, strength, or cost.


In our case, to use this tool we will have our 3D model open and select the following icon:
It will load the following environment, which is just as intuitive as the other environments. In this environment, we must assign the work areas to which it will be subjected, for example: gravity, weight, torque, pressure, etc.


Once the working parameters have been set, we will proceed to load the generative design calculation:

obtaining the preliminary model

First generative isometric chassis design.

First generative design, chassis plan view.

First generative design, bottom view of the chassis.
1.3 Biomimicry design
The design process focused on reducing the chassis's weight and volume through the application of biomimicry, i.e., imitating solutions that already exist in nature. In this case, the shape and organization of the armadillo's bone structure were studied in detail. This animal's natural armor allows it to withstand impacts while remaining agile.



main structure

preliminary robot design
2.- 3D printing of parts
For printing the parts, we have exported the generated files in STL format. For printing small parts, the Bambu Lab printer was used, and for larger parts, the Proxy printer was used.




Assembly of mechanical components:




3.-Electronic Integration
To perform electronic integration, we must make a list of the components we will use for the project:
- XIAO ESP32-C3
- ROB-14450 – Motor driver
- L7805CV – Voltage regulator
- Polarized capacitor
- Ultrasonic sensor
- Servomotor
- WS2812B LED strip
3.1 schematic diagram

3.2 PCB layout design

3.2 3D visualization

3.3 Component layout
4.-Programming: Interface (web page)
To begin programming the Xiaoesp32-c3 module, we'll start with the interface, as it will allow us to view all the robot's functionality. We'll use the Google Sites tool:

We will upload the HTML Code, once the Code is inserted we click on the following:

we will have a preview of the interface

4.-Using the Arduino IDE
To perform the readings and functional tests, I used the Arduino IDE with the XIAO ESP32-C3.
// Motor control with Xiao ESP32-C3 and L298N using Bluetooth Low Energy (BLE)
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// Pin definition for the L298N controller
#define IN1 6 // Motor 1 - Dirección
#define IN2 7 // Motor 1 - Dirección
#define IN3 8 // Motor 2 - Dirección
#define IN4 9 // Motor 2 - Dirección
#define ENA 5 // Motor 1 - Velocidad (PWM)
#define ENB 10 // Motor 2 - Velocidad (PWM)
// Bluetooth Low Energy (BLE) Setup
BLEServer *pServer = NULL;
BLECharacteristic *pCharacteristic = NULL;
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
void setup() {
Serial.begin(115200);
// Output pin configuration for the motor
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(ENB, OUTPUT);
Stop(); // Ensure the motors are stopped at startup
// Configuración del módulo BLE
BLEDevice::init("Rover ESP32C3");
pServer = BLEDevice::createServer();
BLEService *pService = pServer->createService(SERVICE_UUID);
pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_WRITE);
pService->start();
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
pAdvertising->start();
}
void loop() {
// Check if a command has been received via BLE
if (pCharacteristic->getValue().length() > 0) {
String command = pCharacteristic->getValue().c_str();
Serial.println("Recibido: " + command);
// Interpretar el comando recibido
if (command == "F") forward(); // Avanzar
else if (command == "B") backward(); // Retroceder
else if (command == "L") left(); // Girar izquierda
else if (command == "R") right(); // Girar derecha
else if (command == "S") Stop(); // Detener motores
}
}
// Function to move the rover forward
void forward() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
analogWrite(ENA, 200); // Control de velocidad con PWM
analogWrite(ENB, 200);
}
// Function to move the rover backward
void backward() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
analogWrite(ENA, 200);
analogWrite(ENB, 200);
}
// Turn left function
void left() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
// Turn right function
void right() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
// Function to stop the motors
void Stop() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}