Arduino UNO-Based Battery-Powered Robotic Vehicle with Dual Ultrasonic Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, two HC-SR04 Ultrasonic Sensors, three 18650 Li-Ion batteries, an L298N DC motor driver, and two DC Motors. The circuit is designed to interface the ultrasonic sensors and control the DC motors using the Arduino UNO.
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
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND
18650 Li-Ion
- Description: A rechargeable lithium-ion battery.
- Pins: Positive, Negative
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver.
- 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
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
Wiring Details
Arduino UNO
- 5V connected to VCC of both HC-SR04 Ultrasonic Sensors.
- GND connected to GND of both HC-SR04 Ultrasonic Sensors.
- Vin connected to Positive of one 18650 Li-Ion battery.
- GND connected to Negative of the same 18650 Li-Ion battery.
- D12 connected to TRIG of the first HC-SR04 Ultrasonic Sensor.
- D11 connected to ECHO of the first HC-SR04 Ultrasonic Sensor.
- D9 connected to ENA of the L298N DC motor driver.
- D8 connected to ENB of the L298N DC motor driver.
- D7 connected to IN1 of the L298N DC motor driver.
- D6 connected to IN2 of the L298N DC motor driver.
- D5 connected to IN3 of the L298N DC motor driver.
- D4 connected to IN4 of the L298N DC motor driver.
- D3 connected to TRIG of the second HC-SR04 Ultrasonic Sensor.
- D2 connected to ECHO of the second HC-SR04 Ultrasonic Sensor.
HC-SR04 Ultrasonic Sensor (First)
- VCC connected to 5V of the Arduino UNO.
- GND connected to GND of the Arduino UNO.
- TRIG connected to D12 of the Arduino UNO.
- ECHO connected to D11 of the Arduino UNO.
HC-SR04 Ultrasonic Sensor (Second)
- VCC connected to 5V of the Arduino UNO.
- GND connected to GND of the Arduino UNO.
- TRIG connected to D3 of the Arduino UNO.
- ECHO connected to D2 of the Arduino UNO.
18650 Li-Ion (First)
- Positive connected to Vin of the Arduino UNO.
- Negative connected to GND of the Arduino UNO.
18650 Li-Ion (Second)
- Positive connected to Negative of the third 18650 Li-Ion battery.
18650 Li-Ion (Third)
- Positive connected to 12V of the L298N DC motor driver.
- Negative connected to GND of the L298N DC motor driver.
L298N DC Motor Driver
- ENA connected to D9 of the Arduino UNO.
- ENB connected to D8 of the Arduino UNO.
- IN1 connected to D7 of the Arduino UNO.
- IN2 connected to D6 of the Arduino UNO.
- IN3 connected to D5 of the Arduino UNO.
- IN4 connected to D4 of the Arduino UNO.
- GND connected to Negative of the third 18650 Li-Ion battery.
- 12V connected to Positive of the second 18650 Li-Ion battery.
- OUT1 connected to pin 2 of the first DC Motor.
- OUT2 connected to pin 1 of the first DC Motor.
- OUT3 connected to pin 1 of the second DC Motor.
- OUT4 connected to pin 2 of the second DC Motor.
DC Motor (First)
- pin 1 connected to OUT2 of the L298N DC motor driver.
- pin 2 connected to OUT1 of the L298N DC motor driver.
DC Motor (Second)
- pin 1 connected to OUT3 of the L298N DC motor driver.
- pin 2 connected to OUT4 of the 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:
}
Arduino UNO Documentation (documentation.txt)