Arduino UNO-Based Battery-Powered Robotic System with Ultrasonic Sensor and LED Indicators
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with an HC-SR04 Ultrasonic Sensor, a DC Motor driven by an L298P drive shield, and three LEDs (green, yellow, and red) each connected through a 220 Ohm resistor. The circuit is powered by a 9V battery connected through a power jack.
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
L298P drive shield
- Description: A dual full-bridge driver designed to drive inductive loads such as relays, solenoids, DC and stepping motors.
- Pins: B-, B+, A-, A+, GND, VIN
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
LED: Two Pin (green)
- Description: A green LED.
- Pins: cathode, anode
LED: Two Pin (yellow)
- Description: A yellow LED.
- Pins: cathode, anode
LED: Two Pin (red)
- Description: A red LED.
- Pins: cathode, anode
Resistor (220 Ohms)
- Description: A resistor with a resistance of 220 Ohms.
- Pins: pin1, pin2
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic sensor for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
Power jack
- Description: A power jack for connecting the 9V battery.
- Pins: POSITIF, NEGATIF
9V Battery
- Description: A 9V battery for powering the circuit.
- Pins: +, -
Wiring Details
Arduino UNO
- 5V to VCC of HC-SR04 Ultrasonic Sensor
- D3 to TRIG of HC-SR04 Ultrasonic Sensor
- D2 to ECHO of HC-SR04 Ultrasonic Sensor
- GND to GND of HC-SR04 Ultrasonic Sensor, cathode of green LED, cathode of yellow LED, cathode of red LED
- D5 to pin2 of Resistor (connected to red LED)
- D6 to pin2 of Resistor (connected to yellow LED)
- D7 to pin2 of Resistor (connected to green LED)
L298P drive shield
- A- to pin 2 of DC Motor
- A+ to pin 1 of DC Motor
HC-SR04 Ultrasonic Sensor
- VCC to 5V of Arduino UNO
- TRIG to D3 of Arduino UNO
- ECHO to D2 of Arduino UNO
- GND to GND of Arduino UNO, cathode of green LED, cathode of yellow LED, cathode of red LED
DC Motor
- pin 1 to A+ of L298P drive shield
- pin 2 to A- of L298P drive shield
LED: Two Pin (green)
- cathode to GND of Arduino UNO
- anode to pin1 of Resistor (220 Ohms)
LED: Two Pin (yellow)
- cathode to GND of Arduino UNO
- anode to pin1 of Resistor (220 Ohms)
LED: Two Pin (red)
- cathode to GND of Arduino UNO
- anode to pin1 of Resistor (220 Ohms)
Resistor (220 Ohms)
- pin1 to anode of respective LED
- pin2 to D5 (red LED), D6 (yellow LED), D7 (green LED) of Arduino UNO
Power jack
- POSITIF to + of 9V Battery
- NEGATIF to - of 9V Battery
9V Battery
- + to POSITIF of Power jack
- - to NEGATIF of Power jack
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)