Arduino UNO-Based Battery-Powered Robotic Vehicle with IR and 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, various sensors, motors, a motor driver, a rocker switch, and a power source. The circuit is designed to interface with multiple sensors and control motors using the Arduino UNO. The document includes a component list, wiring details, and the embedded code used in the microcontroller.
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
IR Sensor (x2)
- Description: Infrared sensor for object detection.
- Pins: out, gnd, vcc
Motor amarillo motorreductor hobby (x4)
- Description: Hobby DC motor with gear reduction.
- Pins: vcc, GND
L298N DC Motor Driver
- Description: 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
Rocker Switch
- Description: A simple on/off switch.
- Pins: output, input
HC-SR04 Ultrasonic Sensor
- Description: Ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND
18650 Li-ion Battery x 2
- Description: Rechargeable lithium-ion battery.
- Pins: +, -
Micro Servo 9G
- Description: Small servo motor.
- Pins: GND, +5V, PWM
Wiring Details
Arduino UNO
GND connected to:
- Micro servo 9G (GND)
- L298N DC motor driver (GND)
- IR sensor (gnd) (x2)
- 18650 Li-ion Battery x 2 (-)
- HC-SR04 Ultrasonic Sensor (GND)
5V connected to:
- Micro servo 9G (+5V)
- IR sensor (vcc) (x2)
- HC-SR04 Ultrasonic Sensor (VCC)
Vin connected to:
- Rocker switch (output)
- L298N DC motor driver (12V)
A0 connected to:
- IR sensor (out)
A1 connected to:
- IR sensor (out)
A2 connected to:
- HC-SR04 Ultrasonic Sensor (ECHO)
A3 connected to:
- HC-SR04 Ultrasonic Sensor (TRIG)
A5 connected to:
- Micro servo 9G (PWM)
D10 connected to:
- L298N DC motor driver (ENA)
D9 connected to:
- L298N DC motor driver (IN1)
D8 connected to:
- L298N DC motor driver (IN2)
D7 connected to:
- L298N DC motor driver (IN3)
D6 connected to:
- L298N DC motor driver (IN4)
D5 connected to:
- L298N DC motor driver (ENB)
IR Sensor (x2)
gnd connected to:
- Arduino UNO (GND)
vcc connected to:
- Arduino UNO (5V)
out connected to:
- Arduino UNO (A0, A1)
Motor amarillo motorreductor hobby (x4)
vcc connected to:
- L298N DC motor driver (OUT2, OUT3)
GND connected to:
- L298N DC motor driver (OUT1, OUT4)
L298N DC Motor Driver
GND connected to:
- Arduino UNO (GND)
12V connected to:
- Rocker switch (output)
ENA connected to:
- Arduino UNO (D10)
IN1 connected to:
- Arduino UNO (D9)
IN2 connected to:
- Arduino UNO (D8)
IN3 connected to:
- Arduino UNO (D7)
IN4 connected to:
- Arduino UNO (D6)
ENB connected to:
- Arduino UNO (D5)
OUT1, OUT2 connected to:
- Motor amarillo motorreductor hobby (vcc, GND)
OUT3, OUT4 connected to:
- Motor amarillo motorreductor hobby (vcc, GND)
Rocker Switch
input connected to:
- 18650 Li-ion Battery x 2 (+)
output connected to:
- Arduino UNO (Vin)
- L298N DC motor driver (12V)
HC-SR04 Ultrasonic Sensor
GND connected to:
- Arduino UNO (GND)
VCC connected to:
- Arduino UNO (5V)
ECHO connected to:
- Arduino UNO (A2)
TRIG connected to:
- Arduino UNO (A3)
18650 Li-ion Battery x 2
+ connected to:
- Rocker switch (input)
- connected to:
- Arduino UNO (GND)
- L298N DC motor driver (GND)
Micro Servo 9G
GND connected to:
- Arduino UNO (GND)
+5V connected to:
- Arduino UNO (5V)
PWM connected to:
- Arduino UNO (A5)
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main logic that runs repeatedly. You can add your specific logic and sensor/motor control code within these functions.