Arduino Nano-Based Battery-Powered Robotic Vehicle 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 Nano microcontroller, a Tower Pro SG90 servo, an HC-SR04 ultrasonic sensor, an L298N DC motor driver, two hobby motors, a rocker switch, and a 18650 Li-Ion battery. The circuit is designed to control the motors and servo based on inputs from the ultrasonic sensor, with power management handled by the rocker switch and battery.
Component List
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
Tower Pro SG90 Servo
- Description: A micro servo motor commonly used in robotics.
- Pins: Signal, +5V, GND
HC-SR04 Ultrasonic Sensor
- Description: A sensor used to measure distance by using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver module for controlling 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
- Description: A small DC motor with a gearbox, commonly used in hobby projects.
- Pins: vcc, GND
Rocker Switch
- Description: A simple on/off switch.
- Pins: 1, 2
18650 Li-Ion Battery
- Description: A rechargeable lithium-ion battery.
- Pins: Positive, Negative
Wiring Details
Arduino Nano
GND connected to:
- HC-SR04 Ultrasonic Sensor (GND)
- Tower Pro SG90 Servo (GND)
- L298N DC Motor Driver (GND)
- 18650 Li-Ion Battery (Negative)
D3 connected to:
- Tower Pro SG90 Servo (Signal)
D5 connected to:
- L298N DC Motor Driver (ENB)
D6 connected to:
- L298N DC Motor Driver (ENA)
D7 connected to:
- L298N DC Motor Driver (IN3)
D8 connected to:
- L298N DC Motor Driver (IN4)
D9 connected to:
- L298N DC Motor Driver (IN1)
D10 connected to:
- L298N DC Motor Driver (IN2)
D11/MOSI connected to:
- HC-SR04 Ultrasonic Sensor (TRIG)
D12/MISO connected to:
- HC-SR04 Ultrasonic Sensor (ECHO)
VIN connected to:
- L298N DC Motor Driver (12V)
- Rocker Switch (2)
5V connected to:
- HC-SR04 Ultrasonic Sensor (VCC)
- Tower Pro SG90 Servo (+5V)
Tower Pro SG90 Servo
Signal connected to:
- Arduino Nano (D3)
+5V connected to:
- Arduino Nano (5V)
GND connected to:
- Arduino Nano (GND)
HC-SR04 Ultrasonic Sensor
GND connected to:
- Arduino Nano (GND)
TRIG connected to:
- Arduino Nano (D11/MOSI)
ECHO connected to:
- Arduino Nano (D12/MISO)
VCC connected to:
- Arduino Nano (5V)
L298N DC Motor Driver
ENB connected to:
- Arduino Nano (D5)
ENA connected to:
- Arduino Nano (D6)
IN3 connected to:
- Arduino Nano (D7)
IN4 connected to:
- Arduino Nano (D8)
IN1 connected to:
- Arduino Nano (D9)
IN2 connected to:
- Arduino Nano (D10)
12V connected to:
- Rocker Switch (2)
- Arduino Nano (VIN)
GND connected to:
- Arduino Nano (GND)
- Tower Pro SG90 Servo (GND)
- 18650 Li-Ion Battery (Negative)
OUT1 connected to:
- Motor Amarillo Motorreductor Hobby (vcc)
OUT2 connected to:
- Motor Amarillo Motorreductor Hobby (GND)
OUT3 connected to:
- Motor Amarillo Motorreductor Hobby (GND)
OUT4 connected to:
- Motor Amarillo Motorreductor Hobby (vcc)
Motor Amarillo Motorreductor Hobby
vcc connected to:
- L298N DC Motor Driver (OUT1)
- L298N DC Motor Driver (OUT4)
GND connected to:
- L298N DC Motor Driver (OUT2)
- L298N DC Motor Driver (OUT3)
Rocker Switch
1 connected to:
- 18650 Li-Ion Battery (Positive)
2 connected to:
- L298N DC Motor Driver (12V)
- Arduino Nano (VIN)
18650 Li-Ion Battery
Positive connected to:
- Rocker Switch (1)
Negative connected to:
- Arduino Nano (GND)
- L298N DC Motor Driver (GND)
- Tower Pro SG90 Servo (GND)
Documented Code
Arduino Nano 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)
This document provides a comprehensive overview of the circuit, including a summary, component list, wiring details, and documented code.