This Tiny OLED Screen Is Controlled with an HDMI Cable
For prolific maker Tim Alex Jacobs, who goes by mitxela, his projects are driven by the question "Is it possible?" rather than "Is it practical?," and his latest project wonderfully demonstrates this concept.
After toying around with the idea of using an HDMI connector for something, Jacobs realized that it contains a pair of conductors that comprise an I2C bus, and this could be repurposed and combined with a small OLED screen that would become a very small monitor.
An HDMI connector has 19 pins in total, with nearly all of them going to high-speed data, clock, and shield lines that carry massive amounts of display information to the screen at the other end. However, pins 15 and 16 are for an I2C connection between the host and peripheral controllers, as they often need to share setup information or adjust a setting.
With this new knowledge in mind, Jacobs got to work by first stripping off one end of an HDMI cable and locating the pins for serial data, serial clock, 5V power, ground, and the hot plug detect pin which signals to the host that a display has been attached by pulling its signal high. Even better, the 5V line is able to source up to 50mA of current, meaning that the OLED would not have to rely on an external power supply.
Using linux on a laptop, Jacobs ran a few I2C-related commands that allowed him to view all of the attached I2C buses and the devices on them. Once the OLED on the HDMI display data channel (DDC) was found, a quick test script was run that uses smbus via Python to send an enable command followed by some text that ensures the display is functioning correctly.
After making all of these modifications, the final step was getting the tiny 128x64 OLED display to act as if it was an actual monitor connected to the laptop, complete with a mouse cursor. Writing a video driver from scratch would have taken a massive amount of time, so instead, Jacobs opted to add a dummy monitor via the xrandr utility in order to make the xorg display server think an actual monitor is attached. Lastly, a Python script was added that uses the python-xlib package to grab the framebuffer from the virtual monitor, overlay a mouse cursor, and send it to the OLED over I2C.
Even though the framerate could use some improvements, it is quite fun to watch one of the worst HDMI displays ever created act as a full-fledged monitor and even show a basic terminal with it. For more information, you can read about this project here in Jacobs' blog post or watch his video below.