USB has become pretty “universal” nowadays, handling everything from high-speed data transfer to charging phones. There are even USB-powered lava lamps. This ubiquity doesn’t come without some costs, though. There have been many attacks on smartphones and computers which exploit the fact that USB is found pretty much everywhere, and if you want to avoid these attacks you can either give up using USB or do what [Jason] did and block the data lines on the USB port.
USB typically uses four wires: two for power and two for data. If you simply disconnect the data lines, though, the peripheral can’t negotiate with the host for more power and will limp along at 0.5 watts. However, [Jason] discovered that this negotiation takes place at a much lower data rate than normal data transfer, and was able to put a type of filter in between the host and the peripheral. The filter allows the low-frequency data transfer pass through but when a high-frequency data transfer occurs the filter blocks the communication.
[Jason] now has a device that can allow his peripherals to charge at the increased rate without having to worry about untrusted USB ports (at an airport or coffee shop, for example). This simple device could stop things like BadUSB from doing their dirty work, although whether or not it could stop something this nasty is still up in the air.
Like many of us, I’m sure, [Nick] doesn’t like digging around behind his computer case for a spare USB port and ended up buying a small USB hub for his desk. The hub worked perfectly, but then [Nick] realized an Ethernet port would be a nice addition. And a DC power supply. Then feature creep set in.
What [Nick] ended up building is a monstrosity of a desk hub with two 24V, 5V, 3.3V 50 Watt DC outputs on banana plugs, a five-port USB hub, four-port Ethernet switch, three mains sockets, 32 digital I/Os, UART, SPI, and I2C ports, a 24×4 LCD or displaying DC current usage and serial input, cooling fans, and a buzzer just or kicks.
The case is constructed out of 6mm laser cut acrylic, and the electronics are admittedly a bit messy. That said, this box does seem very useful and even plays the theme from Mario Brothers, as seen in the video below.
Continue reading “Overengineering A USB Hub”
We’ve seen a ton of projects that interface hardware with the Raspberry Pi. But they usually depend on bit-banging. That means they toggle the pins in software to match a specific protocol. The thing is that the beefy Broadcom SoC that anchors the board has a lot of built-in peripherals that are just waiting to be used instead of bit banging. In this case, it’s the hardware SPI peripheral which can be accessed via the bcm2835 library for RPi.
One of the things that would have really complicated this process is the pin mapping between the Broadcom chip and the RPi GPIO header. Since not all pins are broken out, it was either luck or good design forethought that made all of the SPI0 pins from the chip available on the RPi breakout header. The library page (linked above) explains this well. But if you’re looking for more of a working example check out [EngineerByNight’s] project with adds an accelerometer using hardware SPI.
The CREATE USB Interface (CUI) was a project that came out of UC Santa Barbara around the same time the Arduino was being developed. It has a USB port, a PIC18F4550, and a prototyping area. It was designed to enable easy interfacing with the real would through many A/D inputs and general I/O ports. It supports both OSC and MIDI-over-USB natively. The biggest difference between the CUI and the Arduino is its USB support. The Arduino uses an FTDI chip to create a serial interface to its onboard AVR. The CUI’s PIC has native support for USB. That means you can have the CUI appear to be any USB HID device you want: keyboard, mouse, game controller, etc.
The Arduino has a friendly development environment and a large following though. CUI create [Dan Overholt] decided to add an ATmega168 to his board to get the best of both worlds, the CUIduino (scroll down). It can be programmed just like any other Arduino compatible device, but the having the CUI parent means your Arduino project can behave like a native USB HID gadget.