Arduino Control DC Motor Via Bluetooth
Maybe your like
Summary of Arduino Control DC Motor via Bluetooth
This project demonstrates controlling a DC motor using an Arduino and a smartphone via a Bluetooth module (HC-05). By sending commands ('0', '1', '2') through a Bluetooth terminal app like BlueTerm, you can turn the motor off, rotate it to the right, or rotate it to the left. The L293D motor driver IC interfaces the motor with Arduino. Proper wiring—connecting Bluetooth TX to Arduino RX and vice versa—is critical, and RX/TX cables should be disconnected when uploading code. The project is an excellent introduction to motor control, Bluetooth communication, and Arduino interfacing.Parts used in the Arduino Control DC Motor via Bluetooth:
- Arduino Uno
- Bluetooth Module (HC-05)
- Smartphone (Android) with BlueTerm application
- L293D Motor Driver IC
- DC Motor
- Breadboard
- Jumper Cables
Hi guys, In this project we will control a DC motor with a smartphone via bluetooth. This project is great to learn more about: -DC motor -Interfacing Arduino with your smartphone -Bluetooth module -L293D
you can visit my website for more electronic projects, interesting news and tips: http://randomnerdtutorials.wordpress.com/
Step 2: Schematics and common mistakes
Two common mistakes: -You need to remove the RX and TX cables when you’re uploading the sketch to your Arduino. -Sometimes people connect the TX from the bluetooth module to the TX of the Arduino… that’s wrong and it won’t work. Make sure you connect it properly, the TX into RX and the RX into the TX.
Note: If the HC-05 Bluetooth Module asks for a password, It’s ‘1234’.
Step 3: Arduino Code
/** created by Rui Santos, http://randomnerdtutorials.wordpress.com* Control DC motor with Smartphone via bluetooth* 2013*/int motorPin1 = 3; // pin 2 on L293D ICint motorPin2 = 4; // pin 7 on L293D ICint enablePin = 5; // pin 1 on L293D ICint state;int flag=0; //makes sure that the serial only prints once the statevoid setup() {// sets the pins as outputs:pinMode(motorPin1, OUTPUT);pinMode(motorPin2, OUTPUT);pinMode(enablePin, OUTPUT);// sets enablePin high so that motor can turn on:digitalWrite(enablePin, HIGH);// initialize serial communication at 9600 bits per second:Serial.begin(9600);}void loop() {//if some date is sent, reads it and saves in stateif(Serial.available() > 0){state = Serial.read();flag=0;}// if the state is ‘0’ the DC motor will turn offif (state == ‘0’) {digitalWrite(motorPin1, LOW); // set pin 2 on L293D lowdigitalWrite(motorPin2, LOW); // set pin 7 on L293D lowif(flag == 0){Serial.println(“Motor: off”);flag=1;}}// if the state is ‘1’ the motor will turn rightelse if (state == ‘1’) {digitalWrite(motorPin1, LOW); // set pin 2 on L293D lowdigitalWrite(motorPin2, HIGH); // set pin 7 on L293D highif(flag == 0){Serial.println(“Motor: right”);flag=1;}}// if the state is ‘2’ the motor will turn leftelse if (state == ‘2’) {digitalWrite(motorPin1, HIGH); // set pin 2 on L293D highdigitalWrite(motorPin2, LOW); // set pin 7 on L293D lowif(flag == 0){Serial.println(“Motor: left”);flag=1;}}}For the android communication with our bluetooth module I’ve used the BlueTerm app, It’s completely free, so you just need to go to “Play store” and download it. Then you just need to connect your smarthphone with the bluetooth module. Remember to remove the TX and RX cables. (you can see in youtube video below how that’s done).
Step 4: Final Product
I’ve only set 3 commands to control the DC motor:
’0′ – Turns off the DC motor ’1′ – DC motor rotates to right ’2′ – DC motor rotates to left
Check this video to see the circuit in action! you can visit my website for more electronic projects, interesting news and tips: http://randomnerdtutorials.wordpress.com/
Major Components in Project1x Arduino Uno 1x Bluetooth Module (for example: HC-05) 1x Smartphone (any Android will work) BlueTerm application 1x L293D IC 1x DC motor 1x Breadboard Jumper CablesFor more detail: Arduino Control DC Motor via Bluetooth
Tag » Arduino - Control 4 Dc Motor Via Bluetooth Code
-
PWM And Direction Control Of A DC Motor Via Bluetooth
-
4 Wheeled Bluetooth Controlled Rc Car - Arduino Project Hub
-
Arduino - Control DC Motor Via Bluetooth | Random Nerd Tutorials
-
Arduino - Control DC Motor Via Bluetooth : 4 Steps (with Pictures)
-
Arduino - Control DC Motor Via Bluetooth - YouTube
-
Control 2 DC Motors Via Bluetooth And Arduino - Microcontrollers Lab
-
Motor Controlling With HC-05 - Robo India || Tutorials || Learn Arduino
-
[PDF] Arduino-based DC Motor Control System Using Bluetooth Module
-
Arduino – Control DC Motor Via Bluetooth - Open Electronics
-
DC Motor Speed Control Using The Bluetooth-based Android App
-
(PDF) Dc Motor Control System Through Android Application Using ...
-
Arduino - Control DC Motor Via Bluetooth - Pinterest
-
Arduino Motor Control Module(Motor Speed Controller Via Bluetooth ...
-
[PDF] Dc Motor Control System Through Android Application Using Arduino ...