Arduino-Controlled Bluetooth Robotic Vehicle with Ultrasonic Sensor and MPU6050 Gyroscope
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
The circuit in question appears to be a microcontroller-based system with peripheral components including motor drivers, DC motors, sensors, and communication modules. The primary control is handled by two Arduino UNO microcontrollers, which interface with an L298N DC motor driver to control two DC motors. Sensory input is provided by an HC-SR04 ultrasonic sensor and an MPU6050 accelerometer and gyroscope. Communication capabilities are enabled through Bluetooth HC-06 modules. Power is supplied by a battery pack and a 9V battery.
Component List
Microcontrollers
- Arduino UNO: A microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
Motor Drivers
- L298N DC Motor Driver: A high-power motor driver capable of driving up to two DC motors.
Motors
- DC Motor: An electric motor that runs on direct current (DC) electricity.
Sensors
- HC-SR04 Ultrasonic Sensor: An ultrasonic distance sensor that can measure distances by emitting ultrasonic waves.
- MPU6050 Accelerometer + Gyroscope: A sensor module that provides acceleration and gyroscopic measurements.
Communication Modules
- Bluetooth HC-06: A Bluetooth module that allows for wireless communication.
Power Supplies
- Battery Pack: A power source for the circuit.
- 9V Battery: A standard 9V battery providing power to the circuit.
Wiring Details
Arduino UNO
- GND: Connected to the ground of the Bluetooth HC-06, L298N motor driver, battery pack, and HC-SR04 sensor.
- 5V: Supplies power to the Bluetooth HC-06 and HC-SR04 sensor.
- Vin: Connected to the 5V output of the L298N motor driver.
- D2: Connected to the TRIG pin of the HC-SR04 sensor.
- D3: Connected to the ECHO pin of the HC-SR04 sensor.
- D4: Connected to the RXD pin of the Bluetooth HC-06.
- D5: Connected to the TXD pin of the Bluetooth HC-06.
L298N DC Motor Driver
- GND: Connected to the ground of the Arduino UNO, Bluetooth HC-06, battery pack, and HC-SR04 sensor.
- 12V: Connected to the positive terminal of the battery pack.
- 5V: Connected to the Vin pin of the Arduino UNO.
- OUT1, OUT2: Connected to the two pins of one DC motor.
- OUT3, OUT4: Connected to the two pins of the other DC motor.
DC Motors
- Motor 1: Connected to OUT1 and OUT2 of the L298N motor driver.
- Motor 2: Connected to OUT3 and OUT4 of the L298N motor driver.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to the 5V output of the Arduino UNO.
- GND: Connected to the ground of the Arduino UNO.
- TRIG: Connected to pin D2 of the Arduino UNO.
- ECHO: Connected to pin D3 of the Arduino UNO.
Bluetooth HC-06
- VCC: Connected to the 5V output of the Arduino UNO.
- GND: Connected to the ground of the Arduino UNO.
- TXD: Connected to pin D5 of the Arduino UNO.
- RXD: Connected to pin D4 of the Arduino UNO.
MPU6050 Accelerometer + Gyroscope
- VCC: Connected to the 5V output of the Arduino UNO.
- GND: Connected to the ground of the Arduino UNO.
- SCL: Connected to the SCL pin of the Arduino UNO.
- SDA: Connected to the SDA pin of the Arduino UNO.
Battery Pack
- +: Connected to the 12V input of the L298N motor driver.
- -: Connected to the ground of the Arduino UNO, Bluetooth HC-06, L298N motor driver, and HC-SR04 sensor.
9V Battery
- +: Connected to the Vin pin of the Arduino UNO.
- -: Connected to the ground of the Arduino UNO.
Documented Code
Arduino UNO (Primary Controller)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Arduino UNO (Secondary Controller)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code snippets are templates and do not contain specific logic for controlling the motors, reading sensors, or handling Bluetooth communication. These functionalities need to be implemented according to the requirements of the application.