Arduino UNO-Based Battery-Powered Robotic Vehicle with Ultrasonic Sensor and Motor 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, an ultrasonic sensor, a DC motor driver (L298N), two hobby motors, and a 3xAA battery pack. The circuit is designed to control the motors based on input from the ultrasonic sensor, with the Arduino UNO serving as the central controller.
Component List
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
Motor amarillo motorreductor hobby (Motor 1)
- Description: A small DC motor with a gearbox, commonly used in hobby projects.
- Pins: vcc, GND
Motor amarillo motorreductor hobby (Motor 2)
- Description: A small DC motor with a gearbox, commonly used in hobby projects.
- Pins: vcc, GND
3xAA Battery Pack
- Description: A battery pack that holds three AA batteries to provide power to the circuit.
- Pins: VCC, GND
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used for various embedded applications.
- 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
Wiring Details
Ultrasonic Sensor
- +VCC: Connected to Arduino UNO 5V
- GND: Connected to Arduino UNO GND
- Trigger: Connected to Arduino UNO D2
- Echo: Connected to Arduino UNO D3
L298N DC Motor Driver
- GND: Connected to Arduino UNO GND and 3xAA Battery Pack GND
- 5V: Connected to Arduino UNO Vin
- 12V: Connected to 3xAA Battery Pack VCC
- ENA: Connected to Arduino UNO D10
- IN1: Connected to Arduino UNO D9
- IN2: Connected to Arduino UNO D8
- IN3: Connected to Arduino UNO D7
- IN4: Connected to Arduino UNO D6
- ENB: Connected to Arduino UNO D5
- OUT1: Connected to Motor 2 GND
- OUT2: Connected to Motor 2 vcc
- OUT3: Connected to Motor 1 GND
- OUT4: Connected to Motor 1 vcc
Motor amarillo motorreductor hobby (Motor 1)
- vcc: Connected to L298N DC Motor Driver OUT4
- GND: Connected to L298N DC Motor Driver OUT3
Motor amarillo motorreductor hobby (Motor 2)
- vcc: Connected to L298N DC Motor Driver OUT2
- GND: Connected to L298N DC Motor Driver OUT1
3xAA Battery Pack
- VCC: Connected to L298N DC Motor Driver 12V
- GND: Connected to Arduino UNO GND and L298N DC Motor Driver GND
Arduino UNO
- 5V: Connected to Ultrasonic Sensor +VCC
- GND: Connected to Ultrasonic Sensor GND, 3xAA Battery Pack GND, and L298N DC Motor Driver GND
- Vin: Connected to L298N DC Motor Driver 5V
- D2: Connected to Ultrasonic Sensor Trigger
- D3: Connected to Ultrasonic Sensor Echo
- D5: Connected to L298N DC Motor Driver ENB
- D6: Connected to L298N DC Motor Driver IN4
- D7: Connected to L298N DC Motor Driver IN3
- D8: Connected to L298N DC Motor Driver IN2
- D9: Connected to L298N DC Motor Driver IN1
- D10: Connected to L298N DC Motor Driver ENA
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)