Arduino, MIT App Inventor Servo Motor Controller


Introduction: Arduino, MIT App Inventor Servo Motor Controller

Hello again everybody!! I hope all of you are fine and in good mood and condition always. Today I would like to share my experiment on using the MIT appinventor on controlling servo motor attached to arduino. Well, wait a minute, my experiment before this also use appinventor, sooooo what's the difference?

Well, the difference is that in this experiment I am going to use the slider function in the appinventor as opposed to the experiment before, where I only use button functions.There will be two parts in the instructables, arduino part and the appinventor part. So let's get started shall we?

Step 1: Step 1: the Items Needed

As usual, I am going to list all the items that is needed for this experiment.


1. Arduino UNO

2. Servo motor

3. Bluetooth module ( HC-05 or HC-06)( i am using HC 06)

4. Male to male jumper wire

5. Breadboard

6. Android smart phone


1. Arduino IDE

2. MIT app inventor

Step 2: Step 2: the Appinventor Design and Blocks

Alright in the first image, which is the appinventor design screen, there are the slider object, the list picker and so on.. I would like to stress some information on the slider object.

If you look at the properties panel at the right when selecting the slider, you could see some variables you can edit. In this experiment, I would like my servo to turn from 0 to 180 degrees. That is why i have decided my minValue to be 0 and maxValue to be 180.

You can also customize the width of the slider by adjusting the width variable in the properties panel. I also wanted my initial position of my slider to be at the middle (90) therefore, I adjusted the thumb position variable to 90.

The second image shows the code block for the experiment.Notice that in the code block, I had initialized my global value ( thumb position) to 90.

Step 3: Step 3: Arduino Code

#include< Servo.h >// include server library

Servo ser; // create servo object to control a servo

int poser = 90; // initial position of servo

int value; // initial value of input

void setup()


Serial.begin(9600); // Serial comm begin at 9600bps

ser.attach(7);// server is connected at pin 7


void loop()


while(Serial.available()) //read while data is present


value =; //value = serial read data from phone

poser = value ; //than position of servo motor equals to value of data read from phone

ser.write(poser);// the servo will move according to position

delay(15); }


Step 4: Step 4: Assemble the Circuit and Test It!!

The circuit is assemble as shown in the sketch. The sketch is made is using fritzing. During uploading the code into arduino, make sure the bluetooth RX and TX to arduino were disconnected first from TX and RX of arduino. That's all for the circuit assembly.

Now everything is set up. Download the the code you made in appinventor to your phone (save .apk in computer, then transfer it to your phone). Upload the arduino code and test it!! The link for demonstration video is here:



    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest

    10 Discussions

    Le contrôle d'un servo fonctionne parfaitement.
    Je dois réaliser un projet comportant 4 servos et je ne parviens pas à attribuer un curseur à chacun des servos, il y a surement quelque chose qui m'échappe dans le code, soit appinventor ou arduino

    1 reply

    Après quelques essais, j'ai trouvé la solution pour gérer plusieurs servos


    2 years ago

    i allready to the same but it dose not work can you help me please :(


    2 years ago

    great work

    What does the MIT App Inventor do? Is it just a simpler way to get code?

    1 reply

    The MIT app inventor is an android app maker. Usually people use Android SDK for developing complex apps for android based smartphones. The MIT simplifies some of the app making by providing block based coding (similar to scratch). So, it can be said that the MIT app inventor enables user to develop some apps easier and faster. There are a lot of tutorials for MIT app inventor. You can go to this website to explore the appinventor:

    However don't you need a motor driver shield to run the servo so you don't damage your arduino?

    2 replies

    But however, if you want to use a number of servos, it is better to use the shield.

    Nice instructable!! Going to buy myself a hc-06 and some servos now!!