Arduino UNO-Based Battery-Powered Obstacle Avoidance Robot 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 (IR and Ultrasonic), a servo motor, a DC motor driver, motors with wheels, a Li-Ion battery, and a rocker switch. The circuit is designed to interface these components to perform specific tasks, controlled by 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
IR Sensor (2 units)
- Description: Infrared sensor for obstacle detection.
- Pins: out, gnd, vcc
Ultrasonic Sensor
- Description: Sensor for measuring distance using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
Servo
- Description: A servo motor for precise control of angular position.
- Pins: GND, VCC, PWM
L298N DC Motor Driver
- Description: Dual H-Bridge motor driver for controlling 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
Motor and Wheels (2 units)
- Description: DC motors with attached wheels.
- Pins: vcc, GND
18650 Li-Ion Battery
- Description: Rechargeable lithium-ion battery.
- Pins: Positive, Negative
Rocker Switch
- Description: On/Off switch.
- Pins: 1, 2
Wiring Details
Arduino UNO
GND connected to:
- L298N DC motor driver (GND)
- 18650 Li-Ion battery (Negative)
Vin connected to:
- Rocker Switch (Pin 1)
- L298N DC motor driver (12V)
D12 connected to:
- Ultrasonic Sensor (Echo)
D11 connected to:
- Ultrasonic Sensor (Trigger)
D10 connected to:
- L298N DC motor driver (IN1)
D9 connected to:
- L298N DC motor driver (IN2)
D8 connected to:
- IR Sensor (out)
D7 connected to:
- IR Sensor (out)
D6 connected to:
- L298N DC motor driver (IN3)
D5 connected to:
- L298N DC motor driver (IN4)
D3 connected to:
- Servo (PWM)
IR Sensor
gnd connected to:
- Ultrasonic Sensor (GND)
- Servo (GND)
- IR Sensor (gnd)
vcc connected to:
- Ultrasonic Sensor (+VCC)
- IR Sensor (vcc)
Ultrasonic Sensor
GND connected to:
- IR Sensor (gnd)
- Servo (GND)
- IR Sensor (gnd)
+VCC connected to:
- IR Sensor (vcc)
- IR Sensor (vcc)
Servo
GND connected to:
- Ultrasonic Sensor (GND)
- IR Sensor (gnd)
- IR Sensor (gnd)
VCC connected to:
- L298N DC motor driver (5V)
L298N DC Motor Driver
GND connected to:
- Arduino UNO (GND)
- 18650 Li-Ion battery (Negative)
12V connected to:
- Arduino UNO (Vin)
- Rocker Switch (Pin 1)
OUT1 connected to:
- Motor and Wheels (GND)
OUT2 connected to:
- Motor and Wheels (vcc)
OUT3 connected to:
- Motor and Wheels (GND)
OUT4 connected to:
- Motor and Wheels (vcc)
5V connected to:
- Servo (VCC)
ENA connected to:
- +5V-J1
ENB connected to:
- +5V-J2
Motor and Wheels
GND connected to:
- L298N DC motor driver (OUT1)
- L298N DC motor driver (OUT3)
vcc connected to:
- L298N DC motor driver (OUT2)
- L298N DC motor driver (OUT4)
18650 Li-Ion Battery
Negative connected to:
- Arduino UNO (GND)
- L298N DC motor driver (GND)
Positive connected to:
- Rocker Switch (Pin 2)
Rocker Switch
Pin 1 connected to:
- Arduino UNO (Vin)
- L298N DC motor driver (12V)
Pin 2 connected to:
- 18650 Li-Ion battery (Positive)
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:
}
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 to control the sensors, motors, and other components in these functions.