Arduino UNO-Based Battery-Powered Robotic Vehicle with Ultrasonic Sensor and Servo Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with various components including a Servo motor, an L298N DC motor driver, an HC-SR04 Ultrasonic Sensor, a 3xAAA Battery Pack, and two DC Motors. The Arduino UNO serves as the central control unit, managing the operations of the connected components.
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
Servo
- Description: A small motor with a feedback sensor for precise control.
- Pins: gnd, vcc, pulse
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control of two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
HC-SR04 Ultrasonic Sensor
- Description: A sensor used for distance measurement using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
3xAAA Battery Pack with Switch and JST
- Description: A battery pack providing power to the circuit.
- Pins: POS, NEG
DC Motor (Motor 1)
- Description: A simple DC motor.
- Pins: pin 1, pin 2
DC Motor (Motor 2)
- Description: Another simple DC motor.
- Pins: pin 1, pin 2
Wiring Details
Arduino UNO
- 5V connected to VCC of HC-SR04 Ultrasonic Sensor and vcc of Servo.
- GND connected to gnd of Servo, GND of L298N DC motor driver, NEG of 3xAAA Battery Pack, and GND of HC-SR04 Ultrasonic Sensor.
- Vin connected to 12V of L298N DC motor driver and POS of 3xAAA Battery Pack.
- D11 connected to ENA of L298N DC motor driver.
- D10 connected to IN1 of L298N DC motor driver.
- D9 connected to IN2 of L298N DC motor driver.
- D8 connected to IN3 of L298N DC motor driver.
- D7 connected to IN4 of L298N DC motor driver.
- D6 connected to ENB of L298N DC motor driver.
- D5 connected to pulse of Servo.
- D3 connected to ECHO of HC-SR04 Ultrasonic Sensor.
- D2 connected to TRIG of HC-SR04 Ultrasonic Sensor.
Servo
- vcc connected to 5V of Arduino UNO.
- gnd connected to GND of Arduino UNO.
- pulse connected to D5 of Arduino UNO.
L298N DC Motor Driver
- GND connected to GND of Arduino UNO and NEG of 3xAAA Battery Pack.
- 12V connected to Vin of Arduino UNO and POS of 3xAAA Battery Pack.
- ENA connected to D11 of Arduino UNO.
- IN1 connected to D10 of Arduino UNO.
- IN2 connected to D9 of Arduino UNO.
- IN3 connected to D8 of Arduino UNO.
- IN4 connected to D7 of Arduino UNO.
- ENB connected to D6 of Arduino UNO.
- OUT1 connected to pin 2 of DC Motor 1.
- OUT2 connected to pin 1 of DC Motor 1.
- OUT3 connected to pin 2 of DC Motor 2.
- OUT4 connected to pin 1 of DC Motor 2.
HC-SR04 Ultrasonic Sensor
- VCC connected to 5V of Arduino UNO.
- GND connected to GND of Arduino UNO.
- ECHO connected to D3 of Arduino UNO.
- TRIG connected to D2 of Arduino UNO.
3xAAA Battery Pack with Switch and JST
- POS connected to Vin of Arduino UNO and 12V of L298N DC motor driver.
- NEG connected to GND of Arduino UNO and GND of L298N DC motor driver.
DC Motor (Motor 1)
- pin 2 connected to OUT1 of L298N DC motor driver.
- pin 1 connected to OUT2 of L298N DC motor driver.
DC Motor (Motor 2)
- pin 2 connected to OUT3 of L298N DC motor driver.
- pin 1 connected to OUT4 of L298N DC motor driver.
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)