Introduction: Android G1 Serial to USB Cable

Picture of 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:

...This picture of a "mystical" g1 serial cable helped (and confused!) too:

Please leave constructive criticism/comments if you find any steps wrong, confusing... or poorly written!

Step 1: Items Needed

To build this converter you will need the following:

Step 2: Soldering the HTC ExtUSB Breakout Board Data Wires

Picture of Soldering the HTC ExtUSB Breakout Board Data Wires

= 1. Using the wire cutters, cut three lengths of wire that are each about 5 inches long. If you bought more than one color of wire, make one black wire and two of your custom color.
= 2. With the wire strippers, remove about 5mm of insulation from each end of the three cables.

Now, before continuing, go grab your HTC ExtUSB breakout board and take a close look at it. One side will have tiny numbers on it that reflect the following:

6 9 11 5
78 10 4
1 2 3

The bold holes are what we are interested in. Those three holes represent GND (Hole 7), TXO (Hole 8), and RXI (Hole 9), all of which are necessary for the G1's serial communications. In case you were wondering what the other pins were tied to, this is what currently has listed:

1: USB VCC +5v
2: USB Data -
3: USB Data +
4: N / C
6: Left Audio +
7: Labeled "AG" (Serial 2.8v Level GROUND)
8: Audio - (GND) Labeled "CK" (Serial 2.8v Level TX0)
9: Switch (Talk) Labeled "OT" (Serial 2.8v Level RX'I)
10: Right Audio +
11: Mic +
12: Chassis Ground (GND)

= 3. Plug in your soldering iron and let it warm up.
= 4. Grab a wire you cut earlier (the black one if you have multiple colors) and solder it through hole 7 (GND).
= 5. Grab another wire you cut earlier and solder it through hole 8 (TXO).
= 6. Grab the last wire you cut earlier and solder it through hole 9 (RXI).

After that it should look something like the picture below.

Step 3: Soldering the USB to TTL-Level Serial Adapter Data Wires

Picture of Soldering the USB to TTL-Level Serial Adapter Data Wires

Now that the ExtUSB board is soldered, the next step is to solder those wires into the respective holes in the USB to 2.8v serial board. Before continuing, it would be a good idea to grab this board and look carefully to find the GND, RX, and TX holes.

= 1. Solder the GND wire (The one Soldered in Hole 7 of the HTC ExtUSB board) in the hole labeled GND on your USB to 2.8v Serial adapter.
= 2. Solder the TXO wire (The one Soldered in Hole 8 of the HTC ExtUSB board) in the hole labeled RX on your USB to 2.8v Serial adapter.
= 3. Solder the RXI wire (The one Soldered in Hole 9 of the HTC ExtUSB board) in the hole labeled TX on your USB to 2.8v Serial adapter.

Step 4: Verify the Data Wire Connections

Picture of Verify the Data Wire Connections
= 1. If needed, install any drivers necessary for the USB to 2.8v serial adapter you used.
= 2. Download a serial console app for your computer. For OS X/Linux users, the command line minicom or screen are good choices. I will be using minicom under Ubuntu.
= 3. Plug in the converter you made into a USB port on your computer. Do NOT plug it into the phone yet.
= 4. Open up your serial console app and see if the device is detected. For me it shows up under /dev/ttyUSB0 and minicom picked it up automatically. You may need to configure your software.
= 5. With the serial port now recognized, now you need to change the baud rate/stop bits, and flow control. To change these in minicom, type Ctrl-a then type Shift-O (O as in Obama). A configurations dialogue will pop up. You should choose "serial port setup", hit enter then change the values to be the following:
  • Bps/Par/Bits: 115200 8N1
  • Hardware Flow Control: No
  • Software Flow Control: No

= 6. Close settings and wait for a connection now. You can exit settings in minicom by hitting the escape button.
= 7. Go grab your G1 Phone and make sure it has a good charge. Once it does, you should go to Settings->Sounds and Display->Screen Timeout and increase it to 10 Minutes or Never Timeout. From preliminary tests, It seems serial doesn't work with the display off.. but this has not been verified.
= 8. Plug the HTC ExtUSB connector into the phone.. if you smell anything funny or see sparks, quickly disconnect the connector from the phone then the USB cable and review the prior steps to see what you missed.

= 9. If all looks and smells ok, take a look at the serial console output, it should say "debug>" immediately. This reflects that you at least soldered the GND and RX wires correctly, woo!**
= 10. Try typing "ps" and hit enter, if you see ps appear and lots of text scrolls by when you hit enter, that means you cable works fine. Neat!**

**If you do not see the expected "debug>" text or you don't see what you type, hit enter a few times. Sometimes the communications can get garbled since no software/hardware flow control is used. If that doesn't work, you can try restarting your console app, verifying serial communication settings, unplug/plug in the phone, and finally double checking what you soldered.

= 11. Trim the excess wires off both boards.

Step 5: Soldering the USB to TTL-Level Serial Adapter Power Wire (optional)

Picture of Soldering the USB to TTL-Level Serial Adapter Power Wire (optional)

Now that you know your cable works you can either use it as is, make it provide power to the G1, or make it work as a dual standard USB and USB serial device. The following explains how to supply power to the G1 provided your adapter has a 5v hole to solder to.

= 1. Take a look at your 2.8v level serial to USB adapter and look for a something labeled 5V. It may also be labeled VCC but if this is the case, check your adapters data sheet to verify it actually does supply 5V directly from the USB bus. It also probably wouldn't hurt to double check this using a voltmeter.

If you do not have this connection, you will not be able to complete the next few steps. If you run into this situation you might want to consider just soldering a USB cable to the proper HTC ExtUSB pins as this should allow you to both power the G1 and also have standard USB access to the G1

= 2. Using the wire cutters, cut a wire that is about 5 inches long. If you bought more than one color of wire, use the red wire.
= 3. With the wire strippers, remove about 5mm of insulation from each end of the cable.
= 4. Solder the wire through the 5V (or VCC) hole on your adapter.

Step 6: Soldering the HTC ExtUSB Breakout Board Power Wire (optional)

Picture of Soldering the HTC ExtUSB Breakout Board Power Wire (optional)

Take a look at the HTC ExtUSB breakout board again. We are interested in the USB VCC +5v hole which is bolded below.

6 9 11 5
7 8 10 4
1 2 3

1: USB VCC +5v
2: USB Data -
3: USB Data +
4: N / C
6: Left Audio +
7: Labeled "AG" (Serial 2.8v Level GROUND)
8: Audio - (GND) Labeled "CK" (Serial 2.8v Level TX)
9: Switch (Talk) Labeled "OT" (Serial 2.8v Level RX)
10: Right Audio +
11: Mic +
12: Chassis Ground (GND)

= 1. Solder the other end of the (red) wire you just soldered in hole 1 (USB VCC +5v).

Step 7: Verify the Power Wire Connection

Picture of Verify the Power Wire Connection

= 1. Plug in the adapter into your computer. If it starts to smell funny or spark, quickly remove it and check what you soldered.
= 2. Grab your phone, power it on if it is off, then plug the adapter into it. After about a second or two, the amber charging light should turn and stay on.. if it doesn't, quickly disconnect it and double check your connections.

That's it, go hog wild!

Step 8: Now What?

So now that you know how to interact with the serial port on the G1, you probably have a bunch of ideas floating around your head for how to take advantage of it, right?

Wouldn't it be nice to use this to:
-Control a robot
-Use the G1 as a serial console to connect to servers in a beowulf cluster like System-X
-Communicate with sensors/activators over a 3g network for remote monitoring/control
-Use the serial port to attach a blood glucose reader or other medical device (psst, any big medical companies hiring?) and combine two devices into one for many people?

Here's a project that explains how to compile the G1 phone's kernel so you can use the serial port from the userland. It also features an api so you can use the serial port directly from Android Gui apps!

Don't forget to post your projects here when you're done!


مالشرجبي (author)2014-04-15


crowg (author)2012-09-23

I have a Droid Bionic - anyone want to build one of these for? (with instructions on how to install driver, etc)

mrzono (author)2011-11-18

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)

godamlaa (author)2011-05-13

Hi all,

I've connected mine G1 to the PC via FTDI Basic Breakout ( 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

jamescorbett (author)2009-10-07

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?

  Yep, this allows 2-way communication via the serial protocol with a pic/avr/arduino, etc. That's actually my main reason for making this cable.

To do this you need to configure and rebuild the kernel to disable the serial debugger and htc handset detection drivers. Consequently after doing this, you probably won't be able to use your headset. This requires you to have a rooted phone too, preferably with the dev spi.

There's no android application level serial communication sdk stuff yet.. (Porting rxtx to android is on a todo list of mine) so you will need to compile a c app (search google for to learn how to compile c apps for android) in order to either use as a middle man between android apps and your uC.. or just to configure the serial port initially to whatever baud rate, stop bits, etc you need then interface with /dev/ttyMSM2 directly

vladistan (author)macpoddotnet2011-03-04

Hey not sure you still interested but I just ported the RXTX library ( to the android. More details here

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.

cepr (author)jamescorbett2009-10-08

Hi jamescorbett,<br /><br />I just created a Google Code project to host the code:<br /><br /><br />I will complete the wiki with compilation instructions soon.<br />

cepr (author)cepr2009-10-08

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.

macpoddotnet (author)cepr2009-10-08

Great work! When I get home I'll check it out then throw a link up in this instructable.

Hmm, the NDK has me really excited now.. it has made some other things I have wanted to do way easier now.

 If you are satisfied with the default baud rate you set in your kernel config before building it, you don't need to route applications through a c serial program.. or even make one to set the baud rate.

All you have to do is get the right permissions and talk to /dev/ttyMSM2 just like you would with any other linux serial port.

The NDK stuff wasn't around when I played with this, but this might even offer a better solution provided you have privileges. If you can include serial libs, you could control the baud rate directly from an app which would be awesome. This would be really useful for porting the rx/tx java libs too... hmm

The config entries that should be disabled have changed since I first did this, but currently these should be it:

... possibly this too:

cepr (author)macpoddotnet2009-10-08

Thank you!
I have now ttyMSM2 :D
(it works also with CONFIG_MSM_FIQ_SUPPORT=y)

cepr (author)jamescorbett2009-10-07

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.

Chowmix12 (author)2010-12-12

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?


captain-carrot (author)2010-06-02

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?

garrows (author)2010-03-26

I have now confirmed that Pin 4 is the data high pin and I have achieved 2 way communication.

Instructable coming soon.

garrows (author)2010-03-22

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.

mjveyette (author)2010-03-09

 Would this work?

mranalytical (author)2010-01-25

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.


  how to dump the data on PC side ? tks

 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.

thanks dude!!! any tip for linux (ubuntu) env ?

Wiebel (author)andrecosta20052010-02-24

minicom or
screen /dev/ttyUSB0 (or whatever)

sparkyuiop (author)2010-02-23

Tried to upload but it won't work for me. What does 'Drag to Recorder' mean?

sparkyuiop (author)2010-02-23
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.
leshii (author)2010-01-27

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

mranalytical (author)2010-01-26

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.

mranalytical (author)2010-01-23

Step 5 mentions 115200bps but that wasn't working for the Sparkfun CP2102 device. I used 9600bps and it then worked like a charm.

thomasantony (author)2009-09-13

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.

No, it doesn't. ExtUSB = extended USB, so the only thing using a miniUSB connector will do is restrict what pins are made acessible on the phone.<br /><br />

Hmm.. ok I did frequently corrupt my microSD card while trying to add files via the miniUSB cable.

Using a miniUSB cable as opposed to an ExtUSB cable does not increase your risk of corrupt files. I'm guessing you are forgetting to eject the the volume before pulling the cable. If you don't do this, especially under an awful OS like Windows, your files will become corrupted.

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.

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.

pioioip (author)2009-10-21

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?

pioioip (author)pioioip2009-10-21

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.

macpoddotnet (author)pioioip2009-10-21

 No, it shouldn't be persistent. I am also 100% confident that the two kernels I uploaded sofar let you do serial communications with cyanogenMod 4.1.999 because they were tested and confirmed to work by myself and two others. The firsk kernel did have the camera functionality related problem however.. That is why the second one was uploaded (and tested).

Have you tried outputting /dev/urandom to /dev/ttyMSM2 then attaching a buzzer between the G1's TX0 and ground?

Oh yea, cepr's comment earlier holds a good point. Headsets short a pin to ground on the g1 to allow the phone to identify that they are attached. If that pin happened to be the TX0 pin, that could cause problems. Off the top of my head I am not sure that it is though... I think grounding the audio ground to the chassis ground does the trick. 

pioioip (author)macpoddotnet2009-10-21

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.

macpoddotnet (author)pioioip2009-10-21

A recent cyanogen kernel commit which contained some code that messed with the camera and possibly more might be the culprit. At the very least I know it constantly displayed the headset icon. That code has since been pulled from the repo.

I built and tested a new kernel for cyanogen mod which you can grab from the downloads section of the google code serial api website. Try that!
I definitly think you need to install the new kernel, but I also think you have a second problem, and that is likely wiring (double check that everything is connected fine)

cepr (author)pioioip2009-10-21

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.

Hjorvarth (author)2009-09-22

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.

macpoddotnet (author)Hjorvarth2009-10-08

You will need to write some software for android. Think of the phone as a tiny linux box with a serial port.

cepr (author)2009-10-07

I dreamed of this serial port on the G1, so I am really happy finding this tutorial !
I am not really interrested by kernel debugging, but I would like to communicate with a microcontroller.
I have just finished a sort of hyperterminal for Android just to read and write some bytes to
the serial port, and it works on the emulator by connecting to /dev/ttyS2.
Nevertheless, on my HTC Magic (same hardware than the G1), I do not see any activity on this serial port.
I think my kernel must be misconfigured.
Did anybody already tried it ?

cepr (author)cepr2009-10-07

Thanks macpoddotnet, I just read your post below :)
I will try to recompile a kernel without kernel debugging, and use ttyMSM2 (when I tryied ttyMSM0, it just crashed my phone ;))

UltraMagnus (author)2009-03-24

Funny I should be posting this from my g1 Could this not be made much simpler and cheaper by just using a mini usb jack and a max232 or similar chip? I never realised how simple and powerful that port on the bottom of the g1 was though. Gives me a few ideas of my own, thanks.

macpoddotnet (author)UltraMagnus2009-03-24

The CMOS-TTL Level serial pins on the G1 are located on the extended pins offered by the HTC ExtUSB connector. For this reason a mini usb jack will not work.

If you have a serial port on your computer or a usb to serial adapter already, you might be able to cut some costs by buying something like this ( but then you will need to build a ~2.8 voltage regulator to feed the VCC port ~2.8v. That will probably cost you 20 bux so you wouldn't save much.. if anything really.

mayosmith (author)macpoddotnet2009-09-30

Our company is working on a project and we need help making a slightly exotic patch cable for HTC G1. Please contact for more information.

tlalexander (author)macpoddotnet2009-03-24

"...but then you will need to build a ~2.8 voltage regulator to feed the VCC port ~2.8v. That will probably cost you 20 bux so you wouldn't save much.. if anything really." I'm not sure why you say that a 2.8v regulator costs $20, a little variable voltage regulator and a couple of resistors will cost you less than $2... -Taylor

macpoddotnet (author)tlalexander2009-03-24

I don't mean the regulator alone will cost 20$, I mean the combined max232 board I pointed out (13.95$), and voltage regulator components (3$). I was also accounting for shipping. :)

About This Instructable




More by macpoddotnet:Android G1 Serial to USB Cable
Add instructable to: