JANAK13
Published © GPL3+

Bluetooth Controlled Servo

This project shows how to control a servo motor with a smartphone via Bluetooth.

IntermediateFull instructions provided31,241
Bluetooth Controlled Servo

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit

This is how the circuit has to be made.

Code

Bluetooth controlled servo

C/C++
this code id to uploaded on to the Arduino uno.
#include<SoftwareSerial.h>
#include<Servo.h>
Servo x;
int bttx=9;    //tx of bluetooth module is connected to pin 9 of arduino
int btrx=10;    //rx of bluetooth module is connected to pin 10 of arduino
SoftwareSerial bluetooth(bttx,btrx);
void setup()
{
  x.attach(11);        // servo is connected to pin 11 of arduino
  Serial.begin(9600);
  bluetooth.begin(9600);
}
void loop()
{
  if(bluetooth.available()>0)    //if bluetooth module is transmitting data
  {
    int pos=bluetooth.read(); // store the data in pos variable
    Serial.println(pos);
    x.write(pos);             //move servo head to the given position
  }
}

Credits

JANAK13

JANAK13

6 projects • 37 followers

Comments