In this tutorial you'll learn how to use a bluetooth module and MIT's app inventor to create a wireless serial link between an android phone and an arduino board. Here is a short video showing an example app. This article will describe how to do the wiring, write an
Arduino sketch that can accept basic commands and send them and how to write the app itself. It's assumed that you're already familiar with some of the basics, you made a few arduino projects and are familiar with the arduino IDE. If you have attempted serial communication with the Arduino and
Arduino Starter Kiteverything should be fully comprehensible. If you have any problems or questions feel free to ask them on the discussion page.
Step 1---Use the following arduino code. Feel free to modify it. The important aspect here is the baud rate - make sure it matches the baud rate of your module - check the datasheet or use AT commands to do it.
const int ledPin = 2; // the pin that the LED is attached to byte serialA; void setup() { // initialize the serial communication: Serial.begin(19200); //baud rate - make sure it matches that of the module you got: // initialize the ledPin as an output: pinMode(ledPin, OUTPUT); } void loop() { if (Serial.available() > 0) {serialA = Serial.read();Serial.println(serialA);} switch (serialA) { case 1: digitalWrite(ledPin, HIGH); break; case 2: digitalWrite(ledPin, LOW); break; case 3:digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(100); default: break; } }
Step 2-->If all you want is to get the app and see it running then download the app then upload it to your phone. Download at -> drive.google.com/folderview?id=0B_PfPoEotOF8N2JwT3RSX011SjQ&usp=sharing Your phone has to be set to allow apps from outside the android market/google play to be able to download them - so check the settings on your mobile.
Step 3-->If you want to modify the app go to appinventor.mit.edu/explore/learn.html to find out how to prepare your computer and install App inventor software. Once you have it running, do at least one or two of their basic tutorials. Below is the source of the app used here. You can upload it to the app inventor and then upload to your phone or modify it. drive.google.com/folderview?id=0B_PfPoEotOF8N2JwT3RSX011SjQ&usp=sharing
Cheap Arduino Compatible’s announcement:
Microcontroller Kit,
Raspberry Pi