Surilli
Published © LGPL

Servo Motor Control using HC-05 and Surilli GSM

Control the rotation of the Servo Motor by sending commands from Android App to Bluetooth Module HC-05.

BeginnerFull instructions provided15 minutes1,042
Servo Motor Control using HC-05 and Surilli GSM

Things used in this project

Hardware components

Surilli GSM
Surilli GSM
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Servos (Tower Pro MG996R)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Servo Motor Control using HC-05 and Surilli GSM

Code

Servo_Motor_Control_using_Bluetooth_and_Surilli_GSM

C/C++
#include <SoftwareSerial.h> // TX RX software library for bluetooth

#include <Servo.h> // servo library 
Servo myservo; // servo name

int bluetoothTx = 10; // bluetooth tx to 10 pin
int bluetoothRx = 11; // bluetooth rx to 11 pin

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  myservo.attach(9); // attach servo signal wire to pin 9
  //Setup usb serial connection to computer
  Serial.begin(9600);

  //Setup Bluetooth serial connection to android
  bluetooth.begin(9600);
}

void loop()
{
  //Read from bluetooth and write to usb serial
  if(bluetooth.available()> 0 ) // receive number from bluetooth
  {
    int servopos = bluetooth.read(); // save the received number to servopos
    Serial.println(servopos); // serial print servopos current number received from bluetooth
    myservo.write(servopos); // rotate the servo the angle received from the android app
  }


}

Credits

Surilli

Surilli

196 projects • 62 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments