Arduino Servo Control

Arduino Servo


This instructable is about “Controlling Servo Motor via Bluetooth (Arduino Servo with Android)”. In this project we will control a Servo motor with an Android phone via Bluetooth. I first uploaded this in instructables, if you want you can check there CLICK HERE


Step 1: Hardware Required


  • Arduino
  • Servo Motor
  • Jumper Wires
  • Bluetooth Module (HC-06 or HC-05)


Step 2: Connections


Arduino Servo

Make it as mentioned in the circuit Arduino Servo Control. I’m reducing the content because you would feel it easy and would connect them in less time, without reading much. I hate reading & I look at the pictures and understand. Artists need pictures to understand, Have fun connecting.

You will find a ton of videos and information about this so, here I just came to advertise my App which was made with IRONMAN response feature. And you will love the feature it has if you are a marvel Iron-Man fan.


Step 3: Android APP


Here is the android app we going to use to control servo : Android App

Here is the working of the android app though I didn’t connect it with the circuit I just showed you how it works , If someone did it with the circuit please let me know I will publish your video here.


Step 4: Sketch


#include  // TX RX software library for bluetooth
#include  // 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); // roate the servo the angle received from the android app
  }
}

Devil’s Story Board



Leave a Reply

Your email address will not be published. Required fields are marked *