Arduino UNO Controlled Robot with Bluetooth, Ultrasonic Sensing, and IR Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control a pair of DC motors using an Arduino UNO as the main microcontroller. The circuit includes a Bluetooth module for wireless communication, an ultrasonic sensor for distance measurement, an IR sensor for object detection, a servo motor for precise angular control, and a motor driver to handle the high current required by the DC motors. The power source is a single 18650 Li-Ion battery.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
L298N DC Motor Driver
- A module that can control up to two DC motors with individual speed and direction control, perfect for driving wheels of a robot.
HC-05 Bluetooth Module
- A wireless communication module that can be used to exchange data with other Bluetooth devices such as smartphones or computers.
HC-SR04 Ultrasonic Sensor
- A sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
18650 Li-Ion Battery
- A rechargeable battery that provides a power source for the circuit.
IR Sensor
- A sensor that detects infrared light, often used in proximity switches and object detection.
Tower Pro SG90 Servo
- A small and lightweight servo motor capable of precise control of angular position.
Motor Amarillo Motorreductor Hobby (x2)
- A yellow hobby gear motor that is commonly used in small robotics and DIY projects.
Wiring Details
Arduino UNO
GNDconnected to the common ground net.Vinconnected to the positive voltage net.A0connected toENAon the L298N motor driver.A1connected toENBon the L298N motor driver.A4connected toTRIGon the HC-SR04 ultrasonic sensor.A5connected toECHOon the HC-SR04 ultrasonic sensor.D10connected toSignalon the Tower Pro SG90 servo.D9connected toIN1on the L298N motor driver.D8connected toIN2on the L298N motor driver.D7connected toIN3on the L298N motor driver.D6connected toIN4on the L298N motor driver.D5connected toouton the IR sensor.D1connected toRXDon the HC-05 Bluetooth module.D0connected toTXDon the HC-05 Bluetooth module.
L298N DC Motor Driver
GNDconnected to the common ground net.12Vconnected to the positive voltage net.ENAandENBconnected toA0andA1on the Arduino UNO for speed control.IN1,IN2,IN3,IN4connected toD9,D8,D7,D6on the Arduino UNO for direction control.OUT1,OUT2,OUT3,OUT4connected to the two Motor Amarillo motorreductor hobby motors.
HC-05 Bluetooth Module
GNDconnected to the common ground net.VCCconnected to the positive voltage net.TXDconnected toD0on the Arduino UNO.RXDconnected toD1on the Arduino UNO.
HC-SR04 Ultrasonic Sensor
GNDconnected to the common ground net.VCCconnected to the positive voltage net.TRIGconnected toA4on the Arduino UNO.ECHOconnected toA5on the Arduino UNO.
18650 Li-Ion Battery
Negativeconnected to the common ground net.Positiveconnected to the positive voltage net.
IR Sensor
gndconnected to the common ground net.vccconnected to the positive voltage net.outconnected toD5on the Arduino UNO.
Tower Pro SG90 Servo
GNDconnected to the common ground net.+5Vconnected to the positive voltage net.Signalconnected toD10on the Arduino UNO.
Motor Amarillo Motorreductor Hobby
- One motor's
vccconnected toOUT1andGNDtoOUT2on the L298N motor driver. - The other motor's
vccconnected toOUT4andGNDtoOUT3on the L298N motor driver.
Documented Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The provided code is a template for the Arduino UNO microcontroller. The setup() function is called once when the program starts and is used to initialize the settings. The loop() function is called repeatedly and contains the main logic of the program. The actual implementation details need to be filled in based on the specific requirements of the circuit's operation.