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

Wi-Fi Controlled Robotic Car with ESP32 and Arduino

Image of Wi-Fi Controlled Robotic Car with ESP32 and Arduino

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to control multiple motors and sensors using an ESP32 and an Arduino Leonardo. The circuit includes motor drivers, various sensors, and a GPS module. The ESP32 is used for Wi-Fi connectivity and communication with Firebase, while the Arduino Leonardo handles motor control and sensor data processing.

Component List

  1. Motor and Wheels

    • Description: DC motors with attached wheels.
    • Pins: vcc, GND
  2. L298N DC Motor Driver

    • Description: Dual H-Bridge motor driver for controlling DC motors.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  3. ESP32

    • Description: Wi-Fi and Bluetooth microcontroller.
    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, BOOT
  4. Arduino Leonardo (Rev3b)

    • Description: Microcontroller board based on the ATmega32u4.
    • Pins: D0/RX, D1/TX, D2/SDA, D3 PWM/SCL, D4/A6, D5 PWM, D6 PWM/A7, D7, n.c., IOREF, RESET, 3V3, 5V, GND, VIN, A0, A1, A2, A3, A4, A5, D8/A8, D9 PWM/A9, D10 PWM/A10, D11 PWM, D12/A11, D13 PWM, AREF, SDA, SCL
  5. Battery 12V

    • Description: 12V power source.
    • Pins: +, -
  6. HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

    • Description: Ultrasonic sensor for distance measurement.
    • Pins: VCC, TRIG, ECHO, GND
  7. Servo

    • Description: Servo motor for precise control of angular position.
    • Pins: GND, VCC, PWM
  8. RAIN SENSOR

    • Description: Sensor for detecting rain.
    • Pins: AO, DO, GRD, VCC
  9. MQ-2

    • Description: Gas sensor for detecting various gases.
    • Pins: GND, VCC, ANALOG, Digital
  10. GPS NEO 6M

    • Description: GPS module for location tracking.
    • Pins: VCC, RX, TX, GND

Wiring Details

Motor and Wheels

  • vcc connected to OUT3 of L298N DC Motor Driver

  • GND connected to OUT4 of L298N DC Motor Driver

  • vcc connected to OUT1 of L298N DC Motor Driver

  • GND connected to OUT2 of L298N DC Motor Driver

  • vcc connected to OUT3 of L298N DC Motor Driver

  • GND connected to OUT4 of L298N DC Motor Driver

  • vcc connected to OUT1 of L298N DC Motor Driver

  • GND connected to OUT2 of L298N DC Motor Driver

L298N DC Motor Driver

  • 12V connected to + of Battery 12V
  • GND connected to - of Battery 12V
  • 5V connected to VIN of Arduino Leonardo
  • ENA connected to D3 PWM/SCL of Arduino Leonardo
  • IN1 connected to D7 of Arduino Leonardo and DO of RAIN SENSOR
  • IN2 connected to D8/A8 of Arduino Leonardo and Digital of MQ-2
  • IN3 connected to D10 PWM/A10 of Arduino Leonardo
  • IN4 connected to D11 PWM of Arduino Leonardo
  • ENB connected to D5 PWM of Arduino Leonardo

ESP32

  • VIN connected to 5V of L298N DC Motor Driver
  • GND connected to GND of Arduino Leonardo and GND of GPS NEO 6M
  • RX0 connected to RX of GPS NEO 6M
  • TX0 connected to TX of GPS NEO 6M

Arduino Leonardo (Rev3b)

  • VIN connected to 5V of L298N DC Motor Driver
  • D3 PWM/SCL connected to ENA of L298N DC Motor Driver
  • D7 connected to IN1 of L298N DC Motor Driver and DO of RAIN SENSOR
  • D8/A8 connected to IN2 of L298N DC Motor Driver and Digital of MQ-2
  • D10 PWM/A10 connected to IN3 of L298N DC Motor Driver
  • D11 PWM connected to IN4 of L298N DC Motor Driver
  • D5 PWM connected to ENB of L298N DC Motor Driver
  • D1/TX connected to RX of GPS NEO 6M
  • D0/RX connected to TX of GPS NEO 6M
  • D2/SDA connected to TRIG of HC-SR04 Ultrasonic Distance Sensor
  • D4/A6 connected to ECHO of HC-SR04 Ultrasonic Distance Sensor
  • 5V connected to VCC of Servo, VCC of RAIN SENSOR, VCC of GPS NEO 6M, VCC of MQ-2, and VCC of HC-SR04 Ultrasonic Distance Sensor
  • GND connected to GND of Servo, GRD of RAIN SENSOR, GND of HC-SR04 Ultrasonic Distance Sensor, and GND of MQ-2
  • A0 connected to ANALOG of MQ-2
  • A1 connected to AO of RAIN SENSOR
  • D9 PWM/A9 connected to PWM of Servo

Battery 12V

  • + connected to 12V of L298N DC Motor Driver
  • - connected to GND of L298N DC Motor Driver

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

  • TRIG connected to D2/SDA of Arduino Leonardo
  • ECHO connected to D4/A6 of Arduino Leonardo
  • VCC connected to 5V of Arduino Leonardo
  • GND connected to GND of Arduino Leonardo

Servo

  • VCC connected to 5V of Arduino Leonardo
  • PWM connected to D9 PWM/A9 of Arduino Leonardo
  • GND connected to GND of Arduino Leonardo

RAIN SENSOR

  • DO connected to D7 of Arduino Leonardo and IN1 of L298N DC Motor Driver
  • GRD connected to GND of Arduino Leonardo
  • VCC connected to 5V of Arduino Leonardo
  • AO connected to A1 of Arduino Leonardo

MQ-2

  • Digital connected to D8/A8 of Arduino Leonardo and IN2 of L298N DC Motor Driver
  • GND connected to GND of Arduino Leonardo
  • VCC connected to 5V of Arduino Leonardo
  • ANALOG connected to A0 of Arduino Leonardo

GPS NEO 6M

  • VCC connected to 5V of Arduino Leonardo
  • RX connected to D1/TX of Arduino Leonardo and RX0 of ESP32
  • TX connected to D0/RX of Arduino Leonardo and TX0 of ESP32
  • GND connected to GND of Arduino