DIY USB Condom Circuit

In a commercial manner, “usb condom” is a security device for preventing data theft through universal serial bus (usb) interface, and is widely used by many smart phone owners to protect their valuable datas from “juice jacking”.

Since most of the smart phones on the market have been designed to employ the same port (usb) for charging the phone as data transfer, there is an opportunity to cheat a user in need of a re-charge to expose their smart phone’s data port. This “art of exploitation” is known as “juice jacking”!

Fortunately, it is easy for you to build your own usb condom to prevent accidental data exchange when your smart phone is plugged into a strange computer or a public charging station. The minuscule circuit described here minimizes the chances to steal your sensitive data or install malware on your smart phone/mobile device by isolating the data pins on any USB interface.

(usb condom isolates the usb data pins)

(usb condom isolates the usb data pins)

As seen in the circuit diagram below, the circuitry is very simple and the hardware is compact enough to fit inside a matchbox-sized enclosure. The circuit takes its input through the USB – A male jack (J1), and outputs the usb charging supply through the USB – A female jack (J2). The red lamp (LED1) is the “power-in” indicator. Rest of the components are crucial for successful operation of the usb condom, and all of these components have their own roles in this play.

usb condom circuit

Although usb specification allows plug and unplug usb devices while the computer or usb end device is in operation (plug ‘n’ play), during a hot connect (or disconnect) the inrush current from the usb port to the usb device can create harmful transients. In this circuit, that is why a schottky diode (D1) and an electrolytic capacitor (C1) is added to (slightly) improve the overall system stability.

Here, the usb condom is used to emulate a dedicated charging port (D+/D- lines are not used to carry data). Devoted chips such as TPS2540 from Texas Instruments can be used for this task because TPS2540 can handle both divider mode and BC1.2 mode. In practice, divider mode is used to charge Apple devices. BC1.2 mode is used to charge any BC1.2 mode device that can include Android phones, Blackberry phones, and other compliant devices. Inside the iPhone the charging circuit looks for a specific voltage on the D+ and D– lines to ensure that it can pull the full amount of current. If it does not see these voltages it only pulls 100 mA.

The iPhone charger puts 2 V on the D+ line and 2.7 V on the D– line (electrical signature). TPS2540 uses an auto detect feature that if an Apple device is not connected then the data lines are shorted together to provide maximum charge current for other smart phones. Since TPS2540 is not within the reach right now, another “cheap” trickery is used with the help of a resistor network (R2-R3-R4-R5) to implement the divider mode. You can find reference design diagram of TPS2540 – based usb charger at the end of this article (thanks to Texas Instruments)!

resistor table

TPS2540 usb charging

(TPS2540 operated as a dedicated charging port)

Note that, the landscape for usb charging can be complex. USB-connected smart phones do not follow one format and are subject to a variety of constraints. So, be prepared to do some experiments with the values of resistors in the resistor network (R2 → R5) in your final prototype. A quick reference table prepared after a little net-research on this subject is included here to help you to configure the resistor network for electrical signature in real-world applications. By default, jumper pads JP1 and JP2 are bridged and JP3 is opened. These jumper pads are added deliberately (and reserved) for possible enhancements in near-future.