Arduino Mega 2560 Bluetooth-Controlled Robotic Car with Voice Recognition and Ultrasonic Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino Mega 2560 microcontroller, various sensors, actuators, and communication modules. The circuit is designed to interface with multiple components such as an LED, resistors, motors, a Bluetooth module, a voice recognition module, and an ultrasonic sensor. The document includes a component list, wiring details, and the embedded code used in the microcontroller.
Component List
LED: Two Pin (green)
- Description: A green LED with two pins.
- Pins: Cathode, Anode
Resistor
- Description: A resistor with a resistance of 200 Ohms.
- Pins: Pin1, Pin2
- Properties:
- Resistance: 200 Ohms
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2 PWM, D3 PWM, D4 PWM, D5 PWM, D6 PWM, D7 PWM, D8 PWM, D9 PWM, D10 PWM, D11 PWM, D12 PWM, D13 PWM, AREF, SDA, SCL, D52, D50, D48, D46, D44, D42, D40, D38, D36, D34, D32, D30, D28, D26, D24, D22, D53, D51, D49, D47, D45, D43, D41, D39, D37, D35, D33, D31, D29, D27, D25, D23
HC-05 Bluetooth Module
- Description: A Bluetooth module for wireless communication.
- Pins: Key, VCC, GND, TXD, RXD, State
L293D Motor Driver
- Description: A motor driver IC to control DC motors.
- Pins: B1, B2, A1, EN_B, EN_A, A2, GND, VCC, +, -, MPIN_1, MPIN_2, MPIN_3, MPIN_4
DC Mini Metal Gear Motor
- Description: A small DC motor with metal gears.
- Pins: IN1, IN2
9V Battery
- Description: A 9V battery for power supply.
- Pins: -, +
Voice Recognition Module
- Description: A module for voice recognition.
- Pins: GND, VCC, RDX, RTX
Ultrasonic Sensor
- Description: A sensor for measuring distance using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 2, Pin 1, Pin 3, Pin 4
Wiring Details
LED: Two Pin (green)
- Cathode: Connected to GND of Arduino Mega 2560, 9V Battery, Ultrasonic Sensor, HC-05 Bluetooth Module, Voice Recognition Module, and L293D Motor Driver.
- Anode: Connected to Pin2 of the Resistor.
Resistor
- Pin1: Connected to D8 PWM of Arduino Mega 2560.
- Pin2: Connected to Anode of the LED.
Arduino Mega 2560
- D8 PWM: Connected to Pin1 of the Resistor.
- GND: Connected to Cathode of the LED, GND of 9V Battery, Ultrasonic Sensor, HC-05 Bluetooth Module, Voice Recognition Module, and L293D Motor Driver.
- VIN: Connected to + of the 9V Battery.
- D19/RX1: Connected to TXD of the HC-05 Bluetooth Module.
- D18/TX1: Connected to RXD of the HC-05 Bluetooth Module.
- D2 PWM: Connected to EN_B of the L293D Motor Driver.
- D3 PWM: Connected to EN_A of the L293D Motor Driver.
- D13 PWM: Connected to Echo of the Ultrasonic Sensor.
- D52: Connected to A1 of the L293D Motor Driver.
- D50: Connected to A2 of the L293D Motor Driver.
- D48: Connected to B2 of the L293D Motor Driver.
- D46: Connected to B1 of the L293D Motor Driver.
- D38: Connected to Trigger of the Ultrasonic Sensor.
- D36: Connected to RDX of the Voice Recognition Module.
- D34: Connected to RTX of the Voice Recognition Module.
HC-05 Bluetooth Module
- GND: Connected to GND of Arduino Mega 2560.
- VCC: Connected to +VCC of the Ultrasonic Sensor, VCC of the 9V Battery, Voice Recognition Module, and L293D Motor Driver.
- TXD: Connected to D19/RX1 of Arduino Mega 2560.
- RXD: Connected to D18/TX1 of Arduino Mega 2560.
L293D Motor Driver
- GND: Connected to GND of Arduino Mega 2560.
- VCC: Connected to +VCC of the Ultrasonic Sensor, VCC of the 9V Battery, HC-05 Bluetooth Module, and Voice Recognition Module.
- EN_B: Connected to D2 PWM of Arduino Mega 2560.
- EN_A: Connected to D3 PWM of Arduino Mega 2560.
- A1: Connected to D52 of Arduino Mega 2560.
- A2: Connected to D50 of Arduino Mega 2560.
- B2: Connected to D48 of Arduino Mega 2560.
- B1: Connected to D46 of Arduino Mega 2560.
- MPIN_1: Connected to IN2 of DC Mini Metal Gear Motor.
- MPIN_2: Connected to IN1 of DC Mini Metal Gear Motor.
- MPIN_3: Connected to IN2 of DC Mini Metal Gear Motor.
- MPIN_4: Connected to IN1 of DC Mini Metal Gear Motor.
DC Mini Metal Gear Motor
- IN1: Connected to MPIN_2 and MPIN_4 of L293D Motor Driver.
- IN2: Connected to MPIN_1 and MPIN_3 of L293D Motor Driver.
9V Battery
- -: Connected to GND of Arduino Mega 2560.
- +: Connected to VIN of Arduino Mega 2560.
Voice Recognition Module
- GND: Connected to GND of Arduino Mega 2560.
- VCC: Connected to +VCC of the Ultrasonic Sensor, VCC of the 9V Battery, HC-05 Bluetooth Module, and L293D Motor Driver.
- RDX: Connected to D36 of Arduino Mega 2560.
- RTX: Connected to D34 of Arduino Mega 2560.
Ultrasonic Sensor
- GND: Connected to GND of Arduino Mega 2560.
- +VCC: Connected to VCC of the 9V Battery, HC-05 Bluetooth Module, Voice Recognition Module, and L293D Motor Driver.
- Trigger: Connected to D38 of Arduino Mega 2560.
- Echo: Connected to D13 PWM of Arduino Mega 2560.
Pushbutton
- Pin 2: Not connected.
- Pin 1: Not connected.
- Pin 3: Not connected.
- Pin 4: Not connected.
Documented Code
Arduino Mega 2560 Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino Mega 2560. The setup() function is used to initialize any settings, and the loop() function contains the main code that runs repeatedly.