Arduino-Based Ultrasonic Distance Sensor with Servo Motor Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit consists of an Arduino UNO microcontroller, a Micro servo 9G, and an HC-SR04 Ultrasonic Sensor. The Arduino UNO serves as the central control unit, interfacing with the servo motor and the ultrasonic sensor to perform various tasks. The servo motor is used for precise control of angular position, while the ultrasonic sensor is used for distance measurement.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Micro servo 9G
- Description: A small and lightweight servo motor used for precise control of angular position.
- Pins: GND, +5V, PWM
HC-SR04 Ultrasonic Sensor
- Description: A sensor used for measuring distance by using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
Wiring Details
Arduino UNO
- 5V: Connected to +5V of Micro servo 9G and VCC of HC-SR04 Ultrasonic Sensor
- GND: Connected to GND of Micro servo 9G and GND of HC-SR04 Ultrasonic Sensor
- D11: Connected to ECHO of HC-SR04 Ultrasonic Sensor
- D10: Connected to TRIG of HC-SR04 Ultrasonic Sensor
- D9: Connected to PWM of Micro servo 9G
Micro servo 9G
- +5V: Connected to 5V of Arduino UNO
- GND: Connected to GND of Arduino UNO
- PWM: Connected to D9 of Arduino UNO
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 5V of Arduino UNO
- GND: Connected to GND of Arduino UNO
- ECHO: Connected to D11 of Arduino UNO
- TRIG: Connected to D10 of Arduino UNO
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:
}
Additional Documentation (documentation.txt)
This documentation provides a comprehensive overview of the circuit, including a summary, component list, wiring details, and the code used in the Arduino UNO.