Mansour Behabadi's fpx Offers Compact, Low-Cost USB Power Delivery — and Is Configured by Light
Designed to fit in a small space, the USB-PD gadget is configured by holding it up to a screen and reading the flashing light.
If you're interested in powering your next project via USB Type-C, Mansour Behabadi has the solution: fpx, a low-cost module supporting the USB Power Delivery (USB-PD) standard and small enough to replace stock power ports on a range of devices — and configured, unusually, using pulses of light.
"My first attempt in using USB-C adapters as a power source was met with great enthusiasm. It was just a breakout board for STUSB4500 autonomous USB-PD sink controller," Behabadi explains. "Although sufficient, I wasn’t very happy with how much effort was needed to program the chip."
"Long time ago, I had the idea of setting WiFi passwords for ESP8266 boards using something like Morse code as light pulses. This method would have few advantages over alternative methods, such as wiring up the board to another device or using ESSID station names as password. I thought this was the perfect opportunity for me to try out my idea. It took a bit of thinking to come up with some signal processing methods and further changes to arrive at a fairly robust setup. There is a lot more room for improvement of course."
The result is the fpx, a 21x12mm (around 0.83x0.47in) module dominated by a USB Type-C connector and a pair of M2 mounting holes. At its heart is an STMicro STUSB4500, the same USB-PD controller found in Behabadi's original design, plus a Microchip ATtiny816 microcontroller linked to a low-cost phototransistor. When the board needs to be configured, it is simply held up to any device capable of displaying a web page — which, cleverly, flashes the screen in a pattern recognisable by the microcontroller and decoded into configuration settings, a technique previously adopted by Timex for its early Datalink smartwatch series.
The board is designed for use in a range of projects, including as an after-market upgrade for gadgets not originally designed for USB Type-C connectivity. "For example," Behabadi mentions, "fpx fits in place of [Lenovo] ThinkPad charging ports."
The fpx boards are available from Tindie at $20 each; full source code and board design files can be found under the permissive BSD 3-Clause license on GitHub, while a blog post goes into more details about the implementation of the light-based configuration system.