Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-CAM Controlled Surveillance Robot with Wi-Fi and Servo Pan/Tilt Mechanism

View and Edit Project In Cirkit DesignerImage of ESP32-CAM Controlled Surveillance Robot with Wi-Fi and Servo Pan/Tilt Mechanism

Circuit Documentation

Summary

This circuit is designed to control a vehicle with two DC motors for movement, two servos for directional control, and an ESP32-CAM module for wireless communication and camera functionality. The L298N DC motor driver is used to drive the DC motors, and a Mini 360 Buck Converter is included to regulate power. The system is powered by a LiPoly Battery and controlled by an ESP32-CAM microcontroller with an additional Arduino UNO microcontroller for auxiliary control tasks.

Component List

L298N DC Motor Driver

DC Motor (x4)

ESP32 - CAM

Servo (x2)

Mini 360 Buck Converter

LiPoly Battery (1300mAh)

Arduino UNO

Wiring Details

L298N DC Motor Driver

DC Motors

ESP32 - CAM

Servos

Mini 360 Buck Converter

LiPoly Battery

Arduino UNO

Documented Code

ESP32 - CAM Code (sketch.ino)

#include "esp_camera.h"
#include <Arduino.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <iostream>
#include <sstream>
#include <ESP32Servo.h>

// ... (Code truncated for brevity)

void setup(void) {
  // Setup pin modes, initialize servos, PWM, and camera
  // Start WiFi and web server
  // ... (Code truncated for brevity)
}

void loop() {
  // Cleanup WebSocket clients and send camera picture
  // ... (Code truncated for brevity)
}

This code initializes the ESP32-CAM module, sets up the web server, and handles WebSocket events for camera streaming and car control. It also includes functions to control the motors and servos based on WebSocket messages.

Arduino UNO Code (sketch.ino)

// The Arduino UNO code is similar to the ESP32-CAM code and is used for auxiliary control.
// ... (Code truncated for brevity)

void setup(void) {
  // Setup pin modes and initialize WiFi and web server
  // ... (Code truncated for brevity)
}

void loop() {
  // Cleanup WebSocket clients and send camera picture
  // ... (Code truncated for brevity)
}

The Arduino UNO code is not provided in full detail but is expected to perform similar functions as the ESP32-CAM, likely for redundancy or additional control features.

(Note: The actual code is much longer and includes detailed functions for motor control, WebSocket communication, and camera handling. The provided snippets are summaries to illustrate the functionality.)