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]
Like!
Thanks! :D
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.
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?
‘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.
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.
What program did you use for the schematic?
I use the open source software KiCAD for all my PCB design work.
Humm used it got the error : usb_wrapper.sch is NOT an EESchema file! Using KiCAD 2011-05-25 Build
You need a much newer build. Mine is from late 2013.
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.
Oh, does it fit in a Tic-Tac box?
Agreed! If someone local to me is willing to work with me on this we can make it happen. I just don’t have the resources to do so :(
Why don’t the phone manufacturers add enough security so that you can safely use the USB plug directly ?
I believe Android phones are secure in the default configuration. (Don’t leave developer mode turned on if you’re traveling.)
I’m honestly surprised iPhones can be compromised silently from USB. Does someone have a link to the vulnerability disclosure?
This vulnerability has been fixed in iOS 7+
http://www.pcpro.co.uk/news/security/383407/apple-fixes-fake-iphone-charger-vulnerability
Yup! Sadly not all Apple devices can run iOS7. Nor do I believe there are no other attacks. With all this NSA stuff I wouldn’t be surprised if we found out they have something going on with Airport chargers…
Here is the article I link to about juice-jacking: http://krebsonsecurity.com/2011/08/beware-of-juice-jacking/
That article is 3 years old, plus his information is older than that. when they did this trick at defcon it was done to 4 year old phones or older. Talking iphone 3GS and early paleo era android.
That is true. Here is an article from June 2013 http://www.extremetech.com/extreme/157207-black-hat-hackers-break-into-any-iphone-in-under-a-minute-using-a-malicious-charger
They cant. you have to click on the “trust this computer” popup that displays on the screen before it will communicate with any data device connected to it.
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!
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.
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.
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 :)
makes abosulte sense !
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!
Surely a cable with the data lines removed would be a far more practical solution?
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.
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?
Case = Kickstarter this! Go into production! Great idea. So simple and elegant… but needs a cool exterior
Good idea! But first I’d need someone with that sort of experience before making promises on Kickstarter.
Please, can someone make a PDF version of the schematic? I do not want to install kicad just for this purpose.
Sure, I’ll do it later today.
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.)
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!
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)
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!
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.
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.
But what if you don’t want it to go at the highest power?
Unless someone is flirting with an attractive stranger at the charging station, most people would want to finish charging ASAP.
Exactly. If you’re at a public charging station with your latest iPad, you have no idea what the max output of the charger is. With this you can try a few different settings to find the highest rate that works. Maybe that’s 1A, or maybe 2.1A. Its either that or 500mA with the shorted lines.
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.
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.
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.
Oh that’s neat. I’ll have to check that out, thanks!
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.
Yeah I’m going to work on some of these changes for the next revision. Thanks for the suggestions!
I’m like you, always worried about the voltages being in the ballpark.
And the various videos of testing cheap USB chargers don’t help to ease the mind exactly.
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.
Dear lord, 11 minutes of blah blah blah in video format, and he never even plugs the damn thing in.
@tekkieneet: How can you be contacted? I’ve been on your WordPress blog and left a comment on your About page with my email address, and would appreciate if you could get back to me.