Build a distinctive clock with three identical 128×64 SSD1306 OLEDs: one shows seconds, one minutes, and one hours. A TCA9548A I2C multiplexer isolates the displays, allowing all three to retain the commonly used 0x3C address. A DS3231 real-time clock supplies time while the displays add vertical progress bars for the current minute, hour, and day.
How the clock works
The displays are rotated into portrait orientation and show a unit letter (S, M, or H), the current value as two digits, and a vertical progress bar. The seconds and minutes bars run from 0 to 60; the hours bar represents progress through a 24-hour day. At 12:00, for example, the hours bar is approximately half full.
As an Amazon Associate I earn from qualifying purchases.
The original animation spells out “CLOCK,” “DISPL,” and “THREE” before normal operation. Blue-yellow OLED modules can be used, but color behavior depends on the particular panel; compatible SSD1306 modules in other colors do not normally require program changes.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11This mapping follows the published code, which is more reliable than an inconsistent description in the source article:
#1 Best Overall
- TURN CODE INTO REAL-WORLD RESULTS — Follow 22+ guided lessons to make LEDs blink, read temperature and distance, move servo and stepper motors, control an LCD and respond to joystick or IR input; ideal for a family weekend build, homeschool unit, coding club or STEM classroom
- MORE PROJECT VARIETY IN ONE ORGANIZED KIT — Includes the UNO R3 controller, LCD1602 with pre-soldered header, breadboard power module, ultrasonic and DHT11 sensors, joystick, IR receiver and remote, SG90 servo, stepper motor, relay, DC motor, fan blade, displays, LEDs, buttons, resistors and jumper wires
- START WITHOUT SOLDERING — Plug-in modules, a solderless breadboard and the pre-soldered LCD help beginners focus on wiring, code and testing; the illustrated component list makes it easier to find each part and move from one lesson to the next
- LEARN THE LOGIC, THEN CREATE YOUR OWN — Use Arduino IDE and the included example code to understand digital input and output, analog sensing, timing, motor control and display functions, then change thresholds, speeds and sequences for alarms, environmental monitors, reaction games and motion projects
- CLEAR SETUP SUPPORT FOR FIRST-TIME BUILDERS — Download the latest tutorial and code, select the UNO board and correct computer port, check component polarity and breadboard rows, and keep power-module input at 9V or below; younger learners should work with an experienced adult
| Function | TCA9548A output | Code channel | Position in the published layout |
|---|---|---|---|
| DS3231 RTC | Channel 2 | 1 |
Shared time source |
| Seconds OLED | Channel 3 | 2 |
Left |
| Minutes OLED | Channel 4 | 3 |
Middle |
| Hours OLED | Channel 5 | 4 |
Right |
Channel numbers in the sketch are zero-based: 1 selects the second physical output. You can change the visual order by changing the three display-update calls.
Why the multiplexer is needed
I2C devices share SDA and SCL, but each device must answer a unique address on the active bus. Three typical SSD1306 displays all respond at 0x3C, so connecting them directly would make independent control impossible. They could mirror one another or interfere.
The TCA9548A does not change the OLED addresses. It separates the bus into eight downstream channels. The Arduino selects one channel, then communicates with the device isolated on that channel. The multiplexer normally uses address 0x70, configurable through approximately 0x70–0x77.
Arduino SDA/SCL
│
▼
TCA9548A upstream bus
├── channel 1 → DS3231 RTC
├── channel 2 → seconds OLED
├── channel 3 → minutes OLED
└── channel 4 → hours OLED
Parts
- Arduino Nano or Uno-compatible board
- Three identical 0.96-inch, 128×64 I2C SSD1306 OLEDs
- One eight-channel TCA9548A multiplexer breakout
- One DS3231 RTC module and suitable coin cell
- Breadboard, jumper wires, USB cable, and 5-V supply
- Header pins and soldering tools if the boards are unsoldered
Check every OLED before buying. “0.96-inch I2C OLED” does not guarantee an SSD1306 controller, 128×64 resolution, 0x3C address, or compatible voltage. SH1106 modules generally need a different driver. Also verify the DS3231 module and its battery-holder design.
Wire the hardware
On a classic Uno or ATmega328P Nano, SDA is A4 and SCL is A5. Connect the Arduino to the multiplexer’s upstream SDA/SCL pins. Connect each module’s power and ground as specified by its breakout board, using a common ground.
Rank #2
- 35+ Guided Electronics Projects: Progress from LEDs and buttons to RFID access, real-time clocks, motion and distance sensing, environmental monitoring, motor control and interactive displays for STEM learning, coding clubs and maker projects
- More I/O and Memory for Larger Builds: The MEGA 2560 R3 provides 54 digital I/O pins, including 15 PWM outputs, 16 analog inputs, 4 hardware serial ports and 256 KB flash for projects that combine more sensors, controls and displays
- 200+ Components for Prototyping: Includes LCD1602, RC522 RFID, RTC, DHT11, HC-SR501 PIR, ultrasonic and water-level sensors, GY-521, MAX7219, keypad, joystick, rotary encoder, relay, SG90 servo, stepper motor, DC motor, breadboard and more
- Learn, Modify and Create: Follow 35+ guided lessons with example code, then adjust sensor thresholds, timing, display text, motor behavior and control logic to turn structured exercises into access systems, monitors, alarms and interactive projects
- Organized for Repeatable Learning: Pre-soldered modules, a solderless breadboard, storage case and small-parts box reduce setup time and keep sensors, LEDs, ICs, wires and other components easy to find between projects
| Arduino Uno/Nano | TCA9548A upstream |
|---|---|
| 5V | VIN/VCC |
| GND | GND |
| A4/SDA | SDA |
| A5/SCL | SCL |
| Mux channel | Device |
|---|---|
1 (selectMuxChannel(1)) |
DS3231 SDA/SCL |
2 (selectMuxChannel(2)) |
Seconds OLED |
3 (selectMuxChannel(3)) |
Minutes OLED |
4 (selectMuxChannel(4)) |
Hours OLED |
Keep SDA/SCL wires short and secure. Do not connect the displays directly to the Arduino bus as well as to the mux channels, because that defeats the isolation.
Install the Arduino libraries
In Arduino IDE, open Tools → Manage Libraries and install:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- Adafruit SSD1306
- Adafruit GFX Library, its graphics dependency
- RTClib by Adafruit
Wire is normally supplied with the Arduino platform. The original project is attributed to Mirko Pavleski and is listed as GPL3+ on Arduino Project Hub. Follow the applicable license if you reuse or modify its complete sketch.
Test the I2C bus first
Before uploading the clock, use a scanner that calls Wire.begin(), selects each mux channel, and scans addresses 0x01 through 0x7F. Adafruit’s TCA9548A scanner example is a suitable starting point.
Expected results are approximately:
TCA Port #1: Found I2C 0x68
TCA Port #2: Found I2C 0x3C
TCA Port #3: Found I2C 0x3C
TCA Port #4: Found I2C 0x3C
The actual OLED address may be 0x3D. The multiplexer itself should normally appear at 0x70, and the DS3231 at 0x68. Confirm the actual hardware rather than assuming these values.
Rank #3
- 30+ Guided Electronics Projects: Start with LEDs and build toward LCD1602 displays, RFID access, motion detection, distance sensing, motor control and environmental monitoring for STEM learning, coding clubs, classrooms and hobby projects
- 200+ Components Across 63 Types: Includes an ELEGOO UNO R3 controller, LCD1602, RC522 RFID, RTC, HC-SR501 PIR sensor, ultrasonic sensor, DHT11, GY-521, MAX7219, keypad, joystick, relay, SG90 servo, stepper motor, breadboard and more
- Begin Without Soldering: Pre-soldered modules, a solderless breadboard, organized storage case and small-parts box reduce setup time and help beginners move from lesson to lesson while keeping LEDs, ICs, wires and sensors easy to find
- Learn, Modify and Create: Program the ELEGOO UNO R3 board with Arduino IDE using the included PDF tutorial and example code, then adjust sensor thresholds, timing, display text and motor behavior to turn guided lessons into original projects
- Flexible Power and Project Setup: Includes a 9 V, 1 A power supply, breadboard power module, 9 V battery and USB cable to support controller, breadboard and module experiments without sourcing basic setup accessories separately
Core code
Every transaction must follow a channel-selection command:
Free tools Windows power users keep installed
One-click scans. No signup required.
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <RTClib.h>
#define TCAADDR 0x70
bool selectMuxChannel(uint8_t channel) {
if (channel > 7) return false;
Wire.beginTransmission(TCAADDR);
Wire.write(1 << channel);
return Wire.endTransmission() == 0;
}
1 << channel creates a one-bit mask. Channel 2 sends 00000100, channel 3 sends 00001000, and channel 4 sends 00010000. Selecting multiple bits can enable multiple downstream buses, but this clock should select one at a time.
Initialize the RTC
RTC_DS3231 rtc;
selectMuxChannel(1);
if (!rtc.begin()) {
// Stop or report that the RTC was not detected
}
if (rtc.lostPower()) {
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
__DATE__ and __TIME__ are compile-time values, not a precise time download from the computer. Upload delay, timezone assumptions, and the build environment can make them inaccurate. For a known setting, upload once with:
rtc.adjust(DateTime(2026, 8, 18, 14, 30, 0));
Comment that line out immediately afterward. Leaving it active resets the RTC on every boot. A healthy coin cell lets a DS3231 retain time without main power. Adafruit specifies approximately ±2 ppm from 0°C to 40°C—roughly ±1 minute per year in that range—but inexpensive third-party modules may vary. See the DS3231 overview.
Initialize the OLEDs
Adafruit_SSD1306 display(128, 64, &Wire, 4);
selectMuxChannel(2);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
// Report a display initialization failure
}
display.setRotation(1);
display.clearDisplay();
display.display();
Repeat selectMuxChannel() and display.begin() for channels 3 and 4. The sketch can reuse one Adafruit_SSD1306 object because only one isolated OLED is addressed at a time; it is not creating three independent display objects. Change 0x3C to the address found by the scanner.
Read and display the time
selectMuxChannel(1);
DateTime now = rtc.now();
int hours = now.hour();
int minutes = now.minute();
int seconds = now.second();
selectMuxChannel(2);
drawDisplay(seconds, 'S', 60, seconds);
display.display();
selectMuxChannel(3);
drawDisplay(minutes, 'M', 60, minutes);
display.display();
selectMuxChannel(4);
drawDisplay(hours, 'H', 24, hours);
display.display();
delay(200);
The three displays refresh sequentially, not simultaneously. The 200-ms delay requests about five refresh cycles per second, although the RTC values only change once per second. Faster refreshing does not improve time accuracy.
Recommended Free Tools
Rank #4
- Powerful: The Arduino Nano V3.0 Board Microcontroller Built with ATmega328P and CH340 chips instead of FT232, Improved new version CH340G Replace FT232RL, making it ideal for beginners
- Seamless Compatibility: Fully compatible with Arduino Nano, supporting Arduino IDE, ISP programming and USB download. Works seamlessly with Windows, Mac, and Linux operating systems for a hassle-free experience.
- Versatile I/O & Compact Design: Features 14 digital I/O pins (6 PWM outputs), 6 analog inputs, a 16MHz quartz oscillator, USB-C power socket, ICSP port, and reset button. Its compact, breadboard-friendly design ensures easy handling and integration.
- Flexible Power Supply Options: Supports multiple power sources, including USB-C, 6-12V unregulated external power, or 5V regulated external power. The Nano board intelligently switches to the higher voltage source automatically—no jumper selection required.
- Excellent Communication Capabilities: Designed for seamless communication with PCs and arduino microcontrollers, the Nano board is fully compatible with multiple operating systems and offers stable and reliable performance for a variety of projects.
Progress bars and rotation
The drawing routine maps a value onto a 120-pixel usable height:
int usableHeight = 120;
int barHeight = map(barValue, 0, maxValue, 0, usableHeight);
int fillY = innerBottom - barHeight;
Use maximum values of 60, 60, and 24 for seconds, minutes, and hours. Because setRotation(1) changes the logical canvas, display.width() is approximately 64 and display.height() approximately 128. Base coordinates on those methods rather than landscape assumptions, or the graphics may be clipped.
Build sequence
- Confirm each OLED is SSD1306, 128×64, I2C, and electrically compatible.
- Solder headers if needed.
- Wire the Arduino’s upstream bus to the TCA9548A.
- Attach the RTC to code channel 1 and OLEDs to channels 2, 3, and 4.
- Install the libraries and run the per-channel scanner.
- Upload the sketch and set the RTC once if it reports lost power.
- Confirm the physical display order and adjust the update calls if necessary.
- Only then move from breadboard to perfboard or an enclosure.
Troubleshooting
All three OLEDs mirror one another
They are probably connected to the same bus, multiple mux channels are enabled, or the code is not selecting a channel before each update. Put one OLED on each downstream pair, scan channels individually, and verify the control byte is 1 << channel.
No devices appear
Check common ground, mux power, upstream SDA/SCL, Uno/Nano pins, breadboard rails, solder joints, and the breakout’s pin labels. Confirm whether the board expects 5 V or 3.3 V; Adafruit’s wiring guidance distinguishes these arrangements.
The mux appears but an OLED does not
Scan that channel, try 0x3D only if detected, check SDA/SCL orientation, power, channel wiring, and the controller. An SH1106 display is not automatically compatible with an SSD1306 sketch. Test one display with a standalone Adafruit SSD1306 example.
Best Value
- ATmega328P Microcontroller: Powered by the reliable ATmega328P, running at 16 MHz with 32KB of flash memory, 2KB SRAM, and 1KB EEPROM, offering ample resources for a wide range of basic to advanced electronics projects.
- 14 Digital I/O Pins & 6 Analog Inputs: Features 14 digital I/O pins (6 of which support PWM output) and 6 analog inputs (10-bit resolution), providing flexible options for sensors, motors, and other external components.
- USB Connectivity for Easy Programming: The built-in USB port allows for direct programming and serial communication, enabling a simple connection to your computer for sketch uploading and debugging through the Arduino IDE.
- Compatible with Arduino IDE: Full compatibility with the Arduino IDE ensures easy access to a vast array of libraries, code examples, and community-driven projects, making the Uno a great choice for both beginners and experienced makers.
- Widely Used in Education & Prototyping: The Arduino Uno is a standard in educational environments, widely used for learning and teaching electronics and programming. It's perfect for prototyping, robotics, IoT projects, and more.
The RTC is missing
Select the RTC channel before both rtc.begin() and rtc.now(). Check for 0x68, correct battery installation, and a genuine DS3231-compatible module. Do not initialize the RTC while an OLED channel is selected.
The time resets or is wrong
Check the coin cell and remove any permanently enabled manual rtc.adjust() call. For several-hour errors, check whether you entered local time or UTC and remember that now.hour() is a 24-hour value. Compile-time initialization is not automatic timezone synchronization.
Flicker, slow refresh, or clipped graphics
Shorten jumper wires, improve breadboard contacts and power delivery, check for excessive bus capacitance, and avoid leaving multiple channels enabled. Full-screen redraws over I2C are inherently sequential. For clipping, recalculate coordinates after setRotation(1).
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteDesign trade-offs and alternatives
Three displays make the clock visually distinctive and give each time scale a large value and dedicated bar, but they require more wiring, power, enclosure space, and troubleshooting than one display. The DS3231 provides offline, battery-backed time, but requires a coin cell and an initial time-setting step.
Displays with configurable addresses may avoid a mux for some two-display combinations, but three fixed-address OLEDs are a strong use case for the TCA9548A. SPI OLEDs avoid address collisions at the cost of more wires and chip-select pins. A single larger OLED is simpler and more information-dense. An ESP32 or ESP8266 with NTP removes the RTC but adds Wi-Fi, timezone, and daylight-saving complexity.
For a durable build, test every channel before soldering, keep the displays evenly spaced, provide header and cable clearance, add strain relief, and leave access to the RTC battery. The project is valuable not only as a clock but also as a practical demonstration of isolated I2C buses.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →




