Arduino UNO Controlled Ultrasonic Distance Measurement with Servo Motor Actuation
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit consists of an Arduino UNO microcontroller, an HC-SR04 ultrasonic sensor, and an SG90 servo motor. The Arduino UNO serves as the central processing unit, controlling the operations of the ultrasonic sensor and the servo motor. The ultrasonic sensor is used to measure distance by emitting ultrasonic waves and receiving the echo. The servo motor is controlled by the Arduino to perform precise angular movements. The circuit is designed to provide a 5V power supply to both the ultrasonic sensor and the servo motor from the Arduino, and it includes connections for signal communication between the Arduino and the other components.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor that can measure distances by emitting and receiving ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND.
SG90 Servo Motor
- Description: A small and lightweight servo motor capable of precise control of angular position.
- Pins: PWM, 5V, GND.
Wiring Details
Arduino UNO
- 5V: Provides power to the HC-SR04 Ultrasonic Sensor and SG90 Servo Motor.
- GND: Common ground with HC-SR04 Ultrasonic Sensor and SG90 Servo Motor.
- D12: Connected to the PWM pin of the SG90 Servo Motor for control signals.
- D9: Connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor to receive the echo signal.
- D8: Connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor to send the trigger signal.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to the 5V pin of the Arduino UNO for power.
- TRIG: Connected to the D8 pin of the Arduino UNO to receive trigger signals.
- ECHO: Connected to the D9 pin of the Arduino UNO to send the echo signal.
- GND: Connected to the GND pin of the Arduino UNO for a common ground.
SG90 Servo Motor
- PWM: Connected to the D12 pin of the Arduino UNO for control signals.
- 5V: Connected to the 5V pin of the Arduino UNO for power.
- GND: Connected to the GND pin of the Arduino UNO for a common ground.
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 for operating the ultrasonic sensor or the servo motor. The user is expected to fill in the setup and loop functions with the appropriate code to control the components based on the circuit design.