Introduction
- In this article, I will explain about controlling the servo motor by using the Bluetooth Module
- It will be controlled by using the Bluetooth module of the ON/OFF switch.
Parts Of Lists
- Arduino Mega 2560.
- Bluetooth
- Servo Motor
- Bread Board
- Hook Up wires
Connection
Step 1
Connect the Arduino Mega 2560 to Bluetooth Module,
- Connect the Vcc of the Bluetooth to the 5v of the Arduino Mega 2560
- Connect the gnd of the Bluetooth to the gnd of the Arduino Mega 2560
- Connect the Tx of the Bluetooth to the RX of the Arduino Mega 2560
- Connect the Rx of the Bluetooth to the TX of the Arduino Mega 2560
Step 2
Connect the ArduinoMega2560 To Servo Motor
- Connect the Vcc of the Servo Motor to the 5v of the ArduinoMega2560
- Connect the gnd of the Bluetooth to the Gnd of the ArduinoMega2560
- Connect the Vin of the Bluetooth to the 09 of the ArduinoMega2560
Programming
- #include Servo myservo;
- // create servo object to control a servo
- // a maximum of eight servo objects can be created
- int pos = 0; // variable to store the servo position
- int motor = 0;
- void setup()
- {
- Serial.begin(9600); // initialize serial:
- myservo.attach(9); // attaches the servo on pin 9 to the servo object
- Serial.print("Arduino control Servo Motor Connected OK");
- Serial.print('\n');
- }
- void loop()
- {
- // if there's any serial available, read it:
- while (Serial.available() > 0)
- {
- // look for the next valid integer in the incoming serial stream:
- motor = Serial.parseInt();
- // do it again:
- pos = Serial.parseInt();
- // look for the newline. That's the end of your sentence:
- if (Serial.read() == '\n')
- {
- myservo.write(pos); // tell servo to go to position in variable 'pos'
- delay(15); // waits 15ms for the servo to reach the position
- // print the three numbers in one string as hexadecimal:
- }
- }
- }
Explanation
- First, download the Bluetooth App in the Playstore in Google
- It can be applied for the Bluetooth connection then it will run in the servo motor.
- It will run in the ON/ OFF mode when the on button is touched the motor is ON.
- When the OFF BUTTON is touched the motor is OFF.


Sr KarthigaPosted Sep 4, 2016, 9:40 PM EDT
Thank you sopi
Shobana JPosted Jul 8, 2016, 12:12 AM EDT
Nice share..good one
Sr KarthigaPosted Jun 8, 2016, 11:06 PM EDT
thank you santhakumar sir
Santhakumar MunuswamyPosted Jun 8, 2016, 8:42 PM EDT
Thank you for nice share
Sr KarthigaPosted Jun 7, 2016, 5:17 AM EDT
thank you ssonu chaudhary sis
Sr KarthigaPosted Jun 7, 2016, 5:17 AM EDT
thank you vignesh mani sir
Sr KarthigaPosted Jun 7, 2016, 5:16 AM EDT
thank you raja ganapathy sir
Sr KarthigaPosted Jun 7, 2016, 5:16 AM EDT
thank you debasis saha sir
Sonu ChaudharyPosted Jun 6, 2016, 5:44 AM EDT
good one...
Vignesh ManiTOP 100Posted Jun 6, 2016, 1:31 AM EDT
Nice article
RajaPosted Jun 5, 2016, 8:21 PM EDT
Great article...
Debasis SahaTOP 100Posted Jun 5, 2016, 8:19 PM EDT
Good One..