Arduino UNO 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 servo, and a power supply. The circuit is designed to interface with multiple sensors and actuators, controlled by the Arduino UNO. The power is supplied by two 18650 Li-ion batteries, and a rocker switch is used to control the power flow.
Component List
18650 Li-ion Battery x 2
- Pins: +, -
- Description: Provides power to the circuit.
- Purpose: Power supply.
Arduino UNO
- 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
- Description: Microcontroller board.
- Purpose: Central control unit.
IR Sensor (x2)
- Pins: out, gnd, vcc
- Description: Infrared sensor for object detection.
- Purpose: Sensing objects.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: Ultrasonic distance sensor.
- Purpose: Measuring distance.
Micro Servo 9G
- Pins: GND, +5V, PWM
- Description: Small servo motor.
- Purpose: Actuation.
Motor (x4)
- Pins: vcc, GND
- Description: Hobby motor with gearbox.
- Purpose: Actuation.
L298N DC 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
- Description: Dual H-Bridge motor driver.
- Purpose: Driving motors.
Rocker Switch
- Pins: output, input
- Description: On/Off switch.
- Purpose: Controlling power flow.
Wiring Details
18650 Li-ion Battery x 2
- + Pin: Connected to the input pin of the rocker switch.
- - Pin: Connected to the GND pins of the Arduino UNO, Micro Servo 9G, HC-SR04 Ultrasonic Sensor, both IR sensors, and the L298N DC motor driver.
Arduino UNO
- Vin Pin: Connected to the output pin of the rocker switch.
- GND Pin: Connected to the GND pins of the Micro Servo 9G, HC-SR04 Ultrasonic Sensor, both IR sensors, and the L298N DC motor driver.
- 5V Pin: Connected to the VCC pins of the Micro Servo 9G, HC-SR04 Ultrasonic Sensor, and both IR sensors.
- A0 Pin: Connected to the out pin of the first IR sensor.
- A1 Pin: Connected to the out pin of the second IR sensor.
- A2 Pin: Connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor.
- A3 Pin: Connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor.
- A5 Pin: Connected to the PWM pin of the Micro Servo 9G.
- D10 Pin: Connected to the ENA pin of the L298N DC motor driver.
- D9 Pin: Connected to the IN1 pin of the L298N DC motor driver.
- D8 Pin: Connected to the IN2 pin of the L298N DC motor driver.
- D7 Pin: Connected to the IN3 pin of the L298N DC motor driver.
- D6 Pin: Connected to the IN4 pin of the L298N DC motor driver.
- D5 Pin: Connected to the ENB pin of the L298N DC motor driver.
IR Sensor (x2)
- out Pin: Connected to A0 (first sensor) and A1 (second sensor) pins of the Arduino UNO.
- gnd Pin: Connected to the GND pin of the Arduino UNO.
- vcc Pin: Connected to the 5V pin of the Arduino UNO.
HC-SR04 Ultrasonic Sensor
- VCC Pin: Connected to the 5V pin of the Arduino UNO.
- TRIG Pin: Connected to the A3 pin of the Arduino UNO.
- ECHO Pin: Connected to the A2 pin of the Arduino UNO.
- GND Pin: Connected to the GND pin of the Arduino UNO.
Micro Servo 9G
- GND Pin: Connected to the GND pin of the Arduino UNO.
- +5V Pin: Connected to the 5V pin of the Arduino UNO.
- PWM Pin: Connected to the A5 pin of the Arduino UNO.
Motor (x4)
- vcc Pin: Connected to the OUT2 and OUT3 pins of the L298N DC motor driver.
- GND Pin: Connected to the OUT1 and OUT4 pins of the L298N DC motor driver.
L298N DC Motor Driver
- 12V Pin: Connected to the output pin of the rocker switch.
- GND Pin: Connected to the GND pin of the Arduino UNO.
- OUT1 Pin: Connected to the GND pins of two motors.
- OUT2 Pin: Connected to the vcc pins of two motors.
- OUT3 Pin: Connected to the vcc pins of two motors.
- OUT4 Pin: Connected to the GND pins of two motors.
- ENA Pin: Connected to the D10 pin of the Arduino UNO.
- IN1 Pin: Connected to the D9 pin of the Arduino UNO.
- IN2 Pin: Connected to the D8 pin of the Arduino UNO.
- IN3 Pin: Connected to the D7 pin of the Arduino UNO.
- IN4 Pin: Connected to the D6 pin of the Arduino UNO.
- ENB Pin: Connected to the D5 pin of the Arduino UNO.
Rocker Switch
- input Pin: Connected to the + pin of the 18650 Li-ion Battery x 2.
- output Pin: Connected to the Vin pin of the Arduino UNO and the 12V pin of the L298N DC motor driver.
Documented Code
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 code that runs repeatedly.