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;
-
-
-
-
- int pos = 0;
- int motor = 0;
- void setup()
- {
- Serial.begin(9600);
- myservo.attach(9);
- Serial.print("Arduino control Servo Motor Connected OK");
- Serial.print('\n');
- }
- void loop()
- {
-
- while (Serial.available() > 0)
- {
-
-
- motor = Serial.parseInt();
-
- pos = Serial.parseInt();
-
- if (Serial.read() == '\n')
- {
- myservo.write(pos);
- delay(15);
-
-
- }
- }
- }
Explanation
- First download the bluetooth App in the Playstore in Google
- It can be applied for the buetooth 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.