Arduino Mobile Processing

How the mobile sketch works:
The brain of the system is really on the arduino or the web page the phone requests. . . The phone just passes any data it sees back and forth. . .
For the phone app to run, it needs the URL of a server and the path to a web page. Once that information has been made available by the arduino board, the phone will request that web page anytime it sees a # on its serial port. . . Additionally, any results from the web page requested are sent back to the arduino via the serial port.

Arduino Mobile Processing
So, if you just need to request data from the web at a set time frame, the arduino sketch needs only to send a # from time to time and wait for the result.
If you need to pass variables to a website, the arduino must pass a string with those variables and end the string with a .

Some notes:
Phone sketch:
I used a cheap Motorola Iden i415 phone with a pay as you go plan from boostmobile. . . It has unlimited data for 33c/day. It is quite convenient since I can just reboost the account when I need to use it. . .
Arduino Mobile Processing Schematic
Debugging this sketch on the phone was a real pain because the phone emulator I use with Mobile Processing does not really have any serial ports. . . Additionally, uploading it to the phone required a trip to an old pc in order to use the Motorola Java Application Loader. So, once I got it all working, I moved all variables off onto the arduino. That way I (or you) wouldn’t have to recompile the phone app should the server address change. . .

There is so much more that can be done with Mobile Processing. Just as an example, Mobile Processing has bluetooth and SMS capable libraries. Those could add a whole new level of interactivity to an arduino board and they are definitely in the list of features I’d add to the sketch. Additionally, using bluetooth would make it compatible with more phones. . . seems like getting access to the hardware serial port is restricted on some devices. . .

Website and webpage:
Anything on the page requested will be sent to the arduino. That means, head and body tags, javascript etc. . . The best use of that page would be a PHP or ASP page (or anything else) that outputs only the data you are interested in and nothing else. . .
On that note, you can/should add lots of logic to the web component of this system. The page requested by the arduino can be the result of some preprocessing. . . like this example from Tom Igoe where his php does some page scraping before giving the results back to his arduino.

Limitations:
The length of the messages passed back and forth are limited by the arduino serial buffer which I think is about 128 bytes. I’m sure there are ways around it but I have not gone that far.
The speed at which the phone and arduino communicate is limited by the phone serial port – In my case I used 9600bps, which is fast enough if all you have to toss around is 128 bytes. . . Some phones my not operate at that speed so your mileage may vary.

Major Components in Project
Arduino NG board
Motorola i415 Iden phone
Serial cable for phone
DB9 gender changer
RadioShack null modem adapter
SparkFun serial LCD
RS232 interface board from Anykits.com
RadioShack full-Color LED

For more detail: Arduino Mobile Processing


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top