PiTime — a Mathematical LED Clock

by Next Builder DIY in Circuits > Clocks

2471 Views, 17 Favorites, 0 Comments

PiTime — a Mathematical LED Clock

PiTime.png
PiTime 20.png
PiTime 21.png
PiTime Test Video.gif
Build Your Own Mathematical Clock | PiTime

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 PiTimea 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

PiTime 02.png
Components
  1. Raspberry Pi Pico 2 (Waveshare / Amazon)
  2. PCF8563 RTC module (Waveshare / Amazon)
  3. RGB LEDs Strip (Waveshare / Amazon)
  4. 18650 battery (Robu / Molicel)
  5. Battery Charging Module (Amazon)
Tools
  1. Soldering Wire (Amazon)
  2. Miniware Soldering Iron (Amazon)
  3. Xtar VX4 Battery Charger (Amazon)

CAD & 3D Printing

PiTime 05.png
PiTime 03.png
PiTime 04.png

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:

  1. Top.stl
  2. Bottom.stl

You Can

  1. Download the STL files and print them directly
  2. 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.

Downloads

Led Strip Assembly

PiTime 06.png
PiTime 07.png
PiTime 08.png

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

PiTime 11.png
PiTime 10.png
PiTime 13.png
PiTime 12.png

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

PiTime 16.png
PiTime 26.png
PiTime 27.png
PiTime 23.png

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
  1. Pin 6 → GP4 → RTC SDA
  2. Pin 7 → GP5 → RTC SCL
  3. Pin 36 → 3V3 OUT → RTC VCC
  4. GND pin → RTC GND
WS2812B LED Ring
  1. Pin 34 → GP28 → LED ring DIN (NeoPixel data)
  2. Pin 39 → VSYS → LED ring 5V power
  3. GND pin → LED ring GND
18650 Battery
  1. Battery + → Pin 39 VSYS
  2. Battery → GND pin

Battery Assembly

PiTime 24.png
PiTime5.png
PiTime 29.png

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

Screenshot 2026-04-30 130248.png
Screenshot 2026-04-27 222546.png

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/

  1. Download the latest .uf2 file
  2. Save it to your Desktop
Flash the Firmware
  1. Press and hold the BOOTSEL button on your Pico
  2. While holding it, plug the USB cable into your PC
  3. Release the button
  4. A new drive called RPI-RP2 will appear
  5. 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

Screenshot 2026-04-27 221626.png
Screenshot 2026-04-27 222650.png
Screenshot 2026-04-27 222726.png

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
  1. Go to (Thonny)
  2. Download the latest version
  3. Install it like normal software
Connect Thonny to Pico
  1. Plug the Pico into your PC (no BOOTSEL this time)
  2. Open Thonny
  3. Go to: Tools → Options → Interpreter
  4. Select: MicroPython (Raspberry Pi Pico)
  5. Keep port as Try to detect automatically
  6. Click OK

Upload the Code

PiTime 34.png
Screenshot 2026-04-30 125923.png
Screenshot 2026-04-30 100433.png
Get the main code and ready-to-use .uf2 file from the PiTime GitHub Repository.
Open the Code
  1. Download main.py from Github Repository.
  2. In Thonny: File → Open → This Computer
  3. Select main.py
Save to Pico
  1. Go to: File → Save As
  2. Select: Raspberry Pi Pico
  3. 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

PiTime 33.png

The RTC module does not know the time initially—you must set it once.

Open Shell
  1. Click the Stop (⛔) button in Thonny
  2. Wait until you see: >>>
Import Function

Type:

from main import rtc_set_time
Set Current Time

Use 24-hour format:

rtc_set_time(10, 15) # Example: 10:15 AM
Examples:
  1. 9:05 AM → rtc_set_time(9, 5)
  2. 12:30 PM → rtc_set_time(12, 30)
  3. 3:45 PM → rtc_set_time(15, 45)
  4. 8:00 PM → rtc_set_time(20, 0)

Assembly

PiTime 30.png
PiTime 29.png

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

PiTime 20.png

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

F2J2ZNXMOKJNCWP.gif
PiTime 21.png
PiTime 31.png
PiTime 32.png

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).

  1. 🔴 Red LED shows the hour
  2. 🟢 Green LED shows the minute (in 5-minute steps)
  3. 🔵 If both hour and minute fall on the same position, it shows a blue LED
For example:
  1. If it’s around 6:50,
  2. → LED at 6 glows red (hour)
  3. → 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! 🚀