Skip to main content
Topic: USB Wrapper (Read 18454 times) previous topic - next topic

USB Wrapper

[edit] You can order it on my website at http://galvant.ca/shop/usb-wrapper/

Hey everybody, I've got another project of mine to show today.



Inspired by the USB Condom, the USB Wrapper helps protect your device against untrusted USB ports by severing the USB data lines and only allowing the power lines to connect through. This ensures that no data information can be transfered between the power source and your device. This helps against known attacks such as juice jacking: http://krebsonsecurity.com/2011/08/bewa ... e-jacking/

This however does present a problem. In legitimate USB chargers, the data lines are used to communicate to your device how much power they are capable of sourcing. The exact means by which they do vary between manufacturers. The standard calls for the D+ and D- lines to be shorted together, while companies like Apple will apply specific voltages on both lines depending on the charger. By entirely disconnecting these data lines, your device does not know any information about the charger, and will thus assume it is a standard USB2.0 port. This limits means the device will self-limit the charging rate to 2.5W, even if the charger can in fact handle more.

To deal with this, the USB Wrapper has two slider switches allowing you to tell your device what kind of charger it is connected to. This also allows you to mix and match chargers and device manufacturers which don't follow the same signalling rules. For example, an iPhone with a Samsung charger cube. It features selections for dedicated charger port (D+ & D- shorted), Apple, Sony, and open circuit. For Apple, there are 4 options, 500mA, 1A, 2.1A, and 2.5A.

The project is open source hardware and the sources can be found at http://https://github.com/Galvant/usb_wrapper-pcb

Here is a video I made today for USB Wrapper:
http://www.youtube.com/watch?v=KMzj8KeqWx8

As usual, questions/comments/concerns/etc are welcome and appreciated. Thanks!

Re: USB Wrapper

Reply #1
neat, since the design is SMD and has plenty of free room, perhaps you'd like to add a current monitor? a long bar graph along the side would look fantastic.

question: which devices use the shorted D+ and D- configuration?

suggestion: please upload PDF or PNG versions of the schematic and PCB for easy viewing, on computers without KiCAD and on smartphones/tablets

Re: USB Wrapper

Reply #2
A current monitor would probably increase the BOM by too much. I'd like to keep this one as minimal as possible. I am thinking about a more "advanced" version which could include a current monitor. Let's see if people like this version first!

Lots of devices use the shorted configuration. In fact, everything that actually follows the USB charging spec does. My Samsung Galaxy Nexus cellphone and my Blackberry Playbook tablet both check for shorted D+ and D- lines.

I usually forget to generate a PDF so I will do so later today. Thanks for the reminder :D

Re: USB Wrapper

Reply #3
ohhh you are selling this thing, I thought it was one of those "here's the design on github, take it or leave it", in which case, empty footprints and cuttable traces won't hurt.

I am currently designing a 6 port charging station with individual current monitors. I was thinking about connecting filtered PWM to the D+ and D- pins to auto detect optimal charging settings. What do you think of that?

Re: USB Wrapper

Reply #4
Yep! I just finished my MSc and I'm trying to do OSHW full time.

Is your plan to just vary the voltages on D+ and D- until you find the maximum charge rate? Totally an option but I've found that many devices will require you to disconnect the 5V supply between changing the voltages on D+ and D-. IE the device will set its charge rate when connection is initially made and does not continue to monitor those other lines. You'll need to break the 5V connection each time while hunting for that optimal rate.

Re: USB Wrapper

Reply #5
[quote author="scasagrande"]
Is your plan to just vary the voltages on D+ and D- until you find the maximum charge rate? Totally an option but I've found that many devices will require you to disconnect the 5V supply between changing the voltages on D+ and D-. IE the device will set its charge rate when connection is initially made and does not continue to monitor those other lines. You'll need to break the 5V connection each time while hunting for that optimal rate.[/quote]

Thanks for the tip. It was just an idea I was toying with. I am probably over complicating things in my design. I can't supply 6*2.5 amps from a wall-wart anyways, especially with a DC/DC converter without adding extra heat sinking.

For a single port charger, adding a MOSFET to quickly disconnect-reconnect the 5V is feasible.

Re: USB Wrapper

Reply #6
Hi! What package size is the resistors? And do you have any info on where to find the slider switches? This is a nice cheap little project to test out pcb and part ordering sites :)

Re: USB Wrapper

Reply #7
Resistors are all 0603. As an exercise to the reader, you'll have to find the switches yourself!

Re: USB Wrapper

Reply #8
[quote author="scasagrande"]Resistors are all 0603. As an exercise to the reader, you'll have to find the switches yourself![/quote]

Great, thanks =) Im 90% sure this switch will fit, Digikey: SS-24E06-TG 5 (seems i cant post links)  =P
Nice project btw. Cant wait to get my  pcbs from OHS Park =D

Re: USB Wrapper

Reply #9
*Double post*

Re: USB Wrapper

Reply #10
In the future I'd appreciate the business, even if you're looking for un-assembled boards. I'm trying to work on OSHW full time instead of getting a "real job". I'm almost going even on a monthly basis, and I don't even own a car.

But hey, its within your right to order them else where.