PiTime — a Mathematical LED Clock
by Next Builder DIY in Circuits > Clocks
2471 Views, 17 Favorites, 0 Comments
PiTime — a Mathematical LED Clock
In a world where everything is designed for speed, even time is something we read without thinking. A quick glance, and we move on. But what if a clock could slow you down—just enough to make you think?
That’s the idea behind this PiTime — a Mathematical LED Clock. Instead of traditional numbers, each hour is replaced with a mathematical expression. You don’t just read the time—you solve it. What looks complex at first quickly becomes fun, turning every glance into a small, satisfying challenge.
Built around the Raspberry Pi Pico 2, this clock combines math, design, and embedded electronics into a single compact system. A PCF8563 RTC module keeps the time accurate even when power is lost, while 12 RGB LEDs replace traditional hands—using color to represent hours, minutes, and their overlap in a clean and minimal way.
The entire design is housed in a custom 3D-printed circular enclosure, carefully divided into 12 sections, each engraved with a unique equation. Powered by a rechargeable 18650 battery, it stays completely wire-free, focusing only on what matters. Even seconds are intentionally left out—to keep the experience calm, simple, and distraction-free.
This isn’t just a clock—it’s a small shift in how we experience time. It blends logic with creativity, turning something ordinary into something interactive, thoughtful, and just a little more fun. It’s where math meets making, creating a clock you don’t just read—you solve.
Supplies
CAD & 3D Printing
To begin this project, I designed the PiTime using Fusion 360. The goal was to keep the design simple, compact, and easy to assemble, while still giving it a clean and modern look.
The enclosure is fully 3D-printable, with a circular layout divided into 12 sections, each representing a mathematical expression. Everything is designed to fit neatly—from the LEDs to the controller and battery—making the build straightforward and beginner-friendly.
If you’d like to explore or modify the design, you can open it directly in your browser using the Fusion 360 Web Viewer. You can download the required files below:
- Top.stl
- Bottom.stl
You Can
- Download the STL files and print them directly
- Download the Fusion 360 (STEP) files to modify the design as per your needs
⚠️ Note: This design is shared for educational and personal use only, not for commercial purposes.
Led Strip Assembly
Start by cutting the LED strip into individual pieces. Each segment should contain one RGB LED, making a total of 12 LEDs—one for each hour position.
Once all pieces are ready, place them inside the 3D-printed body along the circular path. Make sure they are evenly spaced so each LED aligns with its corresponding math expression on the front.
While placing them, pay attention to the data direction (DIN → DOUT) marked on each LED. All LEDs should follow the same direction in a chain, otherwise they won’t work properly.
Charging Module Assembly
In this step, we add the charging module, I’m using a compact battery charging board that I designed myself. It’s small, efficient, and fits perfectly inside the enclosure. If you’d like to build or modify it, you can find all the source files (PCB, schematic, BOM) linked here.
Place the charging module into the side slot of the 3D-printed body. Make sure the USB Type-C port is aligned properly with the cutout so it’s easily accessible from outside. Once aligned, fix it in place using a small amount of glue to keep it secure.
Connection
Now it’s time to wire everything together carefully. Follow the sequence to avoid mistakes, you can also check the provide circuit Diagram for clear understanding.
PCF8563 RTC
- Pin 6 → GP4 → RTC SDA
- Pin 7 → GP5 → RTC SCL
- Pin 36 → 3V3 OUT → RTC VCC
- GND pin → RTC GND
WS2812B LED Ring
- Pin 34 → GP28 → LED ring DIN (NeoPixel data)
- Pin 39 → VSYS → LED ring 5V power
- GND pin → LED ring GND
18650 Battery
- Battery + → Pin 39 VSYS
- Battery − → GND pin
Battery Assembly
Take your 18650 battery and place it into the battery holder designed in the enclosure. The holder keeps the battery secure and centered, so it sits neatly without moving around.
Install MicroPython Firmware
This step is like installing an operating system on your Pico. You only need to do this once.
Download the Firmware
Go to the official MicroPython page for Pico 2: https://micropython.org/download/RPI_PICO2/
- Download the latest .uf2 file
- Save it to your Desktop
Flash the Firmware
- Press and hold the BOOTSEL button on your Pico
- While holding it, plug the USB cable into your PC
- Release the button
- A new drive called RPI-RP2 will appear
- Drag and drop the .uf2 file onto this drive
The drive will disappear automatically — this means MicroPython is now installed successfully.
Set Up Thonny IDE
To write and upload code to the Pico, we’ll use Thonny IDE, which is simple and beginner-friendly. It comes with Python built-in, so you don’t need any extra setup.
Download & Install Thonny
- Go to (Thonny)
- Download the latest version
- Install it like normal software
Connect Thonny to Pico
- Plug the Pico into your PC (no BOOTSEL this time)
- Open Thonny
- Go to: Tools → Options → Interpreter
- Select: MicroPython (Raspberry Pi Pico)
- Keep port as Try to detect automatically
- Click OK
Upload the Code
Get the main code and ready-to-use .uf2 file from the PiTime GitHub Repository.
Open the Code
- Download main.py from Github Repository.
- In Thonny: File → Open → This Computer
- Select main.py
Save to Pico
- Go to: File → Save As
- Select: Raspberry Pi Pico
- Save as: main.py
The file name must be main.py this ensures the Pico runs your code automatically on every power-on.
Set the RTC Time
The RTC module does not know the time initially—you must set it once.
Open Shell
- Click the Stop (⛔) button in Thonny
- Wait until you see: >>>
Import Function
Type:
Set Current Time
Use 24-hour format:
Examples:
- 9:05 AM → rtc_set_time(9, 5)
- 12:30 PM → rtc_set_time(12, 30)
- 3:45 PM → rtc_set_time(15, 45)
- 8:00 PM → rtc_set_time(20, 0)
Assembly
Place the Raspberry Pi Pico 2 into the center slot of the enclosure. It should fit snugly in the dedicated Slot. Next, place the RTC module on the Pico in the available space. Keep it flat and well-positioned so wiring stays clean and short.
Arrange both components neatly inside the center area, ensuring nothing overlaps with the LED sections. This helps keep the design compact and avoids any interference when closing the case. you can secure the components using a small amount of glue if needed.
Top Assembly
Take the top cover (the one with the math expressions) and carefully place it over the base. Before closing, make sure all wires are neatly arranged & LEDs are aligned properly with their sections. Gently press the top cover into place. this design uses a snap-fit, it should click into position.
Testing
Now our clock is fully assembled and ready to use. You should first see a startup animation, and then the clock will begin showing the time. Each LED represents one position on the clock (like 1 to 12).
- 🔴 Red LED shows the hour
- 🟢 Green LED shows the minute (in 5-minute steps)
- 🔵 If both hour and minute fall on the same position, it shows a blue LED
For example:
- If it’s around 6:50,
- → LED at 6 glows red (hour)
- → LED at 10 glows green (minute)
Once you understand this, reading the time becomes quick and intuitive. For the first time, charge the battery using the Type-C port until it’s full. This ensures stable performance and longer runtime. After that, use the wall hanging slot at the back to mount the clock on the wall. Make sure it’s placed securely and aligned properly.
Final Thoughts
As a student, I had this idea of a math-based clock many times. The first version was very simple—I just wrote different math equations on paper and placed them inside a normal clock. And, it worked really well and was fun to use.
But later, I wanted to take it a step further and build something more clean, compact, and professional. That’s how this project came to life.
This clock is not just about telling time—it’s about making you pause, think, and engage. It’s perfect to keep near your study desk, in your room, or even in a school, college, or university environment where learning meets creativity.
If you liked this idea, I’d definitely encourage you to build your own version and maybe even improve it further. I’d love to hear your thoughts, ideas, or improvements.
Happy Making! 🚀