Pages: [1]   Go Down
Author Topic: windows mobile to arduino  (Read 1849 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi.. is it possible to connect arduino to my htc touch phone via usb cable and control it via the serial port class?

i can do it with arduino and my laptop via usb cable using vb.net.. so i assume if to do the same with my phone then i gota do it under the smart device template using compact framework?

so far i have tried to move a servo like that but with no success.. i used an external 5V power supply.. loaded a simple arduino sketch just listening out for an angle... wrote the following code in visual studio and run it on my phone with the arduino connected to it but it just says cant find the com port.. changed the port number around and didnt work too..  :-/

Code:
Imports System.IO.Ports
Public Class Form1

    Dim port As SerialPort
    Dim angle(0) As Byte

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        port = New SerialPort("COM4", 9600)

        port.Open()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        angle(0) = CByte(180)

        port.Write(angle, 0, 1)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        angle(0) = CByte(0)

        port.Write(angle, 0, 1)
    End Sub

    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        port.Close()
    End Sub
End Class
Logged

Bonn, Germany
Offline Offline
God Member
*****
Karma: 0
Posts: 903
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I could be wrong there, but from what i know from my HTCs no HTC ever had a USB controller unit - so i dont think that the Arduino can be identified as USB->Serial device and hence Serial communication wont work that way.

But i would like to be tought i am wrong since the idea is interestering!
Logged

Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

Palmetto, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 138
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm also pretty sure that the Touch Pro does not have a proper USB Controller to handle this.

I was able to use this USB serial device with the Arduino: http://www.hacktronics.com/Wireless/Bluetooth-Serial-Adapter/flypage.tpl.html. Using a .NET CF app I could attach to the port, and monitor it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for the answers.. but i dont really understand terms..

you mean to say htc phones cant send information by its usb port? if thats the case then how come i can connect it to my com and transfer files using the usb cable?

i was going to connect the arduino to my htc touch phone with usb cable and try to move some servos from ext power supply.. so its not possible?
Logged

Palmetto, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 138
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For any device to communicate with another device via USB one device must be a host. This is why you have to install the FTDI serial port driver that links the USB to a serial port on your computer. In this case the PC is the host.

The Touch Pro uses USB, and a USB driver to talk to the PC, again the PC is the host.

There are FTDI drivers for Windows Mobile 6, but the device has to have a USB host controller which, from what I can tell, the Touch Pro does not have, so The Touch Pro cannot be a host. This is the same reason that you can't plug a keyboard or mouse into the Touch Pro.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok thanks i get it now!
Logged

Bonn, Germany
Offline Offline
God Member
*****
Karma: 0
Posts: 903
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

addition to that: from what i have read in numerous forums that are dedicated to software development on the HTCs there is no HTC out there with a Host Controller. There are, though, certain projects out there that try to emulate one - but those are 'in planning' or 'private alpha' eversince the HTC Prophet - 4 or 5 years ago..
Logged

Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid[ch8230] and I went ahead

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As others have already pointed out, your phone can't play the part of a USB host, which means that it can't talk to the Arduino in the same way that your computer can. However, there may be other options.

The easiest is to use Bluetooth- that should be doable, though adding Bluetooth to your Arduino will cost you.

You could also look into buying another Windows Mobile or Linux PDA. But even then, you might be out of luck, without the needed USB drivers for the FTDI chip.

You can also get Bluetooth to Serial adapters- you'd pair your phone with the adapter, and the adapter would talk to the Arduino over RS-232 (not USB).

Either way, you'll probably end up spending $100-150.

I wouldn't cross my fingers, but the docking connection of some WinMo devices support a serial connection which is made available by either hacking your own cable, or an adapter you can buy.

Good luck!
Logged

Palmetto, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 138
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Either way, you'll probably end up spending $100-150.

The bluetooth serial adapter in my first post is only $49.00. It works very well with my Touch Pro, and PC's
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 44
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how about irda? a lot of winmo phones have that...

I've heard you can access the I2C bus by opening up the phone and soldering but that definitely isn't for the faint hearted!

I've looked into this in the past and came to the conclusion it was not possible on the cheap.

Shame because it would be a cheap way of adding a beafier processor, gprs, camera, storagea and maybe even gps to you project. Especially if you picked up a cheap winmo phone off ebay

how reliable is the bluetooth to serial adaptor over very short ranges? does it auto connect with the arduino? I'm just thinking about using it in remote locations.
Logged

Palmetto, FL USA
Offline Offline
Full Member
***
Karma: 0
Posts: 138
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
how reliable is the bluetooth to serial adaptor over very short ranges? does it auto connect with the arduino? I'm just thinking about using it in remote locations.

I have found it to be very reliable. I'm specifically using it with a GPS Shield, and sending the NMEA Sentences to the phone to feed into Google Maps.

Pairing is pretty straight forward, and no harder than pairing any other BT device with the phone.
Logged

Pages: [1]   Go Up
Jump to: