Don’t Just Go Sticking That Anywhere: Protect the Precious With a USB Wrapper

Oooh, look, a public charging station. Should you trust it? You might get juice jacked. Oh wait, you’ve got a USB Wrapper designed by [Scasagrande] to deny access to your datas.

This project was inspired by the USB Condom, but the problem with those is that they completely cut out the data lines and limit the charge rate to USB 2.0 (500mA). The data lines are used to communicate information about the charger’s power sourcing capabilities to the device. Many manufacturers short D+ and D- together, but Apple applies specific voltages to those lines.

[Scasagrande]‘s USB Wrapper gives you options. You can set it to Dedicated Charging Port, Sony, Open Circuit, or Apple. The super-cool part of this hack is for you Apple fanboys. The bottom slider lets you emulate any Apple charger and use any USB cube (including one you may have made) as long as you have that funny cable in your messenger bag.  The hardware is open source and available at [Scasagrande]‘s repo.

Make the jump to see [Scasagrande]‘s nicely detailed video about the project.

[via Dangerous Prototypes]

Comments

  1. Ren says:

    Like!

  2. Nate B says:

    Hah, sweet! I’ve built something very similar for myself and several others, but not gotten around to documenting it. But if it ain’t shared, it ain’t shite! Props to all who publish their ideas.

  3. James says:

    It’s cool, but.. If you’re going to carry this thing around, why not just carry around a little cube usb charger and a retractable charge cable?

    • Echoes says:

      ‘Cause sometime you won’t find a mains plug, but just the USB charging station. Even worse, you might be spending a few hours in an airport abroad, where they use some funny shaped mains plugs.

      • Pablo says:

        Nu-uh, your ‘mains plugs’ are the funny looking ones.

        but yes, there are many cases where you only get a USB charging plug with no option for your own AC->USB adapter.

  4. n1ir says:

    What program did you use for the schematic?

  5. Ren says:

    I think it would benefit from a 3D printed case, so the switches don’t snag on stuff while you’re carrying it around. Not meant as a rip, just a suggestion.

  6. Trui says:

    Why don’t the phone manufacturers add enough security so that you can safely use the USB plug directly ?

  7. Oh boy this project made its way to Hack a day! If you’re interested in picking one up you can find it on my website: http://www.galvant.ca . All your support goes to keeping me working on open source hardware full time!

  8. StinkySteve says:

    Buy usb cable. Cut sheath. Short the data lines. You now have a fast charging usb cable. No need for a fancy device like this. Absolute waste of time and money.

    • That will protect you from malicious chargers, but that will not activate full charging speed on all devices. So although most will check for the shorted data lines (as per the USB charging spec), Apple devices (and a few others) do not. They look for specific voltages on the data lines to determine the charger’s capabilities.

    • XOIIO says:

      Except that this won’t work for anything made by apple.

      I think it would be better to just modify the usb connector at the male end, it is big enough for small SMD components, make a small circuit that powers the data lines from the main power, it would only take a couple resistors and some diodes.

      • StinkySteve says:

        It does work on Apple… I bought a 3 amp usb charger but it would only charge my ipad at 500mA. I got a usb extension cable, cut the middle, shorted the data lines. Boom, full high charging :)

  9. makes abosulte sense !

  10. matt says:

    Where are these public USB chargers? I dont think i’ve ever seen one in my life in Chicago. I’ve seen plenty of AC outlets, but never a USB one. And if you’re really worried about something bad happening when you plug in to a public outlet, I’m guessing this does nothing to address the possibility of 120VAC being attached to the data/power pins.

    • It’s not super duper common but I’ve seen them around. Airports, some tech conferences, and some malls are places I’ve seen them.

      But no it does nothing for that kind of malicious charger. But its a good idea and perhaps I will add that in the future!

  11. lloyd says:

    Surely a cable with the data lines removed would be a far more practical solution?

    • Trui says:

      The data lines are used for signalling capabilities of the charger. Without the data lines, some equipment won’t charge, or only very slowly.

    • A lot of devices won’t charge if you simply cut the data lines. And if they do, they will charge at a slower rate.

    • tekkieneet says:

      There is a different way. What if we intentionally make a bad connection on the data line for USB data communication, but let the charging voltage/short detection can pass through?

      USB Charging spec allows for 200 ohms max between the D+/D- for charger detection and up to 1nF between the data line to GND or VBUS.

      So a good starting point is have a low pass RC filter of 100 ohms/1nF (f0=1.6MHz) in series with each of the data line and still within USB Charger spec. The other possibility is to have the full 200 ohms on one of the data lines to get the maximum high frequency attenuation.

      The charger detection only look at the voltage levels. i.e. it operates close to DC in the frequency domain. Apple chargers have tens of kilo ohms of source impedance, so a couple hundred ohms would have no effects either.

      It is very unlikely that a smart phone/tablet would connect at low speed (1.5Mbps). May be the low pass filters degrade the communication for Full Speed/High Speed enough to not have the device recognized by the evil host?

  12. Jeannie says:

    Case = Kickstarter this! Go into production! Great idea. So simple and elegant… but needs a cool exterior

  13. Renan Valente says:

    Please, can someone make a PDF version of the schematic? I do not want to install kicad just for this purpose.

  14. Henryk Plötz says:

    To be even more pedantic: Cutting the data lines limits the charging current to 100mA. Per the original specification, a device may not draw more than this amount until it has communicated its higher power needs to the OS (using the USB data channel) and got the permission to use more (so that the OS may keep track of power consumption and disallow overloading). Only the more recent specifications have provisions for higher power from dumber sources.

    (Not that I would want to imply that there’s a sizable portion of devices out there that actually implement this part of the spec correctly. With the exception of Open Source devices, like the OpenMoko phone, most hardware seems to disregard the power limits and happily draws 500mA, and more if necessary, with or without the OS’s blessing.)

  15. Wretch says:

    I need this now.

    BTW, just curious, why did he choose a micro B on the power side? Wouldn’t a male A be more convenient so you can plug it directly into the USB socket? A female A could work, too, so you can use an extension cable, but that could be confusing with the device side.

    • It’s on backorder now, but you can get it from my website: http://www.galvant.ca

      It has microB and standard B on the power side. I choose those because everyone has those cables laying around. I didn’t think of putting a male A actually. I think I’ll do that in the next revision!

      • Marty Lawson says:

        If you get 0.090 inch thick boards, you can even build a USB A male connector right into the PCB. Ultimate in cost savings there. (I’d still put the footprint for the micro-B as a backup though)

        • tekkieneet says:

          The thicker PCB and gold plating for the PCB contacts required to do this would cost you extra vs a regular PCB.

          Not much of cost saving for skipping the connector as they cost around $0.20 each (at QTY 10) from DX. I am sure you can get them even cheaper elsewhere in volume. The metal shell allows mechanical latching and some level of ESD protection as the contacts are not exposed as in the case for a PCB A connector!

  16. tekkieneet says:

    I would put an ATTiny in this to detect the voltages at the USB data lines from the “charger”.

    – Detect 2.0V/2.8V for Apple chargers via the ADC pins.
    – Detect if the data lines are shorted. If both lines reads the same voltage, chances are that they are shorted. Drive a know logic on one of the data lines and see if the other one has the same logic level.
    – ATTINY enumerates as as a 500mA device, if that fails as 100mA.

    On the data lines to the phone, a dual 4:1 analog mux e.g. 74xx4052 can be used to connect the various combinations of voltage dividers, shorting data pins or open to the phone.

    The phone’s data lines are isolated from the charging source regardless of what is at the input. This also gets rid of the mechanical switches etc.

    • I wanted to make the first version as simple as possible. Plus this has the advantage of allowing you to select the setting you want in order to override the charger. Your solution would still require some sort of user input (through tactile buttons or otherwise) if you wanted to do the same.

      But yes, I’d like to do something with an active USB device on the power side to allow for full enumeration.

    • tekkieneet says:

      Actually *NO* user interaction as it should be. The microcontroller should be able to go down that list from highest power to lowest power all on its own. I wouldn’t put that down if it can’t be done.

    • tekkieneet says:

      Unless the interaction you are talking about is for the mobile phone type which you should be able to set once unless/until you upgrade your phone.

      • Different chargers have different output current abilities. An iPad might be able to draw 2.5A but my Samsung cube is only rated for 1A.

      • tekkieneet says:

        The microcontroller should be able to detect the different dividers settings read from the charger and duplicate that (outside of actual USB bus traffic) on the mobile phones side. Your legit Samsung 1A Cube is not going to be saying that it can handle 2.5A of charging current, so your iPad would be default to whatever it can charge at when the Apple “protocol” is not supported – most likely 500mA for shorting the data lines as that’s part of the USB charging specs.

        Some additional safe guards can be made by monitoring the USB bus voltage and observe the droop as it is loaded to determine if the charger is really telling the truth about its capacity.

        Letting end users arbitrarily set higher charging current rating than what the chargers can deliver is asking for trouble and you as the designer would be liable in some countries.

        • The entire point of my project is to let you charge at whatever rate you want. If you exceed the abilities of your source the voltage will sag below the USB voltage spec cutoff. Some devices actually use this to self regulate their charging rate. An example is the Blackberry Playbook where it tries a few different charge rates and checks the voltage sag.

          Everyone who buys one gets a nice big arse warning saying not to exceed the chargers rated output.

        • tekkieneet says:

          FYI: There are USB Voltage/Current displays at $5-$7 from DX or similar places, might want to sell something like that along with your device.

  17. Tim says:

    Nicely made PCB. A couple of under/over-voltage LEDs would be handy to check the regulation of the source before starting charging. Shrink the whole thing and put it in a box, and you’ve got a useful gadget.

  18. No Name says:

    This looks like a fantastic little design. If you made it smaller and gave it a plastic shell, I’m sure it’d be highly marketable as well.

  19. Tony says:

    Dear lord, 11 minutes of blah blah blah in video format, and he never even plugs the damn thing in.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,052 other followers