Cheap Cable Reused To Add USB To Your Project

You get what you pay for. [Jkx] wanted to see how a USB to RS232 cable could be sold for just $1.70 and found out that it’s not actually RS232 compliant. The cable communicated as TTL levels, not the 12V expected of RS232 (although it can handle 12V incoming). He didn’t really want to use them for their intended purpose anyway. By betting rid of the DB9 plug and reusing the enclosed circuit board he now has a really cheap way to interface a microcontroller with the Universal Serial Bus. He worked out a couple of short subroutines that take care of receiving and sending data over the connection.

38 thoughts on “Cheap Cable Reused To Add USB To Your Project

  1. since Uarts are almost ubiquitous on embedded processors and most PC don’t have serial ports now a days… hasn’t just about anyone who messes with micro controllers done something similar?

  2. I don’t see how this is any special. He uses a cheap usbrs232 adapter which of course only supplies 5v peak TTL levels and thus bitbangs 5v-rs232 on his µC side. So why did he even bother ripping the cable apart? Many µCs come with USB these days and I heard some have even software implementations bitbanging it. Native USB is far more flexible than abusing rs232 (over USB) for binary communication anyway. I might be biased since I only recently started working with µCs and I’ve only had some stm32 (arm cortex m3) so far, which are pretty powerful and have easy to use native USB…

    Greetings from Germany,
    Dekar
    This is pretty lame IMHO.

  3. Tell me if I’m wrong, but a search for ‘usb’ and ‘ttl’ bring up some pretty cheap usb-to-ttl modules already; I think finding one with pretty mature drivers would be the best bet (prolific?). Though not all uCs come with uart, and even fewer USB.

  4. You know, if you look for them, many modern Mothers still come with serial ports. My latest has one, but I’ll need to pull the signal lines outside the case. (the MoBo also came with PS/2 ports. No adapter needed for my Model-M!)

    (now I’ll need to check to make sure I’m really getting +/- 3 to 12 volts from the MoBo)

  5. I think the point is that this was this guys first time working with a serial port and found a really cheap way of making it work. If that’s the case than great job guy!

    I’m not following why he could not use the UART in the Arduino though.

    Aaron

  6. been there done that (though I used a old compaq PDA cradle cable)

    and yes its not uncommon for open architecture boards to have 1 serial port still, and pci cards cost less than 20 bucks shipped that give you 2 more and an extra parallel port too

    please, PLEASE “hackers” quit buying a HP down at walmart on your mom’s credit card and you will get basic functionality from your pc

  7. Funny how everyone just ignores the hack itself…

    I think it’s quite nice, especially if you have a laptop as your primary workstation (just like myself)…

    Try and find a NEW laptop with serial port ^^

    Thumbs up, it’s a nice hack, I just ordered to of these cables from Ebay for $3.44 or so…

  8. Don’t quite understand the negative reaction myself. Sure, it is hardly new or used to those of us who have FTDI 232R, prolific 2303 and silabs CP201x chips, cables and modules littering the floor and our own CDC-ACM stacks written in assembler just to up the “snob” factor.

    What I found interesting was the PRICE such a USB-RS232 bridge could be had for. This was an eye opener as my standard rule of thumb was $20USD.

    Also the fact that some cheaper cables do NOT have any true RS-232 level shifting but have the inverted polarity was completely new to me and this will really change some of the advice I offer on some of the electronics forums.

    One other thing I would point out is that there are some micros that allow the polarity of the UART to be inverted. This hack then would allow the hardware UART to be used without having to add a “MAX232” etc. Many of the newer PIC chips have this feature.

    All in all, I found it an interesting hack.

  9. Nice hack!
    I wasn’t aware that they weren’t 100% compliant!

    This might come in handy while servicing some of the 20-year-old and over industrial PC systems that have started finding their way to my bench at work.
    (read: I was the dope who spoke up about using the old machines and now I have to remember what the HELL I was doing with these things back then!!)

    Soo, as someone who hasn’t been there and my soon be doing that I say THANK YOU!

    Good information and a cool hack.

  10. rs232 is +/- 15v, not 12v!

    dekar, of course more powerful (and more expensive) uC’s do have some kind of usb or are able to handle software implementations. but if you are working with a controller that has only 4kb of rom and not that many resources to use native usb is not an option because you dont want your controller to do usb and then have no resources to do a real task. so this is a cheap and easy solution to add (kind of) usb support to a project. i’ve got one cable like this (bought it very cheap from china) lying around that didnt work for rs232. i thought it was just crap and doesnt work at all, but now i might try it with ttl level devices. nice.

    greetings,
    a monkey from germany ;)

  11. It depends on the chip and on the configuration.

    The elcheapo COB chip they used in his converter might only be ttl, but a pl2303 can do 3v, 3.3v, 5v, and 12v without needing an extra chip, just by how one pin is wired (to gnd, v+, or floating.

    Cell usb/serial cables tend to have pl2303 chips wired for 5v but can be modded.

  12. These $2 USB UARTS do in fact report themselves as PL2303. I found to get the TTL levels back round the right way, the simplest way to do it is with a couple of logic level FETs. The tx line needs no pull-up resistor and the rx line only needs one if you can’t get your microcontroller to use it’s internal pull-up. Not a problem with AVRs, but is with some ARMs.

  13. I use the FTDI FT232R chips exclusively, there is nothing that comes close for the price. They are dependable, cheap, and have excellent driver support. Provides 3.3V from 5V for other devices, has internal security for dongle devices, hardware xon/xoff, and supports, 1.8, 2.8, 3.3 and 5V logic .It also does RS422/485 in addition to RS232 in the same chip. It also doesn’t require any external parts for 95% of uses.

    http://www.ftdichip.com/Products/ICs/FT232R.htm

    Arduino doesn’t use the atmel chips with native USB support. The USB is supported by the FTDI chip on the board.

  14. There are some real asshats on here.

    A request to HAD though. When doing posts like this it would help if you spend a bit of time looking into it yourselves and then presenting more detail and a bit of an overview. That would stop people moaning and make HAD a much more useful resource.

    ATM you basically just post a bunch of links every day. Anyone can do that. Electronics Lab at least filter their posts so we only get the really good stuff that actually presents something new. I’m not saying be just like them, but if you did more editing and editorial I think it would improve HAD a lot.

    On the subject of USB->RS232 one of the best options is a Nokia CA-53 cable. They all use the same PL2303 chip (drivers built in to Windows 7 and Linux) which is a pretty good little device. It is 5V tolerant even though it runs on 3.3V. The DA-53 cables usually have everything contained in the USB end and you can either crack it open and solder on directly or cut the Nokia end of the cable off and use that.

    With AVRs you might not even need a level shifter, especially if all you want to do is receive. The AVR’s inputs have diode clamps anyway. In fact Atmel have an app note where they connect 240V mains directly to a pin with only a 1M resistor to limit the current! A similar resistor, say 10k, works well with RS232. Many USB converters and motherboard serial ports will work with TTL levels for reception too so you may get two way comms for the price of a couple of resistors.

  15. I think a lot of people who suggest alternatives to this (FTDI chips, phone cables, etc) are missing the point. This USBSERIALMCU adapter is $1.99 on eBay (shipping included), and is one of the cheapest ways to get a microcontroller to talk to a PC which might not even have a serial port. Appreciate it for what it is.

    Similarly, I agree it’s far from novel (most of us have done something similar at some point), and I concur that HAD should use more intelligence in writing their blurbs. Some of the descriptions are insulting/embarrassing. The first sentence of this description makes me sad. This is an amazing hack, and this hacker got *WAY* more than he paid for (that’s what hacking is!)

  16. Honestly, I’m starting to wonder why we ever bother with serial anymore.

    I’m beginning to look into ARM based processors, and I’m finding that they all have builtin USB and its not that tough to use. You can get 55MHz ATMEL SAM7s processor for $2 in an easy to solder package (SMT soldering is NOT hard! I just learned it from watching youtube videos).

    There are already EAGLE footprints for some nice mini USB connectors in the SparkFun Library, and there are a few Atmel libraries that contain the SAM7 parts on the EAGLE website. Then you can send your PCB off to batchPCB for a few bucks and get yourself a very nice, easy to use board.

    There are some examples on the web for how to start off with them just acting like a USB COM port, so you can still code for the PC the same way, but there’s actually less stuff to solder. USB only requires two resistors, and they usually recommend one cap on the power line. Those SAM7 ARM chips don’t have much to hook up in EAGLE and you can get an example schematic from OLIMEX.

    I haven’t had a lot of time lately but I’m pretty much convinced that I’m ending my use of 8 bit processors as soon as I start my next project. 32 bit just isn’t that complicated anymore.

    Maybe I’ll write a tutorial. I really want to teach! Don’t wait for that though, just follow my advice here!
    -Taylor

  17. @Scott A Nokia cell phone cable is ~$3. It’s output is low voltage TTL which means it can be used with 3.3V and 5V signals. Plus, it’s output isn’t inverted, so you can use the microcontroller’s normal Rx and Tx pins.

    This hack requires you to have an off-spec USB to RS232 dongle, use up two pins on your uc, and write your own serial functions. Furthermore it requires you to give money to manufacturers of a device that doesn’t meet the specifications, thereby encouraging them to continue to do this.

  18. These Chinese factories really wouldn’t care about the spec unless it hit them on the head hard enough to make them forget how to design a circuit in the first place. ;)

    If you can get one the MSP430 launchpad has exposed TTL serial ports that can probably be hooked up to something completely different.

    And for slightly more hacking one can use an ATtiny w/vUSB.

  19. I’m intrigued, with a Nokia CA-53 cable, is it just a simple case of connecting it to the RX, TX and 5V points on a (non USB) Arduino? It can’t be that easy… I know I’m just being simple. Could someone point me to where I can get more info?! I’ve got a couple of DIY Arduino ATmega168 boards which would be great if I could use a USB cable. Thank you :D

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.