New Part Day: Three-dimensional USB Connectors

There’s an old joke that says USB cables do not exist in three-dimensional Euclidian space. Try to plug a USB cable in a socket, and the first try will always be wrong. Flip it, try to plug it in, and that will also be wrong. You will only succeed on the third try, and this is proof that USB connectors exist in higher planes of reality with arcane geometries. The joke is as old as the Pythagoreans, who venerated USB connectors as gods.

The waveform has collapsed, the gods profaned, and USB connectors that exist in only three dimensions have arrived. We’re talking, of course, about reversible USB Type A connector that will plug in the first time, every time. No need for electromancy or the “looking on the cable for the USB logo and plugging it in with that side up” method used by tech plebeians.

This discovery came after going through my daily roundup of crowdfunding press releases, eventually landing me on this idiotic project. It’s a USB charge cable that’s supposed to charge your phone twice as fast, despite the fact that charging speed is a function of current, and that’s determined by whatever you’re charging from, not the cable. Terrible idea, but they do have something interesting: a three-dimensional USB connector.

connUSBThe connector isn’t the brand new USB 3.1 Type C connector that will eventually find its way into phones, laptops, wearables of all types. This is your standard Type A USB plug you’ve known and loved for the past eighteen years. The difference here is that the chunky block of plastic that has made the common USB cable non-reversible for so many years is gone. In its place is a tiny strip of plastic that has contacts on both sides. Yes, it took nearly two decades for someone to figure out this would be a marketable idea.

While searching for a source for these three-dimensional USB connectors, the only source I could come up with was Wurth Elektronik, With Farnell/Element14 carrying a selection of connectors, a few available on Digikey, and some available on Mouser. There are even a few pre-made reversible cables available, with Tripp Lite leading the game right now.

For integrating one of these connectors into your build, there’s only one thing to watch out for: the pinout for these plugs is mirrored on each side of the thin strip of plastic going down the middle of the connector. This means your VCC and GND pins will be right next to each other, your D+ and D- signal pins right next to each other, and now you have to do your layout with eight pins instead of only four.

While it may not be groundbreaking and it makes for some confusing PCB layout work, but as told by a highly successful crowdfunding campaign, this can be a real feature for a product.

If you’ve recently come across a component, connector, or part that’s unique, interesting, or downright cool everyone should know about, send it on in and we’ll take a look at it.

Never Forget Your USB Stick Again

USB sticks are very handy. They are a very portable and relatively inexpensive means of storing data. Possibly the most annoying part about using one of these devices is when you inevitable leave it behind somewhere by accident. This is especially true if it contains sensitive information. [Eurekaguy] feels your pain, and he’s developed a solution to the problem.

[Eurekaguy] designed a custom cap for USB sticks that beeps approximately every minute after the USB stick has been plugged in for five minutes. The cap is 3D printed and then slightly modified with four 1mm holes. Two wires are routed between these holes to make contact points for the VCC and GND pins of the USB stick.

The beep circuit is comprised of a tiny PIC12F629 microcontroller along with a couple of other supporting components. The circuit is wired together dead bug style to conserve space. Three AG5 batteries power the circuit. A small piezo speaker provides the repeating beep to remind you to grab your USB stick before you walk away from the computer.

[Thanks Irish]

Trinket EDC Contest: USB Calipers

[Lou]’s entry for the Trinket EDC Contest is a great addition to the ubiquitous digital calipers found on workbenches and eBay resellers the world over. It translates the value displayed on the calipers to a USB HID interface for logging all those tricky measurements at the push of a button.

Most of the digital calipers you’ll find at Harbor Freight or on eBay are pretty much the same. There are two pads on the caliper’s PCB that give any microcontroller the ability to read what is being measured. It’s done with a 24-bit encoding scheme, where each bit is a nearly-BCD measurement in units of 1/1000 of an inch or 1/100 of a millimeter. After decoding the value, [Lou]’s trinket sends a few numbers to a computer over a USB HID interface.

Simply sending a measurement to a computer over USB wasn’t enough for [Lou]. He added three buttons to the project for typing multiple characters. The first button just sends Enter to the computer, the second sends a comma, and the third sends “/2 (Enter)”, exactly what you need to input the radius of something when measuring the diameter.

This was a project for the Trinket EDC Contest that ended a few hours ago. Nobody knows who the winner is, but there are some pretty cool prizes up for grabs including the new Rigol scope, a Fluke 179, and a soldering station.

Plug Into USB, Get a Reverse Shell

Computers blindly trust USB devices connected to them. There’s no pop-up to confirm a device was plugged in, and no validation of whether the device should be trusted. This lets you do some nefarious things with a simple USB microcontroller.

We’ve recently seen two examples of this: the USBdriveby and the Teensyterpreter. Both devices are based on the Teensy development board. When connected to a computer, they act as a Human Interface Device to emulate a keyboard and mouse.

The USBdriveby targets OS X. When connected, it changes the DNS server settings to a custom IP, to allow for DNS spoofing of the victim’s machine. This is possible without a password through the OS X System Preferences, but it requires emulating both keystrokes and clicks. AppleScript is used to position the window in a known location, then the buttons can be reliably clicked by code running on the Teensy. After modifying DNS, a reverse shell is opened using netcat. This allows for remote code execution on the machine.

The Teensyterpreter gives a reverse shell on Windows machines. It runs command prompt as administrator, then enters a one-liner to fire up the reverse shell using Powershell. The process happens in under a minute, and works on all Windows versions newer than XP.

With a $20 microcontroller board you can quickly fire up remote shells for… “support purposes”. We’d like to see the two projects merge into a single codebase that supports both operating systems. Bonus points if you can do it on our Trinket Pro. Video demos of both projects after the break.

Continue reading “Plug Into USB, Get a Reverse Shell”

Brother Builds “Zerg-Berg” Coffee Table Media Server – 38(!) USB Drives

After [Travis]’s media server died a couple months ago, his brother [Nick] secretly plotted to replace it for Christmas. Admitting it to be an “asinine Rube Goldberg” arrangement, [Nick] wanted something custom and remarkable for his sibling. Rather than go the normal SATA route, 38 USB hot-swap laptop drives were clustered together inside a custom leather enclosure with a bronzed glass top.

[Nick] picked up 45 of the 500GB drives for only $350 and designed the project around those. He spent $1000 on matching metal docks for each of them, powered by $800 worth of PCIe quad independent USB controllers – no hubs. A $550 Xeon motherboard with 14 USB ports, 16GB of RAM, a basic video card and a 1000W power supply rounded out the electronics.

Under Windows 8.1 all drives are arranged in a single giant array under Storage Spaces, no raid.

Everything was built into a wood-framed coffee table wrapped in high-end leather that [Nick] spent 65 hours hand stitching himself. Fancy brass corner braces hold the frame square. All the wires were run underneath the table so the visible surfaces are clean and clear. The table structure is lifted up on legs made from half-inch square barstock bent into a hairpin and bolted to the underside.

All together [Travis]’s Zerg-Berg media server cost in the range of $4500. [Nick] intends it to be something that lasts him a very long time.

See the video below for [Nick]’s rationalization explanation of the hardware and methods chosen.

Continue reading “Brother Builds “Zerg-Berg” Coffee Table Media Server – 38(!) USB Drives”

USB On The Teensy 3 From The Ground Up

When implementing USB on a microcontroller, most people are going to reach for V-USB if they’re using an AVR, one of Microchip’s USB libraries if a PIC is involved, or any number of the USB libraries for various ARM processors. [Kevin] had a different idea. As a challenge to himself, he wrote a USB device driver for the Teensy 3.1 microcontroller board, getting as close to the bare metal as he could get.

Writing a USB device driver first required a literature review. There are a few peculiarities in the Freescale K20 family of microcontrollers – the one found in the Teensy 3.1 – that dictate the need for a specific memory layout, using several clocks, and handling all the USB descriptors. [Kevin] started with the clocks, every last one of which must be enabled. The clock is generated by the Multipurpose Clock Generator from a 16MHz crystal, PLL’ed to the frequencies the USB module needs, and sent out over the System Integration Module.

Following the flowcharts and sequences found in the Freescale reference guide told [Kevin] exactly what needed to be done with the startup sequence, and offered a few suggestions on what needed to be done to set up all the interrupts. [Kevin] spent an incredible amount of time documenting, programming, and smashing his head against the keyboard for this tutorial, but he does give everyone a great opportunity to learn from his struggles.

While [Kevin] has a mostly complete USB device driver, his work is far from done. That’s alright, because this project wasn’t meant to be a full-featured driver; it’s still missing real error handling, strings in the configuration, and a real VID/PID. That’s alright, it’s still a great exercise in building something from scratch, especially something that very few people have built successfully.

Oh, blatant Hackaday Store plug for the Teensy 3.1.

PeriUSBoost: A DIY USB Battery Pack

If you travel often, use your mobile devices a lot, or run questionable ROMs on your phone, you likely have an external USB battery pack. These handy devices let you give a phone, tablet, or USB powered air humidifier (yes, those exist) some extra juice.

[Pedro]’s PeriUSBoost is a DIY phone charging solution. It’s a switching regulator that can boost battery voltages up to the 5 volt USB standard. This is accomplished using the LTC3426, a DC/DC converter with a built in switching element. The IC is a tiny SOT-23 package, and requires a few external passives work.

One interesting detail of USB charging is the resistor configuration on the USB data lines. These tell the device how much current can be drawn from the charger. For this device, the resistors are chosen to set the charge current to 0.5 A.

While a 0.5 A charge current isn’t exactly fast, it does allow for charging off AA batteries. [Pedro]’s testing resulted in a fully charged phone off of two AA batteries, but they did get a bit toasty while powering the device. It might not be the best device to stick in your pocket, but it gets the job done.