- Version: 1.0
- Release Date: 01-22-2025
- Author: Syntax-Surfer
This project is an autonomous robot using the ESP32, three ultrasonic sensors, an L298N motor driver, and a servo motor. The robot detects obstacles, scans for the best path, and navigates accordingly.
✅ Real-time object detection using ultrasonic sensors (Front, Left, Right)
✅ Servo-based scanning to determine the best direction
✅ Smooth motor acceleration with PWM-based speed control
✅ Intelligent obstacle avoidance with decision-making logic
✅ PlatformIO Support for better development and debugging
- ESP32 Development Board
- L298N Motor Driver Module
- Ultrasonic Sensors (HC-SR04) ×3 (Front, Left, Right)
- Servo Motor (SG90 or MG995)
- Four DC Motors (For wheel movement)
- Power Supply (Li-Ion Battery)
- Jumper Wires & Breadboard
Install the following libraries in PlatformIO before uploading the code:
- ESP32Servo (For controlling the servo motor)
- NewPing (For ultrasonic sensor distance measurement)
- Front Sensor:
- TRIG Pin: GPIO 18
- ECHO Pin: GPIO 19
- Left Sensor:
- TRIG Pin: GPIO 15
- ECHO Pin: GPIO 4
- Right Sensor:
- TRIG Pin: GPIO 23
- ECHO Pin: GPIO 22
- Signal Pin: GPIO 13
- VCC Pin: 5V
- GND Pin: GND
- IN-1: GPIO 12
- IN-2: GPIO 14
- IN-3: GPIO 27
- IN-4: GPIO 26
- Set up PlatformIO in VS Code and create a new ESP32 project.
- Install required libraries (ESP32Servo & NewPing) in PlatformIO.
- Connect the components according to the wiring diagram.
- Compile and upload the code to the ESP32 via USB.
- Power the ESP32 and motor driver using an external power source.
- Observe the robot's movement and obstacle detection.
- OBJECT_THRESHOLD_FRONT, OBJECT_THRESHOLD_LEFT, OBJECT_THRESHOLD_RIGHT: Distance threshold (in cm) for object detection.
- OBJECT_DETECTION_DELAY: Delay after object detection (for better response time).
- LOOK_ANGLE: Maximum servo rotation angle.
- SPEED_INCREMENT: Motor speed ramp-up step (to prevent sudden jerks).
For further inquiries or collaboration, feel free to reach out:
- Email: [email protected]
- GitHub: Syntax-Surfer-1 🌐
📌 Feel free to fork the repository and contribute! 🚀