Arduino UNO-Based Battery-Powered Robotic Car with Ultrasonic Sensors and DC Motors
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, two ultrasonic sensors, a DC motor driver, two DC motors, a pushbutton, and a power source consisting of two 18650 Li-ion batteries. The circuit is designed to control the DC motors based on input from the ultrasonic sensors and the pushbutton.
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 that allows control of two 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
Ultrasonic Sensor
- Description: A sensor that measures distance by using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
18650 Li-ion Battery x 2
- Description: A power source consisting of two 18650 Li-ion batteries.
- Pins: +, -
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
Wiring Details
Arduino UNO
- GND: Connected to GND of both Ultrasonic Sensors, L298N DC Motor Driver, and Pushbutton.
- 5V: Connected to +VCC of both Ultrasonic Sensors.
- Vin: Connected to 5V of L298N DC Motor Driver.
- D2: Connected to Pin 2 (in) of Pushbutton.
- D4: Connected to Trigger of Ultrasonic Sensor.
- D5: Connected to Echo of Ultrasonic Sensor.
- D6: Connected to Trigger of Ultrasonic Sensor.
- D7: Connected to Echo of Ultrasonic Sensor.
- D8: Connected to IN1 and IN3 of L298N DC Motor Driver.
- D9: Connected to IN2 and IN4 of L298N DC Motor Driver.
- D10: Connected to ENA of L298N DC Motor Driver.
- D11: Connected to ENB of L298N DC Motor Driver.
L298N DC Motor Driver
- GND: Connected to GND of Arduino UNO and - of 18650 Li-ion Battery.
- 5V: Connected to Vin of Arduino UNO.
- 12V: Connected to + of 18650 Li-ion Battery.
- ENA: Connected to D10 of Arduino UNO.
- ENB: Connected to D11 of Arduino UNO.
- IN1: Connected to D8 of Arduino UNO.
- IN2: Connected to D9 of Arduino UNO.
- IN3: Connected to D8 of Arduino UNO.
- IN4: Connected to D9 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.
Ultrasonic Sensor
- GND: Connected to GND of Arduino UNO.
- +VCC: Connected to 5V of Arduino UNO.
- Trigger: Connected to D4 and D6 of Arduino UNO.
- Echo: Connected to D5 and D7 of Arduino UNO.
DC Motor
- pin 1: Connected to OUT2 and OUT4 of L298N DC Motor Driver.
- pin 2: Connected to OUT1 and OUT3 of L298N DC Motor Driver.
18650 Li-ion Battery x 2
- +: Connected to 12V of L298N DC Motor Driver.
- -: Connected to GND of L298N DC Motor Driver and Arduino UNO.
Pushbutton
- Pin 2 (in): Connected to D2 of Arduino UNO.
- Pin 4 (out): Connected to GND 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:
}
Additional Documentation (documentation.txt)