×
Namespaces

Variants
Actions
(Difference between revisions)

Communicating with Arduino

From Nokia Developer Wiki
Jump to: navigation, search
rcu (Talk | contribs)
(References)
hamishwillee (Talk | contribs)
m (Text replace - "Category:MeeGo" to "Category:MeeGo Harmattan")
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Maemo]][[Category:MeeGo]][[Category:Python]][[Category:Symbian]]
+
[[Category:Maemo]][[Category:MeeGo Harmattan]][[Category:Python]][[Category:Symbian]]
=Why?=
+
{{ArticleNeedsUpdate|timestamp=20111028055822|user=[[User:Hamishwillee|<br />----]]|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)?
Arduino - popular robotics and automation platform - see [Practical Arduino], etc.
+
The technology does look interesting, if there is a cool real world example of interfacing with Phones.}}
 +
{{Abstract|This article explains how you can interface your phone with [http://www.arduino.cc 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.}}
 +
{{ArticleMetaData
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities=<!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|id= <!-- Article Id (Knowledge base articles only) -->
 +
|language=<!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|review-by=<!-- After re-review: [[User:username]] -->
 +
|review-timestamp=<!-- After re-review: YYYYMMDD -->
 +
|update-by=<!-- After significant update: [[User:username]]-->
 +
|update-timestamp=<!-- After significant update: YYYYMMDD -->
 +
|creationdate=20110131
 +
|author=[[User:Rcu]]
 +
}}
 +
==Why interface with Arduino ?==
 +
Arduino (http://www.arduino.cc) is a popular open-source robotics and automation platform - see [Practical Arduino], etc.
  
 
[Jurgen] demonstrates interfacing S60 phone with robot via Bluetooth.  
 
[Jurgen] demonstrates interfacing S60 phone with robot via Bluetooth.  
Also !!!!
+
Also !
  
We consider that interfacing a phone with Arduino brings a lot of benefit. The phone has a lot of sensors (camera, GPS), radios (3G, BT, WiFi), and Arduino is very good for controlling motoros, adding other sensors (temperature, PIR, etc).  
+
We consider that interfacing a phone with Arduino brings a lot of benefit. The phone has a lot of sensors (camera, GPS), radios (3G, BT, WiFi), and Arduino is very good for controlling motors, adding other sensors (temperature, PIR, etc).  
 
A possible way of interfacing them is to have them form a one body system in which case using USB communication makes more sense than using Bluetooth.
 
A possible way of interfacing them is to have them form a one body system in which case using USB communication makes more sense than using Bluetooth.
  
=The USB protocol=
+
== The USB protocol==
USB guest - maybe called slave!!!!
+
USB guest - maybe called slave!
  
USB host - acts like a PC!!!!; requires 1!!!!Mbps transfer rate
+
USB host - acts like a PC!; requires 1! Mbps transfer rate
  
=How?=
+
==How?==
All standard phones support USB guest mode. Only the newer phones, from 2010 onwards, support USB host mode - e.g., Nokia N8, C7, the Maemo phones.
+
All standard phones support USB guest mode. Only the newer phones, mostly from 2010 onwards, support USB host mode - e.g., Nokia N8, C7, some/all?? Maemo/Meego phones (N900).
 
Therefore we want to have phones acting as USB guests and connect them to Arduino, which needs to act as a USB host.
 
Therefore we 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.  
+
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 I didn't try is the V2DIN...!!!!
+
Note: Another option which we did not try is the VDIP1 or VDIP2 USB host module used in [Practical Arduino], which can be found at http://www.ftdichip.com/Products/Modules/DevelopmentModules.htm .
  
 
We have experimented with Arduino Uno, but should work as well with Duemilanove, etc.
 
We have experimented with Arduino Uno, but should work as well with Duemilanove, etc.
Line 25: Line 48:
 
The Arduino USB host shield library can be found at https://github.com/felis/USB_Host_Shield.
 
The Arduino USB host shield library can be found at https://github.com/felis/USB_Host_Shield.
 
The first application to try is board_test found in examples.
 
The first application to try is board_test found in examples.
With board_test I tested phones, USB memory sticks, USB Bluetooth sticks and a Sony DSC camera - normally all should work.  
+
With board_test we tested 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.
 
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.
Line 31: Line 54:
 
Sending data on a Symbian phone on the USB port can very easily be achieved by using the pys60usb module.
 
Sending data on a Symbian phone on the USB port can very easily be achieved by using the pys60usb module.
  
Note: on the Internet one can find 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 3!!!! of [Practical_Arduino] is, as far as we know, also not good since that transforms Arduno in a USB guest/slave and it is not possible to change the program to implement a USB host). We are open to informed comments.
+
The sketch to be run on Arduino is: ...!!!!
  
=References=
+
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 3!!!! of [Practical_Arduino] is, as far as we know, also not good since that transforms Arduno in a USB guest/slave and it is not possible to change the program to implement a USB host). We are open to informed comments.
[Practical_Arduino] book!!!!; site with source code from the book http://www.practicalarduino.com/
+
 
 +
== References==
 +
[Practical_Arduino] book!; site with source code from the book http://www.practicalarduino.com/
 
[Jurgen]
 
[Jurgen]

Revision as of 13:51, 13 June 2012

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: hamishwillee (13 Jun 2012)

Contents

Why interface with Arduino ?

Arduino (http://www.arduino.cc) is a popular open-source robotics and automation platform - see [Practical Arduino], etc.

[Jurgen] demonstrates interfacing S60 phone with robot via Bluetooth. Also !

We consider that interfacing a phone with Arduino brings a lot of benefit. The phone has a lot of sensors (camera, GPS), radios (3G, BT, WiFi), and Arduino is very good for controlling motors, adding other sensors (temperature, PIR, etc). A possible way of interfacing them is to have them form a one body system in which case using USB communication makes more sense than using Bluetooth.

The USB protocol

USB guest - maybe called slave!

USB host - acts like a PC!; requires 1! Mbps transfer rate

How?

All standard phones support USB guest mode. Only the newer phones, mostly from 2010 onwards, support USB host mode - e.g., Nokia N8, C7, some/all?? Maemo/Meego phones (N900). Therefore we 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 [Practical Arduino], which can be found at http://www.ftdichip.com/Products/Modules/DevelopmentModules.htm .

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

The Arduino USB host shield library can be found at https://github.com/felis/USB_Host_Shield. The first application to try is board_test found in examples. With board_test we tested 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.

The sketch to be run on Arduino is: ...!!!!

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 3!!!! of [Practical_Arduino] is, as far as we know, also not good since that transforms Arduno in a USB guest/slave and it is not possible to change the program to implement a USB host). We are open to informed comments.

References

[Practical_Arduino] book!; site with source code from the book http://www.practicalarduino.com/ [Jurgen]

258 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.

×