loading

If you are looking to make Android app to control a servo motor, this is a perfect instructable for you, here you can follow a step by step procedure video to know how to make an android app using MIT app inventor and to control a servo motor.

Step 1: Circuit Diagram

I've used 3 components here

1. Arduino uno

2. HC-05 Bluetooth Module

3. Servo motor

Connect the components according to the circuit diagram.

Step 2: Program Your Arduino

#include

#include

Servo myservo;

int bluetoothTx = 10;

int bluetoothRx = 11;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()

{

myservo.attach(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 )

{

int servopos = bluetooth.read();

Serial.println(servopos);

myservo.write(servopos);

}

}

Step 3: Create Android App

Follow the video below and complete the program for creating your app.

After completing the Program in MIT app inventor, go to Build and select App( save .apk to my computer)

Transfer the file to your android mobile phone or tablet.

Step 4: Follow These Steps If the App Not Install on Your Android Device

go to setting in your android mobile select security and move to Device administration and give access to allow install app from unknown sources.

IF you like this ible, please also check other projects using MIT app inventor here :http://mitappsinventor.blogspot.com

subscribe to my YouTube channel here: https://www.youtube.com/channel/UCjlg6Eq1XVxz95qJO...

Can anyone make a step by step video and upload it cause we are not able to connect our mg 958 hi torque digital servo motor.
<p>Thanks for nice projekt. I got it to pair with the phone. the first buttonpress send value to the Arduin, i checkt in the serialmonitor, and the servo moved. But the second or more buttonpress send values but the servo didnt move? any idies?</p>
<p>Arduino: 1.6.5 (Windows 7), Board: &quot;Gizduino (mini) w/ ATmega328&quot;</p><p>Build options changed, rebuilding all</p><p>sketch_sep20a:1: error: #include expects &quot;FILENAME&quot; or &lt;FILENAME&gt;</p><p>sketch_sep20a:3: error: #include expects &quot;FILENAME&quot; or &lt;FILENAME&gt;</p><p>sketch_sep20a:5: error: 'Servo' does not name a type</p><p>sketch_sep20a:11: error: 'SoftwareSerial' does not name a type</p><p>sketch_sep20a.ino: In function 'void setup()':</p><p>sketch_sep20a:17: error: 'myservo' was not declared in this scope</p><p>sketch_sep20a:25: error: 'bluetooth' was not declared in this scope</p><p>sketch_sep20a.ino: In function 'void loop()':</p><p>sketch_sep20a:35: error: 'bluetooth' was not declared in this scope</p><p>sketch_sep20a:43: error: 'myservo' was not declared in this scope</p><p>#include expects &quot;FILENAME&quot; or &lt;FILENAME&gt;</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p>
<p>i think,only god can save u</p>
<p>hey bhagwaan</p>
<p>Hello! I think you need to include this bibliotheques: </p><p>#include &lt;SoftwareSerial.h&gt;</p><p>#include &lt;Servo.h&gt; </p>
<p>Hello Magesh! Thank you for this tutorial. After some noob mistakes (HC-05 not paired with phone) I was able to make this work. I went with your slider control version of APP. </p><p>For other begginers:</p><p>1) After starting bluetooth, pair phone with HC-05 module, it will ask you for PIN. Mine was &quot;1234&quot; without quotes.</p><p>2) After that I could see the MAC adress of HC-05 in application and connect with success.</p><p>Otherwise I got ERROR 507 in app.</p><p>Also little upgrade - because of buzz/jitter of servo motor (MG90S) I used capacitor paralel with positive and ground lines (2200uF (or higher was recommended-&gt;3300uf), had only big 35V one laying around, if you use 5V power supply 6,3V should be enough). This solved the issue. </p><p>Often got disconnected with ERROR 516 (&quot;broken pipe&quot;) and APP crashing, on some forum found this solution, that disconnects bluetooth in app without crashing. See 2nd picture for blocks, that need to be added.</p>
<p>I build this circuit and the program. The android find bluetooth device HC-05, but my app give always &quot;non connect&quot;. I did exactly as the video tutorial. Someone had the same problem? Tanks for help-me!</p>
<p>Hello, had also problem with connection:</p><p>1) After starting bluetooth, pair phone with HC-05 module, it will ask you for PIN. Mine was &quot;1234&quot; without quotes.</p><p>2) After that I could see the MAC adress of HC-05 in application and connect with success</p>
<p>hi! i can't connect the bluetooth to my phone. it says : </p><p>&quot;error 515 not connected to a bluetooth device&quot; . can you help me please with a advice?...</p>
<p>do you know how to do it with wifi?</p>
<p>do you know how to do it with wifi?</p>
<p>can I ask ? what is the purpose of the timer in the android app ?</p><p>im newbie to this, i want to make this kind of project for my school project.</p><p>pls help</p>
<p>Hi. Can you please upload an App to control more than one?</p>
<p>where is this link of the web site that had used to make your program!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1</p>
<p>ok sweet thanks</p>
<p>how would i control 2 servo motors at the same time with this</p>
<p>http://mitappsinventor.blogspot.in/2015/05/control-multiple-servo-motors-using.html this is my blog, I have updated an app there for controlling 2 servo, check it out. </p>
<p>I get the result in the serial monitor:&quot;255 255 255 255 255 255 255.....&quot;only and so it can't to be controlled, pls help.</p>
<p>https://www.dropbox.com/s/o0gg89fy6q1aboi/servo.aia?dl=0 check thia aia file .. </p>
<p>cool, i made it name &quot;Resertooth&quot; :D</p>
<p>Thanks for sharing checkout other ibles :)</p>
<p>Cool for once a tutorial on how to create the android app. Instead of selling the app or puttling lots of ads in it.</p>

About This Instructable

68,600views

81favorites

License:

Bio: I make hobbyist stuffs and play with electronics follow me to know more https://www.facebook.com/arduinolabviewsolidworks https://twitter.com/learnrobotix
More by Magesh Jayakumar:Quick Start to Nodemcu (ESP8266) on Arduino IDE Course on MIT App Inventor and Arduino Hat for the Party 
Add instructable to: