Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-CAM Controlled Robotic Car with Ultrasonic Obstacle Avoidance and IR Sensors

Image of ESP32-CAM Controlled Robotic Car with Ultrasonic Obstacle Avoidance and IR Sensors

Circuit Documentation

Summary

The circuit in question appears to be a complex system designed to incorporate various sensors, motor drivers, a microcontroller, and power regulation modules. The primary controller is an ESP32-WROOM-32UE microcontroller, which interfaces with an ESP32-CAM, multiple HC-SR04 ultrasonic sensors, IR sensors, servo motors, and L298N DC motor drivers to control geared motors. The system is powered by a 12V 7Ah battery, and voltage regulation is provided by multiple 48V to 5V converters. Rocker switches are used to control power flow to different parts of the circuit.

Component List

Power Components

  • 12v 7ah Battery: Provides the main power source for the circuit.
  • 48v to 5v Converters: Step down the voltage from 48V to 5V to power various low-voltage components.

Sensors

  • HC-SR04 Ultrasonic Sensors: Used for distance measurement.
  • IR Sensors: Detect obstacles and possibly used for line tracking or proximity detection.

Actuators

  • Servo Motors: Control the movement of certain parts, possibly for steering or camera movement.
  • 12V Geared Motors: Provide the driving force for movement, likely in a robotic vehicle.

Control and Drive

  • L298N DC Motor Drivers: Interface between the microcontroller and the motors to control the speed and direction of the motors.
  • Rocker Switches: Manually control the power supply to the circuit or sections of the circuit.

Microcontrollers

  • ESP32-WROOM-32UE: The main processing unit that controls the circuit's behavior, interfaces with sensors, and drives actuators.
  • ESP32-CAM: A camera module that likely provides vision capabilities for the system.

Wiring Details

Power Distribution

  • 12v 7ah Battery is connected to the Rocker Switches to control the power supply.
  • 48v to 5v Converters are wired to the Rocker Switches and provide 5V power to the sensors, servo motors, and ESP32-CAM.

Sensor Connections

  • HC-SR04 Ultrasonic Sensors are powered by the 5V output from the converters and have their TRIG and ECHO pins connected to the ESP32-WROOM-32UE for distance measurement.
  • IR Sensors are also powered by the 5V output and have their output pins connected to the ESP32-WROOM-32UE for obstacle detection.

Actuator Connections

  • Servo Motors are powered by the 5V output and receive PWM control signals from the ESP32-CAM.
  • 12V Geared Motors are connected to the L298N DC Motor Drivers, which are in turn controlled by the ESP32-WROOM-32UE and ESP32-CAM.

Microcontroller Connections

  • ESP32-WROOM-32UE is the central controller and is connected to sensors, motor drivers, and the ESP32-CAM for data exchange and control signals.
  • ESP32-CAM is powered by the 5V output and is connected to the ESP32-WROOM-32UE for communication and control.

Documented Code

The code provided is for the ESP32-CAM microcontroller and is written in C++ for the Arduino platform. The code includes the following functionalities:

  • Configuration and initialization of the camera module.
  • Setup of a web server to stream video and receive commands.
  • Control of two servo motors for pan and tilt mechanisms.
  • PWM control of onboard LED and DC motors.
  • Handling of HTTP GET requests to control the robot's movements and camera position.
  • Connection to a Wi-Fi network and handling of the camera's video stream.

The code is structured with setup and loop functions, as well as several helper functions for handling specific tasks such as moving the robot forward, backward, turning, stopping, and controlling the servos.

The code also includes HTML and JavaScript for the web interface, which allows users to control the robot car and camera through a web page. The interface includes buttons for movement control, sliders for speed and LED brightness adjustment, and a video stream display.


Note: The actual code is not included in this document due to its length, but it is summarized to provide an understanding of its functionality.