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

ESP32-Based Infrared Object Detection System with I2C LCD Feedback and Servo Control

Image of ESP32-Based Infrared Object Detection System with I2C LCD Feedback and Servo Control

Circuit Documentation

Summary

This circuit integrates an ESP32 microcontroller with a 16x2 LCD screen via I2C, multiple IR sensors, and an SG90 servo motor. The ESP32 serves as the central processing unit, interfacing with the LCD screen to display data and reading inputs from the IR sensors. The servo motor is controlled by the ESP32 through a PWM signal. Power distribution is managed with common VCC and GND nets connecting all components.

Component List

ESP32 (30 pin)

  • Description: A microcontroller with Wi-Fi and Bluetooth capabilities, featuring a wide range of GPIO pins.
  • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3

LCD screen 16x2 I2C

  • Description: A 16x2 character LCD display with an I2C interface for easy communication with microcontrollers.
  • Pins: SCL, SDA, VCC, GND

IR Sensor

  • Description: An infrared sensor capable of detecting obstacles and measuring distances.
  • Pins: out, gnd, vcc

SG90 Servo Motor

  • Description: A small and lightweight servo motor suitable for a wide range of motion applications.
  • Pins: PWM, 5V, GND

Wiring Details

ESP32 (30 pin)

  • D22 connected to LCD screen SCL
  • D21 connected to LCD screen SDA
  • D18 connected to IR sensor out
  • D5 connected to IR sensor out
  • D4 connected to IR sensor out
  • D14 connected to IR sensor out
  • D13 connected to SG90 servo motor PWM
  • Vin connected to LCD screen VCC, SG90 servo motor 5V, and IR sensors vcc
  • GND connected to LCD screen GND, SG90 servo motor GND, and IR sensors gnd

LCD screen 16x2 I2C

  • SCL connected to ESP32 D22
  • SDA connected to ESP32 D21
  • VCC connected to ESP32 Vin
  • GND connected to ESP32 GND

IR Sensor

  • out connected to ESP32 D18, D5, D4, or D14 (one sensor per pin)
  • vcc connected to ESP32 Vin
  • gnd connected to ESP32 GND

SG90 Servo Motor

  • PWM connected to ESP32 D13
  • 5V connected to ESP32 Vin
  • GND connected to ESP32 GND

Documented Code

ESP32 Microcontroller Code (sketch.ino)

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

}

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

}

SG90 Servo Motor Microcontroller Code (sketch.ino)

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

}

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

}

Note: The actual functionality of the microcontrollers will be defined in the code, which is currently not provided in the input. The code provided above is a template and should be filled in with the specific logic required for the circuit's operation.