Circuit Documentation
Summary of the Circuit
This circuit integrates an HC-SR04 Ultrasonic Sensor, an Arduino UNO microcontroller, and a Servo motor to create a system that can measure distances and respond with physical movement. The Arduino UNO serves as the central processing unit, controlling the ultrasonic sensor to measure distances and the servo motor to actuate based on the sensor's readings. The ultrasonic sensor is powered by the Arduino and sends distance measurements back to it, while the servo motor receives PWM signals from the Arduino to position itself accordingly.
Component List
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: This sensor measures distance by emitting ultrasonic waves and measuring the time it takes for the echo to return.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13
- Description: A microcontroller board based on the ATmega328P, used for controlling the logic of the circuit and processing sensor data.
Servo
- Pins: GND, VCC, PWM
- Description: An actuator that can be precisely controlled to rotate to different angles using PWM signals.
Wiring Details
HC-SR04 Ultrasonic Sensor
- VCC: Connected to the 5V output from the Arduino UNO.
- TRIG: Connected to digital pin D9 on the Arduino UNO.
- ECHO: Connected to digital pin D10 on the Arduino UNO.
- GND: Connected to a GND pin on the Arduino UNO.
Arduino UNO
- 5V: Provides power to the HC-SR04 Ultrasonic Sensor and the Servo.
- GND: Common ground for the HC-SR04 Ultrasonic Sensor and the Servo.
- D9: Sends trigger signal to the HC-SR04 Ultrasonic Sensor.
- D10: Receives echo signal from the HC-SR04 Ultrasonic Sensor.
- D11: Sends PWM signal to the Servo.
Servo
- VCC: Connected to the 5V output from the Arduino UNO.
- GND: Connected to a GND pin on the Arduino UNO.
- PWM: Connected to digital pin D11 on the Arduino UNO to receive PWM signals.
Documented Code
Arduino UNO 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 provided code is a template and does not contain any functional code to control the HC-SR04 Ultrasonic Sensor or the Servo. The user is expected to fill in the setup and loop functions with the appropriate initialization and control logic.
