Control Multiple I2C OLED Displays on a Single Bus

Larry Bank has been on a “mission to learn as much as possible about ‘IoT’ and all the accessories/sensors/displays that are popular in…

Jeremy Cook
2 years ago

Larry Bank has been on a “mission to learn as much as possible about ‘IoT’ and all the accessories/sensors/displays that are popular in the market.” During this pursuit, he’s come across several projects which employ multiple OLED displays for user interface functions. Cheap and easy to implement via I2C, this kind of usage seems like an easy choice.

The problem, however, is that these tiny displays generally have a fixed I2C address, or perhaps a jumper to choose between two. While inconvenient, this can be overcome via multiple I2C busses, which can be accomplished with his Multi BitBang I2C library. Still, perhaps there is a way to save I/O pins in this process, and after considering that this protocol requires both the clock and data lines to go low at the start of a signal, he surmised that it should be possible for devices with the same address to share the same clock line. One would simply have to have a unique data signal for each shared address.

It’s an interesting idea, and one that he found actually does work in practice though as discussed in the project write-up, getting the proper GPIO speed did take a few advanced programming techniques. Code to take advantage of this I/O saving technique is available via the Multi OLED library on GitHub. The video above shows multiple displays in action, though as indicated by the fact that only two IO pins are used, they actually have different I2C addresses.

Jeremy Cook
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!
Related articles
Sponsored articles
Related articles