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

Wi-Fi Controlled ESP32-CAM Robot with Drv8833 Motor Drivers

View and Edit Project In Cirkit DesignerImage of Wi-Fi Controlled ESP32-CAM Robot with Drv8833 Motor Drivers

Circuit Documentation

Summary

This circuit is designed to control a vehicle with an ESP32-CAM microcontroller, which provides Wi-Fi connectivity and camera functionality. The vehicle is powered by a 3.7V battery and includes three DC motors for movement. The motors are driven by two DRV8833 motor driver ICs. A MP1584EN power regulator board steps down the voltage to power the ESP32-CAM and the motor drivers. The circuit also includes a rocker switch to control power flow and electrolytic capacitors for voltage smoothing.

Component List

ESP32-CAM

3.7V Battery

DC Motor (x3)

MP1584EN Power Regulator Board

DRV8833 Motor Driver IC (x2)

Rocker Switch

Electrolytic Capacitor (x2)

Resistor

Wiring Details

ESP32-CAM

3.7V Battery

DC Motor

MP1584EN Power Regulator Board

DRV8833 Motor Driver IC

Rocker Switch

Electrolytic Capacitor

Documented Code

ESP32-CAM Code

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

// ... (Code truncated for brevity)

void setup(void) 
{
  setUpPinModes();
  Serial.begin(115200);

  WiFi.softAP(ssid, password);
  IPAddress IP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(IP);

  server.on("/", HTTP_GET, handleRoot);
  server.onNotFound(handleNotFound);
      
  wsCamera.onEvent(onCameraWebSocketEvent);
  server.addHandler(&wsCamera);

  wsCarInput.onEvent(onCarInputWebSocketEvent);
  server.addHandler(&wsCarInput);

  server.begin();
  Serial.println("HTTP server started");

  setupCamera();
}

void loop() 
{
  wsCamera.cleanupClients(); 
  wsCarInput.cleanupClients(); 
  sendCameraPicture(); 
  Serial.printf("SPIRam Total heap %d, SPIRam Free Heap %d\n", ESP.getPsramSize(), ESP.getFreePsram());
}

DRV8833 Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The ESP32-CAM code includes setup for Wi-Fi access point, web server, WebSocket for camera and car control, and motor control functions. The DRV8833 code is currently empty and would typically contain code to initialize the motor driver and control the motors based on inputs from the ESP32-CAM.