Arduino UNO-Based Ultrasonic Distance Sensor with Multi-Color LED Indicator and Servo Motor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller, multiple LEDs of different colors, an HC-SR04 Ultrasonic Sensor, and a Micro Servo 9G. The Arduino UNO controls the LEDs and the servo motor based on inputs from the ultrasonic sensor.
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
LED: Two Pin (red)
- Description: A red LED with two pins: cathode and anode.
- Pins: cathode, anode
LED: Two Pin (green)
- Description: A green LED with two pins: cathode and anode.
- Pins: cathode, anode
LED: Two Pin (yellow)
- Description: A yellow LED with two pins: cathode and anode.
- Pins: cathode, anode
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic sensor used for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
Micro Servo 9G
- Description: A small servo motor used for precise control of angular position.
- Pins: GND, +5V, PWM
Wiring Details
Arduino UNO
- GND: Connected to the cathode of all LEDs.
- D11: Connected to the PWM pin of the Micro Servo 9G.
- D10: Connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor.
- D9: Connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor.
- D7: Connected to the anode of the green LED.
- D6: Connected to the anode of the yellow LED.
- D5: Connected to the anode of the red LED.
- D4: Connected to the anode of another green LED.
- D3: Connected to the anode of another yellow LED.
- D2: Connected to the anode of another red LED.
LED: Two Pin (red)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D5 of the Arduino UNO.
LED: Two Pin (red)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D2 of the Arduino UNO.
LED: Two Pin (green)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D7 of the Arduino UNO.
LED: Two Pin (green)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D4 of the Arduino UNO.
LED: Two Pin (yellow)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D6 of the Arduino UNO.
LED: Two Pin (yellow)
- Cathode: Connected to GND of the Arduino UNO.
- Anode: Connected to D3 of the Arduino UNO.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to +5V of the Micro Servo 9G.
- TRIG: Connected to D9 of the Arduino UNO.
- ECHO: Connected to D10 of the Arduino UNO.
- GND: Connected to GND of the Micro Servo 9G.
Micro Servo 9G
- GND: Connected to GND of the HC-SR04 Ultrasonic Sensor.
- +5V: Connected to VCC of the HC-SR04 Ultrasonic Sensor.
- PWM: Connected to D11 of the 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:
}
Documentation (documentation.txt)
This documentation provides a comprehensive overview of the circuit, including a detailed list of components, their wiring connections, and the code used for the Arduino UNO microcontroller.