Arduino UNO-Based Robotic Car with Ultrasonic Obstacle Detection and Motor Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller, an L298N DC motor driver, two hobby gearmotors, an HC-SR04 ultrasonic sensor, and a Regulator XL 4015 with an LCD display. The Arduino UNO controls the motor driver to operate the gearmotors and reads data from the ultrasonic sensor. The regulator provides the necessary power to the motor driver.
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
Hobby Gearmotor with 48:1 Gearbox (2 units)
- Description: A small DC motor with a 48:1 gearbox.
- Pins: pin 1, pin 2
Regulator XL 4015 with LCD Display with Heatsink
- Description: A voltage regulator with an LCD display and heatsink.
- Pins: IN +, IN -, OUT +, OUT -
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND
Wiring Details
Arduino UNO
- 5V connected to 5V of L298N DC motor driver and VCC of HC-SR04 Ultrasonic Sensor
- GND connected to GND of L298N DC motor driver and GND of HC-SR04 Ultrasonic Sensor
- D12 connected to ECHO of HC-SR04 Ultrasonic Sensor
- D11 connected to TRIG of HC-SR04 Ultrasonic Sensor
- 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
- D5 connected to ENB of L298N DC motor driver
- D3 connected to ENA of L298N DC motor driver
L298N DC Motor Driver
- 5V connected to 5V of Arduino UNO
- GND connected to OUT - of Regulator XL 4015 with LCD Display with Heatsink and GND of Arduino UNO
- IN4 connected to D10 of Arduino UNO
- IN3 connected to D9 of Arduino UNO
- IN2 connected to D8 of Arduino UNO
- IN1 connected to D7 of Arduino UNO
- ENB connected to D5 of Arduino UNO
- ENA connected to D3 of Arduino UNO
- OUT1 connected to pin 2 of Hobby Gearmotor with 48:1 gearbox
- OUT2 connected to pin 1 of Hobby Gearmotor with 48:1 gearbox
- 12V connected to OUT + of Regulator XL 4015 with LCD Display with Heatsink
- OUT3 connected to pin 1 of Hobby Gearmotor with 48:1 gearbox
- OUT4 connected to pin 2 of Hobby Gearmotor with 48:1 gearbox
Hobby Gearmotor with 48:1 Gearbox
- pin 2 of one motor connected to OUT1 of L298N DC motor driver
- pin 1 of one motor connected to OUT2 of L298N DC motor driver
- pin 1 of the other motor connected to OUT3 of L298N DC motor driver
- pin 2 of the other motor connected to OUT4 of L298N DC motor driver
Regulator XL 4015 with LCD Display with Heatsink
- OUT - connected to GND of L298N DC motor driver and GND of Arduino UNO
- OUT + 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
- ECHO connected to D12 of Arduino UNO
- TRIG 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:
}
Documentation (documentation.txt)