Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an L298N DC motor driver, two DC motors, an HC-SR04 ultrasonic sensor, two IR sensors, an HC-05 Bluetooth module, a rocker switch, and a 18650 Li-Ion battery. The circuit is designed to control the DC motors and read sensor data, with power supplied by the Li-Ion battery.
Component List
Arduino UNO
- Description: 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: Dual H-Bridge motor driver.
- 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 (x2)
- Description: Standard DC motor.
- Pins: pin 1, pin 2
HC-SR04 Ultrasonic Sensor
- Description: Ultrasonic distance sensor.
- Pins: VCC, TRIG, ECHO, GND
IR Sensor (x2)
- Description: Infrared sensor for obstacle detection.
- Pins: out, gnd, vcc
HC-05 Bluetooth Module
- Description: Bluetooth module for wireless communication.
- Pins: EN, VCC, GND, TXD, RXD, STATE
Rocker Switch
- Description: On/Off switch.
- Pins: output, input
18650 Li-Ion Battery
- Description: Rechargeable lithium-ion battery.
- Pins: Positive, Negative
Wiring Details
Arduino UNO
5V connected to:
- HC-05 Bluetooth Module (VCC)
- IR Sensor 1 (vcc)
- IR Sensor 2 (vcc)
- HC-SR04 Ultrasonic Sensor (VCC)
GND connected to:
- HC-05 Bluetooth Module (GND)
- IR Sensor 1 (gnd)
- IR Sensor 2 (gnd)
- HC-SR04 Ultrasonic Sensor (GND)
- 18650 Li-Ion Battery (Negative)
- L298N DC Motor Driver (GND)
Vin connected to:
- 18650 Li-Ion Battery (Positive)
- Rocker Switch (input)
A0 connected to:
A1 connected to:
D11 connected to:
- L298N DC Motor Driver (IN1)
D10 connected to:
- L298N DC Motor Driver (IN2)
D9 connected to:
- L298N DC Motor Driver (IN3)
- HC-SR04 Ultrasonic Sensor (ECHO)
D8 connected to:
- L298N DC Motor Driver (IN4)
- HC-SR04 Ultrasonic Sensor (TRIG)
D6 connected to:
- L298N DC Motor Driver (ENA)
D5 connected to:
- L298N DC Motor Driver (ENB)
D1 connected to:
- HC-05 Bluetooth Module (RXD)
D0 connected to:
- HC-05 Bluetooth Module (TXD)
L298N DC Motor Driver
OUT1 connected to:
OUT2 connected to:
OUT3 connected to:
OUT4 connected to:
12V connected to:
HC-05 Bluetooth Module
VCC connected to:
GND connected to:
RXD connected to:
TXD connected to:
HC-SR04 Ultrasonic Sensor
VCC connected to:
GND connected to:
TRIG connected to:
ECHO connected to:
IR Sensor 1
vcc connected to:
gnd connected to:
out connected to:
IR Sensor 2
vcc connected to:
gnd connected to:
out connected to:
Rocker Switch
input connected to:
- 18650 Li-Ion Battery (Positive)
- Arduino UNO (Vin)
output connected to:
- L298N DC Motor Driver (12V)
18650 Li-Ion Battery
Positive connected to:
- Rocker Switch (input)
- Arduino UNO (Vin)
Negative connected to:
- Arduino UNO (GND)
- L298N DC Motor Driver (GND)
Code Documentation
Arduino UNO Code
void setup() {
}
void loop() {
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and settings, and the loop() function is where you place the main code that runs repeatedly.
Additional Documentation
This section is reserved for any additional documentation or notes related to the code or circuit.