Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Communicating with Arduino

From Wiki
Jump to: navigation, search

Needs-update.pngThis article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (28 Oct 2011)
This article is incomplete. It has links to a book that don't work, and is littered with poor English and placeholders for future work. Can we please get it updated to have links, remove all the placeholders (and spurious multiple exclamation marks)? The technology does look interesting, if there is a cool real world example of interfacing with Phones.

This article explains how you can interface your phone with Arduino, the popular open-source robotics and automation platform. This is desirable because the phone provides access to many sensors, which Arduino provides motor control and automation.

Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: rcu (31 Jan 2011)
Last edited: alexsusu_comty (12 Aug 2013)


Contents

Why interface with Arduino ?

Arduino is a popular open-source robotics and automation platform [1].

Interfacing a phone with an Arduino board is beneficial. The phone has a lot of sensors (camera, GPS), radios (3G, BT, WiFi), and Arduino is very good for controlling motors (we can even build simple robots), adding other sensors (temperature, PIR, etc).

Jurgen Scheible [2] demonstrates how we can interface an Symbian phone with a robot via Bluetooth.

Another example is the Kite Aerial Photography (KAP) N900 project, where a Nokia N900 is interfaced with an Arduino board [3], again via Bluetooth.

In case we think of building a tightly coupeled system from a phone and an Arduino board, we can consider also the alternative of interfacing the two via USB, besides Bluetooth.


The USB Protocol

The USB communication protocol is defined between a USB guest and a USB host, which acts like a PC. It is required at least 1 Mbps transfer rate. [ADD MORE DETAILS]

All standard phones support USB guest mode. Note however that newer phones, mostly from 2010 onwards, support USB host mode - e.g., Nokia N8, C7, some/all(?) Maemo/Meego phones (such as N900), Android.


Arduino as USB host

We now consider want to have phones acting as USB guests and connect them to Arduino, which needs to act as a USB host.

One can buy an Arduino USB host shield from http://www.circuitsathome.com/. (I personally bought it from a local retailer that got a compatible USB host shield from Sparkfun - see http://www.sparkfun.com/products/9947.) Note: Another option which we did not try is the VDIP1 or VDIP2 USB host module used in the "Practical Arduino" book [1], Chapter 15, which can be found at http://www.ftdichip.com/Products/Modules/DevelopmentModules.htm .

We have experimented with Arduino Uno, but it should work as well with Arduino Duemilanove.

The Arduino USB host shield library can be found here.

The first application to try is examples/board_test.pde. We tested USB connectivity of Arduino with phones, USB memory sticks, USB Bluetooth sticks and a Sony DSC camera - normally all should work.

Other interesting projects are https://github.com/felis/Arduino-Bluetooth (see http://www.circuitsathome.com/mcu/bluetooth-code-for-arduino-usb-host), https://github.com/felis/Arduino_Camera_Control (see http://www.circuitsathome.com/mcu/controlling-canon-powershot-cameras-to-arduino). Info about all the projects can be found at http://www.circuitsathome.com/category/mcu/arduino/usb-shield.

Sending data on a Symbian phone on the USB port can very easily be achieved by using the pys60usb module for the PySymbian (Python on Symbian) runtime. The source code of the module can be found here. Note that we built the pys60usb module, but did not succeed to make the phone communicate with Arduino, help needed.

Note: One can find on the Internet pages describing attempts of connecting USB port of phones directly to Digital IOs of Arduino. THIS IS NOT FEASIBLE! The USB protocol is much more complex than simple serial Tx/Rx data communication. You need to transform the Arduino in a USB host which is possible ONLY if attaching a USB host shield to it (the solution described in Chapter 4 of "Practical Arduino" [1] is, as far as we know, also not good since that transforms Arduino in a USB guest and it is not possible to change the program to implement a USB host). We are open to informed comments.

Another Alternative for Arduino and the Phone to Communicate

If the phone does not have USB host mode and you don't want to buy an Arduino board, then we thought of the following communication scheme: you can plug a 3.5mm stereo jack in the phone and you can connect the three audio wires to the Analog IOs of the Arduino board. The phone can modulate audio signals (either through the API or even can playback prerecorded WAV, AMR or MP3s), which can signal to a "listening" Arduino at least simple commands such as activate led. We welcome any implementation details.


Phone as USB host

Community, please help.

References

  1. 1.0 1.1 1.2 Jonathan Oxer, Hugh Blemings. "Practical Arduino: Cool Projects for Open Source", 2009 (supporting source code available on the same site)
  2. Jurgen Scheible, Ville Tuulos. "Mobile Python. Rapid Prototyping of Applications on the Mobile Platform", 2007
  3. The Kite Aerial Photography N900 project, info here and here
This page was last modified on 12 August 2013, at 14:00.
368 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×