Arduino UNO-Based Battery-Powered Robotic Car with Ultrasonic Sensor and Servo Control
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, a servo motor, an ultrasonic sensor, a DC motor driver, two DC motors, and a 3xAAA battery pack. The circuit is designed to control the motors and read sensor data using 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
Servo
- Description: A servo motor used for precise control of angular position.
- Pins: gnd, vcc, pulse
Ultrasonic Sensor
- Description: A sensor used to measure distance by using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
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
DC Motor (Motor 1)
- Description: A simple DC motor.
- Pins: pin 1, pin 2
DC Motor (Motor 2)
- Description: A simple DC motor.
- Pins: pin 1, pin 2
3xAAA Battery with Switch (bare wire)
- Description: A battery pack with a switch, providing power to the circuit.
- Pins: POS, NEG
Wiring Details
Arduino UNO
- 5V: Connected to vcc of Servo and +VCC of Ultrasonic Sensor
- GND: Connected to gnd of Servo, GND of Ultrasonic Sensor, GND of L298N DC Motor Driver, and NEG of 3xAAA Battery
- Vin: Connected to 12V of L298N DC Motor Driver and POS of 3xAAA Battery
- D11: Connected to ENA of L298N DC Motor Driver
- D10: Connected to IN1 of L298N DC Motor Driver
- D9: Connected to IN2 of L298N DC Motor Driver
- D8: Connected to IN3 of L298N DC Motor Driver
- D7: Connected to IN4 of L298N DC Motor Driver
- D6: Connected to ENB of L298N DC Motor Driver
- D5: Connected to pulse of Servo
- D3: Connected to Echo of Ultrasonic Sensor
- D2: Connected to Trigger of Ultrasonic Sensor
Servo
- vcc: Connected to 5V of Arduino UNO
- gnd: Connected to GND of Arduino UNO
- pulse: Connected to D5 of Arduino UNO
Ultrasonic Sensor
- +VCC: Connected to 5V of Arduino UNO
- GND: Connected to GND of Arduino UNO
- Echo: Connected to D3 of Arduino UNO
- Trigger: Connected to D2 of Arduino UNO
L298N DC Motor Driver
- GND: Connected to GND of Arduino UNO and NEG of 3xAAA Battery
- 12V: Connected to Vin of Arduino UNO and POS of 3xAAA Battery
- ENA: Connected to D11 of Arduino UNO
- IN1: Connected to D10 of Arduino UNO
- IN2: Connected to D9 of Arduino UNO
- IN3: Connected to D8 of Arduino UNO
- IN4: Connected to D7 of Arduino UNO
- ENB: Connected to D6 of Arduino UNO
- OUT1: Connected to pin 2 of DC Motor 1
- OUT2: Connected to pin 1 of DC Motor 1
- OUT3: Connected to pin 2 of DC Motor 2
- OUT4: Connected to pin 1 of DC Motor 2
DC Motor (Motor 1)
- pin 1: Connected to OUT2 of L298N DC Motor Driver
- pin 2: Connected to OUT1 of L298N DC Motor Driver
DC Motor (Motor 2)
- pin 1: Connected to OUT4 of L298N DC Motor Driver
- pin 2: Connected to OUT3 of L298N DC Motor Driver
3xAAA Battery with Switch (bare wire)
- POS: Connected to 12V of L298N DC Motor Driver and Vin of Arduino UNO
- NEG: Connected to GND of L298N DC Motor Driver and 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)
This document provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code running on the Arduino UNO.