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, a motor driver, DC motors, a servo, an LCD display, a buzzer, and a power supply. The circuit is designed to interface with multiple sensors and actuators, providing control and feedback through 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
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver module.
- 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
IR Sensor
- Description: An infrared sensor for obstacle detection.
- Pins: out, gnd, vcc
9V Battery
- Description: A 9V battery for power supply.
- Pins: -, +
Rocker Switch (SPST)
- Description: A single-pole single-throw switch.
- Pins: 1, 2
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND
16x2 I2C LCD
- Description: A 16x2 character LCD display with I2C interface.
- Pins: GND, VCC, SDA, SCL
Buzzer
- Description: A simple piezoelectric buzzer.
- Pins: PIN, GND
Micro Servo 9G
- Description: A small servo motor.
- Pins: GND, +5V, PWM
Wiring Details
Arduino UNO
- 5V: Connected to VCC of HC-SR04 Ultrasonic Sensor, IR Sensors, L298N DC Motor Driver, Micro Servo 9G, and 16x2 I2C LCD.
- GND: Connected to GND of HC-SR04 Ultrasonic Sensor, IR Sensors, L298N DC Motor Driver, Micro Servo 9G, Buzzer, and 16x2 I2C LCD.
- A0: Connected to out of IR Sensor.
- A1: Connected to out of IR Sensor.
- A4: Connected to SDA of 16x2 I2C LCD.
- A5: Connected to SCL of 16x2 I2C LCD.
- D13: Connected to PIN of Buzzer.
- D12: Connected to out of IR Sensor.
- D11: Connected to PWM of Micro Servo 9G.
- D10: Connected to IN4 of L298N DC Motor Driver.
- D9: Connected to IN3 of L298N DC Motor Driver.
- D8: Connected to IN2 of L298N DC Motor Driver.
- D7: Connected to IN1 of L298N DC Motor Driver.
- D6: Connected to ENA of L298N DC Motor Driver.
- D5: Connected to ENB of L298N DC Motor Driver.
- D4: Connected to out of IR Sensor.
- D3: Connected to TRIG of HC-SR04 Ultrasonic Sensor.
- D2: Connected to ECHO of HC-SR04 Ultrasonic Sensor.
L298N DC Motor Driver
- 5V: Connected to 5V of Arduino UNO.
- GND: Connected to GND of Arduino UNO.
- IN1: Connected to D7 of Arduino UNO.
- IN2: Connected to D8 of Arduino UNO.
- IN3: Connected to D9 of Arduino UNO.
- IN4: Connected to D10 of Arduino UNO.
- ENA: Connected to D6 of Arduino UNO.
- ENB: Connected to D5 of Arduino UNO.
- OUT1: Connected to pin 2 of DC Motor.
- OUT2: Connected to pin 1 of DC Motor.
- OUT3: Connected to pin 2 of DC Motor.
- OUT4: Connected to pin 1 of DC Motor.
- 12V: Connected to pin 2 of Rocker Switch (SPST).
DC Motor
- pin 1: Connected to OUT2 of L298N DC Motor Driver.
- pin 2: Connected to OUT1 of L298N DC Motor Driver.
- pin 1: Connected to OUT4 of L298N DC Motor Driver.
- pin 2: Connected to OUT3 of L298N DC Motor Driver.
IR Sensor
- vcc: Connected to 5V of Arduino UNO.
- gnd: Connected to GND of Arduino UNO.
- out: Connected to A0, A1, D12, and D4 of Arduino UNO.
9V Battery
- -: Connected to GND of HC-SR04 Ultrasonic Sensor, IR Sensors, L298N DC Motor Driver, Micro Servo 9G, and 16x2 I2C LCD.
- +: Connected to pin 1 of Rocker Switch (SPST).
Rocker Switch (SPST)
- 1: Connected to + of 9V Battery.
- 2: Connected to 12V of L298N DC Motor Driver.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 5V of Arduino UNO.
- GND: Connected to GND of Arduino UNO.
- TRIG: Connected to D3 of Arduino UNO.
- ECHO: Connected to D2 of Arduino UNO.
16x2 I2C LCD
- GND: Connected to GND of Arduino UNO.
- VCC: Connected to 5V of Arduino UNO.
- SDA: Connected to A4 of Arduino UNO.
- SCL: Connected to A5 of Arduino UNO.
Buzzer
- GND: Connected to GND of Arduino UNO.
- PIN: Connected to D13 of Arduino UNO.
Micro Servo 9G
- GND: Connected to GND of Arduino UNO.
- +5V: Connected to 5V of Arduino UNO.
- PWM: Connected to D11 of Arduino UNO.
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 code that runs repeatedly. You can add your specific logic and functionality within these functions to control the various components connected to the Arduino UNO.