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

ESP32-Controlled Servo and Ultrasonic Sensor Array with Keypad Interface

Image of ESP32-Controlled Servo and Ultrasonic Sensor Array with Keypad Interface

Circuit Documentation

Summary

This circuit integrates a variety of components to perform a set of functions that likely involve user input, distance measurement, and actuation. The primary controller for the circuit is an ESP32 microcontroller, which interfaces with two HC-SR04 Ultrasonic Sensors, two Servo motors, and a 4X4 Membrane Matrix Keypad. The ESP32 microcontroller manages the input from the keypad and the ultrasonic sensors and controls the servo motors accordingly.

Component List

ESP32 - 38 pins

  • Description: A microcontroller with Wi-Fi and Bluetooth capabilities and a wide range of GPIO pins.
  • Purpose: Acts as the central processing unit of the circuit, reading sensor data, processing user input, and controlling peripheral devices.

HC-SR04 Ultrasonic Sensor

  • Description: An ultrasonic distance sensor that can measure distances by emitting ultrasonic waves and measuring the time it takes for the echo to return.
  • Purpose: Used to measure distances or detect the presence of objects in front of the sensor.

Servo

  • Description: An actuator capable of precise angular positioning, commonly used for steering mechanisms or robotic arms.
  • Purpose: Receives PWM signals from the microcontroller to adjust to specific angles based on the program logic.

4X4 Membrane Matrix Keypad

  • Description: A 16-button keypad that provides a simple interface for user input.
  • Purpose: Allows the user to input commands or data into the system, which can then be processed by the microcontroller.

Wiring Details

ESP32 - 38 pins

  • 3V3: Connected to VCC of both HC-SR04 Ultrasonic Sensors and both Servo motors to provide power.
  • GND: Common ground connection with both HC-SR04 Ultrasonic Sensors and both Servo motors.
  • G35: Connected to the PWM pin of one Servo motor for control signals.
  • G34: Connected to the PWM pin of the other Servo motor for control signals.
  • G33: Connected to the TRIG pin of one HC-SR04 Ultrasonic Sensor to trigger distance measurement.
  • G32: Connected to the ECHO pin of one HC-SR04 Ultrasonic Sensor to receive the echo signal.
  • G26: Connected to the TRIG pin of the other HC-SR04 Ultrasonic Sensor to trigger distance measurement.
  • G25: Connected to the ECHO pin of the other HC-SR04 Ultrasonic Sensor to receive the echo signal.
  • G19, G18, G5, G17: Connected to the R1, R2, R3, R4 pins of the 4X4 Membrane Matrix Keypad for row scanning.
  • G16, G4, G0, G2: Connected to the C1, C2, C3, C4 pins of the 4X4 Membrane Matrix Keypad for column scanning.

HC-SR04 Ultrasonic Sensor

  • VCC: Powered by the 3V3 pin of the ESP32.
  • GND: Connected to the common ground.
  • TRIG: Connected to either G33 or G26 of the ESP32 to initiate distance measurement.
  • ECHO: Connected to either G32 or G25 of the ESP32 to receive the reflected signal.

Servo

  • VCC: Powered by the 3V3 pin of the ESP32.
  • GND: Connected to the common ground.
  • PWM: Connected to either G35 or G34 of the ESP32 for receiving control signals.

4X4 Membrane Matrix Keypad

  • R1, R2, R3, R4: Connected to G19, G18, G5, G17 of the ESP32 for row scanning.
  • C1, C2, C3, C4: Connected to G16, G4, G0, G2 of the ESP32 for column scanning.

Documented Code

No code has been provided for the microcontrollers in the circuit. The expected code should initialize the GPIO pins for communication with the ultrasonic sensors, servo motors, and the keypad. It should include routines for reading the keypad, triggering the ultrasonic sensors, measuring the time interval of the echo, and generating PWM signals for the servo motors based on the logic defined by the user inputs and sensor readings.