3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Android G1 Serial to USB Cable

Android G1 Serial to USB Cable
Learn how to make an Android G1 2.8v serial to USB Serial device adapter (using a 3.3v ttl to usb serial adapter). This can be used for kernel debugging/etc with your computer. This project shouldn't cost you more than 40 bucks if you already have basic electronic tools such as a soldering iron.

Notice: The ability to use 3.3v ttl level serial is based off of google group discussions and a picture of a serial cable used by an alleged android dev. 2.8v level serial was determined via someone using a voltmeter. Build/use at your own risk and check the comments of this instructable too before beginning!

Information may be applied to build a 2.8v serial to RS232 converter to interact with RS232 devices, or a 2.8v serial to serial 5v level converter to interact with microcontroller such as an Arduino. I may post instructables on how to make these once I play around with the G1 kernel some more. :)

This tutorial assumes basic knowledge of soldering. If you don't have this skill you should find an instructable regarding it and practice a bit. The soldering required for this project isn't difficult, but needs to be done in a small amount of space which could be difficult for beginners.

This cable was created based off of information received from the Android-Platform Google Group.

... Specifically these two threads:
http://groups.google.com/group/android-platform/browse_thread/thread/f03730e25cc3fe55?fwc=1
http://groups.google.com/group/android-platform/browse_thread/thread/439d3f3af7a88a09/10a80eb835e8dbcc?lnk=gst&q=serial#10a80eb835e8dbcc

...This picture of a "mystical" g1 serial cable helped (and confused!) too:
https://www.noisebridge.net/wiki/Image:G1-two-usb-to-serial-cable.jpg

Please leave constructive criticism/comments if you find any steps wrong, confusing... or poorly written!
 
Remove these adsRemove these ads by Signing Up
 

Step 1Items Needed

To build this converter you will need the following:

« Previous StepDownload PDFView All StepsNext Step »
56 comments
1-40 of 56next »
Nov 18, 2011. 8:27 AMmrzono says:
Thanks for great instructable.
I tried that I connected G1 with Cisco console.

Android (T-Mobile G1) -> Serisl Port API -> TTL -> RS232C -> Cisco console

(my scene)
http://youtu.be/t4EuB8qhTvA
May 13, 2011. 3:58 AMgodamlaa says:
Hi all,

I've connected mine G1 to the PC via FTDI Basic Breakout (http://www.dfrobot.com/index.php?route=product/product&path=45&product_id=147) and managed to get full output from 'ps. However, it seem that G1 could not received my input from the keyboard most of the times.

I need to repeatly hit the keyboard to get the terminal emulator to echo it back!

Did anyone experienced it? Any tips will be helpful. Thanks
Dec 12, 2010. 7:54 PMChowmix12 says:
For the newer generations of android electronics (phones and tablets) They come with USB host already built in> Could i use the same programing cable for my arduino to connect to an android tablet? If i did, what app would i need to accomplish a serial port to the arduino?

Chow.
Jun 2, 2010. 2:15 AMcaptain-carrot says:
Thanks heaps for this instructable. After heaps of mucking around I managed to get the HTC Magic working with it using the stock headset (I cut it up).

Few pointers for those interested:
Headset cable already has the USB GND pin connected to what becomes the TX pin... obviously this won't work so I just hacked out all the normal usb pins (which solved the issue).

I've recompiled the 2.6.29-donut kernel and confirmed this works.

One issue though... when I use a custom kernel I cannot use it in normal USB mode :-(. Is this normal? Should you be able to use normal USB and this special serial mode at the same time?
Mar 26, 2010. 10:56 PMgarrows says:
I have now confirmed that Pin 4 is the data high pin and I have achieved 2 way communication.

http://garr.me/?p=315

Instructable coming soon.
Mar 22, 2010. 7:03 AMgarrows says:
Hey great work although I have noticed one thing that could be wrong.

Pin 4 is actually 2.8v or Data High which is required for some 2 way logic level converters.

Be warned, I haven't checked if it changes during data transmission. I will post my results when I get up to that stage.
Mar 9, 2010. 1:51 PMmjveyette says:
 Would this work?
www.ecrater.com/product.php
Jan 25, 2010. 10:26 PMmranalytical says:
The best way for me to see the phone sending commands to the PC was to type the following:

$ su
# echo 'hello' > /dev/ttyMSM2

It is also helpful to type 'ash' in so that you can recall commands:

$ su
# ash
/ # echo 'hello' > /dev/ttyMSM2

Then you can use ALT+trackball-up to recall previous commands.
Feb 18, 2010. 8:19 PMandrecosta2005 says:
Dude,

  how to dump the data on PC side ? tks
Feb 20, 2010. 11:58 AMmranalytical says:
 I had PuTTY open as a serial client on the PC. Other serial apps should work too but I've had issue with the built-in Hyperterminal so I prefer PuTTY.
Feb 22, 2010. 1:34 PMandrecosta2005 says:
thanks dude!!! any tip for linux (ubuntu) env ?
Feb 24, 2010. 1:09 PMWiebel says:
minicom or
screen /dev/ttyUSB0 (or whatever)
Feb 23, 2010. 4:38 PMsparkyuiop says:
Tried to upload but it won't work for me. What does 'Drag to Recorder' mean?
Feb 23, 2010. 4:37 PMsparkyuiop says:
Hi I am looking for some help with a USB to Serial device I bought from Maplin that I slightly damaged when breaking apart the sealed casing. I have damaged 2 resistors (I believe) and completely lost one.
Can any of you clever bods suggest a fix for me please? I have lots of spare components but no clue as to what they should be.
I have included some Pictures.
Thanks alot.
Sparkyuiop!
Jan 27, 2010. 11:45 AMleshii says:
Thanks for the great Guide. 
For those of us in the UK this seems to be the same board as the one used in the Guide 
www.coolcomponents.co.uk/catalog/product_info.php
:-)

Jan 26, 2010. 1:40 AMmranalytical says:
Has anyone been able to read incoming serial data on the G1?

I've tried using "cat /dev/ttyMSM2" and it just hangs, as does doing file reads of that using Python from the Android Scripting Environment.
Jan 23, 2010. 7:24 PMmranalytical says:
Step 5 mentions 115200bps but that wasn't working for the Sparkfun CP2102 device. I used 9600bps and it then worked like a charm.
Sep 13, 2009. 5:45 AMthomasantony says:
I just found out accidentally that a normal miniUSB connector works just fine with the extUSB port on the G1 for normal data transfer from PC as well as charging from PC. Does this open up any new possibilities? As for me, I would like to have some way to have consistent serial I/O between the G1 and an arduino. At least, one way to output accelerometer/Gps/compass data from G1 to the arduino itself would be a great thing.
Oct 9, 2009. 12:35 AMthomasantony says:
Hmm.. ok I did frequently corrupt my microSD card while trying to add files via the miniUSB cable.
Oct 9, 2009. 8:30 AMthomasantony says:
Hey I know I have to "Safely remove" it. :) .. And I like windows :) .. Samething would happen on *nix if you didn't "Eject" the drive and maybe some buffer wasn't flushed.

Anyway, its like, when I used the miniUSB, the "USB cable connected notification kept coming on and off. Sometimes it kept getting disconnected after I had mounted the card and all. I guess it must have been something wrong with the cable.
Oct 28, 2009. 8:54 PMFlood_of_SYNs says:
If you use a USB cable that has a ferrite RF choke on it you shouldn't have problems.

I think electrical interference could be at fault for the data corruption and the cable disconnect/connect notification toggling.
Oct 21, 2009. 12:37 AMpioioip says:
Thank you for this instructable and the api.  Following these instructions I cut up the the headset that came with my g1 and connected it a usb->ttl and it seems to be half working.  I made a modified cyanogen kernel and installed the SerialPort.apk but when I run the app I receive data on the g1 nothing seems to be going out.  I wonder if you have come across this.  I have noticed that the little headset icon is always present whereas before I disabled it in the kernel it only appeared when something was plugged into the usb port.  Could this be related?
Oct 21, 2009. 3:02 PMpioioip says:
The first time around I had installed the kernel from the google code page but it had the headset detection enabled in the config and I wasn't getting any serial communication.  I used the instructions on the site for compiling the kernel and that gave me the serial reception.  The wiring seems to be solid.  I am wondering if headset vs serial state is somehow persistent?  I'll try installing your kernel again later.  Thanks for the responses.
Oct 21, 2009. 11:20 PMpioioip says:
Hi again.  I tried your kernel again as well the two in the cyanogen repo to no avail.  The cm kernels with the headset detection disabled allowed me to receive serial but nothing went out.  I think that connector is grounding a pin and I destroyed it looking for it.  Does the headset detection matter?  If I get one of those little connectors they have on sparfun I should be fine with your kernel right?  Thanks again.
Oct 21, 2009. 10:10 AMcepr says:
I did not have such issue. I have no headset icon, maybe your problem is linked. I am not sure, but when using a headset, the TX pin is set up as GPIO to gnd.
Sep 22, 2009. 10:34 AMHjorvarth says:
Is software required to output the GPS / Accelerometer / Other sensor data, or can it be "pulled" from the phone using commands? I'd love to use my G1 as a sensor device interfacing with a PIC but I have no idea how to output all that useful data over the serial port. Any info would be appreciated, thanks.
Oct 7, 2009. 12:08 PMjamescorbett says:
Thanks very much for the tutorial! I would like to know whether I can use this from a program on my g1, say, if i were to develop a program that could say to a picchip "SEND ME" then it could write back the values of its inputs etc. then the program could do something with them. would I have to use NDK? or does the SDK have some kind of serial control command?
Oct 7, 2009. 2:10 PMcepr says:
I made an Android program to read/write to a Linux serial port.
It uses the SDK and a little the NDK.
Anyway, you need a rooted device because the /dev/tty* do not have the read/write permissions for Android applications.

Mar 4, 2011. 6:15 PMvladistan says:
Hey not sure you still interested but I just ported the RXTX library ( gnu.io.rxtx) to the android. More details here http://v-lad.org/projects/gnu.io.android/
Oct 7, 2009. 3:01 PMjamescorbett says:
Hmm, Cepr could you send me/post the code your using so that I can have a stab at it, and macpoddotnet are your steps nessery because I have a routed device so shouldn't I just be able to talk to /dev/ttyMSM2 using just command line (I will try this soon) because at the moment I'm testing using my actual phone I use on a day to day basis but I will buy a dedicated one I can break things like headsets and it doesn't matter.
Oct 8, 2009. 6:20 AMcepr says:
Hi jamescorbett,<br /><br />I just created a Google Code project to host the code:<br />http://code.google.com/p/android-serialport-api/<br /><br />I will complete the wiki with compilation instructions soon.<br />
Oct 8, 2009. 11:16 AMcepr says:
My application is now stable, I uploaded an apk in the download section.
SerialPort_0.7.apk features:
- detect all the serial ports of the phone (most are internal, do not use)
- select baudrate (4800, 9600, 115200)
- detect missing file permissions, and try to change it with "su" (does not work on all phones)
- terminal screen to receive and send text through the serial port
- "loopback test": the phone sends infinite 0x55555..., and display the count of received and sent bytes. If you connect RX and TX, you should have the same value.


1-40 of 56next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
1
Author:macpoddotnet