ESP8266-Controlled Ultrasonic Distance Measurement with Servo Feedback
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit integrates a microcontroller (esp8266), two HC-SR04 ultrasonic sensors, and a micro servo (9G). The primary function of this circuit is to use the ultrasonic sensors for distance measurement and control the position of the servo motor based on the distance data processed by the esp8266 microcontroller.
Component List
Micro servo 9G
- Description: A small and lightweight servo motor used for precise control of angular motion.
- Pins: GND, +5V, PWM
HC-SR04 Ultrasonic Sensor (x2)
- Description: An ultrasonic distance sensor that uses sonar to determine the distance to an object.
- Pins: VCC, TRIG, ECHO, GND
esp8266
- Description: A Wi-Fi capable microcontroller with a range of GPIO pins for interfacing with various sensors and actuators.
- Pins: 3V, G, D8, D7, D6, D5, D4, D3, D2, D1, D0, A0, S3, S2, S1, SC, S0, SK, EN, VIN, RST, VU
Comment
- Description: Placeholder for additional notes or comments in the circuit design. These components do not have physical representations or pins.
Wiring Details
Micro servo 9G
- GND: Connected to the ground net shared with esp8266 and both HC-SR04 sensors.
- +5V: Connected to the power net shared with esp8266 and both HC-SR04 sensors.
- PWM: Connected to pin D7 of the esp8266.
HC-SR04 Ultrasonic Sensor #1
- VCC: Connected to the power net shared with esp8266 and the micro servo.
- TRIG: Connected to pin D1 of the esp8266.
- ECHO: Connected to pin D2 of the esp8266.
- GND: Connected to the ground net shared with esp8266 and the micro servo.
HC-SR04 Ultrasonic Sensor #2
- VCC: Connected to the power net shared with esp8266 and the micro servo.
- TRIG: Connected to pin D6 of the esp8266.
- ECHO: Connected to pin D5 of the esp8266.
- GND: Connected to the ground net shared with esp8266 and the micro servo.
esp8266
- G: Connected to the ground net shared with both HC-SR04 sensors and the micro servo.
- VIN: Connected to the power net shared with both HC-SR04 sensors and the micro servo.
- D7: Connected to the PWM pin of the micro servo.
- D6: Connected to the TRIG pin of HC-SR04 Ultrasonic Sensor #2.
- D5: Connected to the ECHO pin of HC-SR04 Ultrasonic Sensor #2.
- D2: Connected to the ECHO pin of HC-SR04 Ultrasonic Sensor #1.
- D1: Connected to the TRIG pin of HC-SR04 Ultrasonic Sensor #1.
Documented Code
No code has been provided for the microcontrollers in the circuit. The code would typically include initialization of the GPIO pins, setup of the Wi-Fi connection (if used), and the main control loop where the microcontroller reads data from the ultrasonic sensors, processes the data, and controls the servo motor accordingly.