In this instructable you'll learn how to establish communication between the arduino board (or any microcontroller that suports UART) and the Internet through an android device. Once you know how to do that you can control a lamp in your bedroom from the other side of the globe, check temperature in your basement, control a robot... well you get the idea - your imagination is the only limitation.
Essentially the setup is just an android app running on a mobile and communicating with the arduino via bluetooth.
MIT's app inventor allows one to quickly create apps (no coding required) so the mobile can serve as ready made user interface, data-storage device, accelerometer / gyro / GPS / GPRS and Wifi shield all in one. Not bad at all considering that decent android mobiles can be gotten for 40$ or so (or free if it's your own) - that's less than all the wifi shields I've heard of.
This project is based on my previous instructable. I strongly suggest reading it first >>
I decided to choose Cosm
(formerly known as pachube) for this project. I created a simple example app that receives data from the arduino board and sends it to a feed on Cosm website. Users can create feeds,which in turn have datastreams. Each data stream keeps one variable - it can be temperature, sensor reading, string of text and so on. You can access the feed I created for this app here LINK
. Feel free to use it for testing purposes.
relies on the following request methods for sending & and receiving data:
GET method - to read datastreams
PUT method - to update datastreams
The problem here is that MIT's app inventor supports only GET and POST
methods, but I found a way to make POST requests act as PUT requests
In order to send data you need to use WEB component in App inventor. It requires you to specify the URL of the request and use a PostText method to send a string.
The app I created for this instructable has a default URL - so it works as soon as you run it and enable the checkbox that says 'send data to cosm'. If you want to use your own feed you have to change the URL as follows:http://api.cosm.com/v2/feeds/
Once you have the URL ready copy and paste it into a QR code generator and in the app select the button 'Cosm setup - QR code scanner' to scan the URL. Of course you can manually enter the URL in MIT's app inventor too.
You can download the app and the source file here >>