Introduction: Control LED Using MIT App Inventor and Arduino

This is a step by step tutorial on getting started with creating MIT app inventor android app and control things with arduino.

Lets Make our first app to control a LED

Step 1: Getting Started With Arduino and Android

Blinking a LED is the first thing we do when we getting started with electronics in this tutorial you will TURN ON and TURN OFF the LED, this is the Hello world example in this tutorial, you don't need any prior coding experience to make this application work. To test the app that created during this tutorial, you need an Android mobile to test your app. creating an app with MIT app inventor is very simple, you won't be doing any coding process during creating your app, you will be assembling blocks together to make your app. if you don't have any prior experience with Arduino control, make sure you follow some basics like connecting Arduino to your computer and upload example code to Arduino from Arduino IDE, this would be more sufficient to follow this tutorial.

Step 2: COMPONNENT REQUIRED

Hardware:

1. Arduino board

2.LED

3. Resistor 330 ohm

4. wires

5.Android Smartphone

6.Bluetooth module (HC-05)

7.test board

Software:

1.Arduino IDE

you can download from
https://www.arduino.cc/en/Main/Software

2.MIT app inventor

http://ai2.appinventor.mit.edu/

Step 3: Hardware & Software Configuration

Well, the circuit assembly is not difficult. The circuit consists only of LED, resistor, HC-05 and Arduino. The long "leg" of the LED will be connected to the 5V through the resistor on Arduino pin number 13 while the shorter "led" will be connected to the GND. For the HC-05, the VCC is connected to 5V, GND to GND, RX of HC-05 to Arduino TX, while TX of HC-05 to Arduino RX.

1-connect led ,resistor and bluetooth module as shown

2-connect Arduino to your computer using USB cable.

3- Download Arduino IDE on your computer.

4- download the Arduino code below and open it using Arduino IDE

5-choose your Arduino board from IDE

tools<

6-choose serial port from IDE

tools<

7-run the Arduino sketch

8-upload sketch on your arduino board

Step 4: MIT App Inventor Code Block

First go to the App Inventor site http://ai2.appinventor.mit.edu/ and then it'll ask for your email and password and enter that in. Next, go to "Projects" and click "Start new project" and call it Led control

Step 5: Running the App

There are many ways to run this application..but the easiest way is to download the MIT Ai Companion from the Google Play Store

check this link to more details

http://appinventor.mit.edu/explore/ai2/setup-devic...

Send the App to your android device,install it and begin control.

Have fun

Comments

author
tytower made it!(author)2017-02-04

Can you make available the .aia file . That makes it easier for us to follow your work

author
liquidhandwash made it!(author)2016-08-08

Thanks for the great instructable. I had a bit of trouble making it work but it turn out to be the HC-06 bluetooth, doesnt work with your sketch. I got a HC-05 and it works great.

author
ibrahim+kamr made it!(author)2016-08-14

you're welcome :)