Introduction: Ping Pong Ball LED Clock

About: I love making things, especially light related stuff

This awesome LED clock is a quite simple project that nearly everyone can make. It can function as a Clock, can be LED decoration, or it can just be a nice piece of decoration when turned off.

Why I made this project/instructable

Last year I saw quite some great projects from people that used ping pong balls as diffusers for LEDs. This inspired me to make something with ping pong balls as well. After making some sketches and ordering parts I finally finished the project. Since some people were interested in a tutorial, I decided to improve the build and make a new improved version of the ping pong ball clock. With this instructable, I hope to get others excited and inspired to build their own projects.

Design choices

Since the ping pong balls are not oriented in a matrix, I had to come up with a nice way to display digits. The design I settled on uses 12 ping pong balls for each digit. After some sketching, I found that this allowed for the clearest digit representations. The length of the middle row is 20 balls (20*4 = 80cm). This size came to be because I wanted four digits next to each other, with a colon in the middle. I also wanted to have at least one row of balls between the digits to improve readability. Whilst doing this I found out that this way the total amount of balls and LEDs became to be 128.

Improvements over the first version

In the images, you can see the previous version and the new one (the pictures with 2 panels, the top one is the old version). The newer version:

- uses LED strips instead of separately soldered together Neo-Pixels.

- has pixels orientated in a way so it is easier to program.

- has less exposed contacts.

- has a back panel, so you can not see through gaps.

- allows for easier modifications and possible repair.

- looks cleaner, since wires and electronics cannot be seen from the front.

- Is way faster to make, since soldering 128*6 contacts, and stripping the same amount of wires takes some time


For anyone building this: This project requires some repetitive work, I advise to first make a small test version of this project to see how the end result will look like. This allows you to see if the ping pong balls diffuse the light nicely. This could also prevent mistakes that otherwise might occur later on ( like having to much space between balls). I build a small piece of this display (picture) both times I build one of these, and I am glad I did.

Step 1: Materials / Tools:


bought locally:

- Mdf plate (80*30 cm)

- Wood for a frame (has to be 5 cm wide and a total length of at least 200 centimeters )

- 128 ping pong balls (white ones preferably milky white)

- A few (4) small nails

- Old USB cable (one that can power the Arduino nano)

- Power cable from old electronics

bought online (China)

- 5V 10A power supply (lower Amperage might also work)

- Arduino nano (clone)

- ws2812b LED strip (5m 30Leds/meter IP30)

- DS3231 RTC

- Wire with 3 cores (2+ meter)


- Female pin connectors

- Resistor (between 300 and 500 Ohm)


- Saw that can cut 30-degree angles (miter-saw)

- Hand saw with fine teeth (metal-saw)

- Wire strippers

- Soldering iron

- 12mm drill

- 32mm hole-saw

- Wood-glue

- Hot-glue

- Flashlight

- Sandpaper


Picking the right type of ping pong balls is very important for this project. Ping pong balls generally have a seam where two halves were added together. This in itself is not a problem, since by making a hole in the middle one of those halves the seam will not be visible in the display. However, when the ping pong balls also have a print on one side, it is important that the print on the balls is oriented to the back. This could result in a piece of the seam being visible from the front. When buying ping pong balls, also do not buy balls that shine (reflect light). They will diffuse the light less well and it will look strange (an example of ping pong balls you should not buy).

summary: preferably use seamless ping pong balls without print that are white and do not reflect light.

Step 2: Making Holes in the Ping Pong Balls.

Each ping pong ball will have its own LED behind it. To get as much light as possible to shine through, a piece of the backside of the ping pong balls needs to be removed, so the light of the LED only has to go through one side of the ball. These holes need to be quite large (approximately 30mm) since the LEDs will not be centered behind the balls.

Making these large holes in the ping pong balls was a bit of a challenge. Since the balls are quite weak on their own, they need some support before holes can be made in them. I did this by drilling some 32mm holes in a piece of MDF. When sawing the balls, I provided pressure with one hand on the ping pong balls to press them against the hole. Since the hole was approximately 8mm smaller in diameter than the balls, the balls would just be pressed against the hole. Whilst providing pressure on one side, I sawed off the top of the ping pong ball on the other side, by just sawing in a straight line against the MDF.

Before sawing them, I made sure that the logo that was printed on the balls, was on the side that I was going to saw off. I also used my flashlight to find the seam where the two halves were added together. I turned the balls a bit more, so the logo was not visible from the front and as little from the seam was visible.

tip: If you have problems with the ping pong balls rotating, adding some double-sided tape inside the hole could help keep the ping pong balls in place

note: It does not matter if not all holes are exactly the same size, the size can vary a few mm. This can not be seen from any direction when the build is finished.

Step 3: Gluing All Balls in Rows

After making large holes in all the ping pong balls they need to be glued together in rows (2 rows of (17,18 and 19) and one row of 20). These rows should be as straight as possible and there should be no space between the balls. I used the wood I bought to build the frame to do this. By having the balls supported by the 2 pieces of wood I was certain that they were in one line. After placing a few balls, whilst making sure the holes were facing up and the balls were touching each other, I glued them together. A very little bit of glue is enough to do this. If you use to much glue it will be visible from the front. I used a flashlight again this tone to make sure ping pong balls did not have ugly spots on the front side (some had those since it were cheap balls).

Step 4: Gluing the Rows Together.

To do this I used the wood for the frame to keep 2 rows pressed together. Keep in mind to use small drops of glue, if you use to much it will be visible from the front. After placing glue on around 8 connections at a time, I provided pressure with my hands to make sure the balls were glued tight together.

Step 5: Making the Frame

The frame exists out of 6 pieces. 2 long pieces and 4 short. All the edges of these pieces should have a 60-degree angle. Since the size of my ping pong balls wasn’t exactly 40 mm, but (39,5 something), I calculated the approximate length of the frame pieces (this can be done by measuring the height or width of the panel and using a^2 + b^2 = c^2). I calculated that the inside length of the 2 long pieces should be 66.3cm, and the inside of the 4 short pieces should be 14.3cm. Since my saw was not too accurate, I made sure to cut them a bit larger, so they would not be to short.

After cutting all 6, I placed them around the ping pong ball panel, to see if it fitted well. It didn't, so I sawed a few mm of some pieces. I glued everything together around the ping pong ball panel to make sure it was glued in exactly the right shape, this was necessary since the angles were not cut perfectly in 60 degrees but were more likely 59.5 mm.

Step 6: Soldering the LED Strip

The led strip needs to be cut (one piece of 1 led, one piece of 3 LEDs, one piece of 5 LEDs and 17 pieces with 7 LEDs). The pieces of LED strip need to be wired as can be seen in the image ( first a piece of one led, then the 5 LEDs, next 17 pieces with 7 LEDs and finally the piece with 3 LEDs). The wire that connects the shorter pieces of the strip should be longer than the other pieces since it needs to cover a greater distance. I taped the strip on a piece of MDF to see if each led would be behind its own ball. After soldering all the pieces together I tested if all the solder connections were good, by activating each LED one by one (checkIfLedsAreBehindBalls.ino).

Step 7: Cutting the MDF

One the frame was done I placed the frame and the ping pong ball panel over the MDF which had the LEDs taped to it. After making sure each led was after its own ball I removed the ping pong ball panel. Next, I drew along the inside of the frame on the MDF, to get the shape I needed to cut out. I did it this way because the LEDs are not centered behind the balls and this way I have the relative position of the LEDs to the frame. After removing the LEDs that were taped to the board I cut out the shape of the panel and sanded the edges, so it fitted nicely inside the frame.

note: be aware that le LEDs will not be centered behind the ping pong balls, see sketch

Step 8: Adding Holes and LEDs to MDF

As could be seen previously, the wire connecting the LEDs is kinda in the way. The way it is right now, the wire will be visible from the front. I decided to solve this by drilling holes on the end of the location of each vertical strip of LEDs, so the wire can go on the backside. I weaved the led strip through the holes and temporarily taped it down. After making sure that again, each led would be behind its own ping pong ball I removed the tape and connected the LED strip to the board with the glue strip that is already on the LED strip.

note: When drilling holes in MDF, be really careful, you can break the board really easy.

Step 9: Gluing the Balls to the Frame

I placed the panel of ping pong balls upside down in the frame, then I applied glue on every point where the ping pong balls touched ( or barely touched the frame ).

Step 10: Attaching the LED Panel to the Frame

I placed the led panel on top of the backside of the balls. Next, I used 4 small nails to attach the panel to the frame. I did this by placing the nails on the inside of the frame. I chose to do it this way since it allows me to fix something if it ever breaks (It also allows me to double the number of LEDs, since to many lumens does not exist)

Step 11: Electronics

Okay, I have (almost) no experience with Arduino so this might not be perfect. But I tried to do this in an as simple way as possible.

I soldered connectors to the Arduino nano (black things in the image) (not necessary).

I decided to do it this way so everything can be taken apart easily again if I ever want to add Buttons or a Light Dependent Resistor (LDR) or other features to it.

Next, I connected the RTC to the Arduino, just make sure the SDA and SCl of the clock module are connected to the SDA and SCL of the Arduino Nano. Then connect the resistor between pin 9 and the data in of the LED strip.

Finally, wires were connected to the end of the LED strip to also provide power to the end of the LED strip, in order to prevent voltage drop.

Yes, it really is that simple.

To provide everything with power, I cut a USB cable that could connect to the Arduino nano in half and connected the 5V side of the two cables that went to the LED strip and the cut in half USB cable. I did the same with the Other side. This allows me to power the LED strip without supplying power through the Arduino.

A cable from an old lamp was used to connect the 5V 10A power supply with the clock.

I also drilled a hole in the bottom of one side of the frame for the power cable to go through. This allows the clock to be flat against a wall, whilst still being able to stand on a surface if preferred.

The only thing left to do is writing some code.

Step 12: Code

When uploading code, make sure the power supply is off!

Before the clock module knows the current time, the time has to be set on the module. Luckily there is some code available to do this. After only the addition of 4 lines of code and installing the DS1307RTC module, we can run this (SetTime_on_ds3231_nano.ino, link to original code / instructable about how to set the time on a DS3231RTC) code to set the time on the Arduino to the time of the PC.

With the time set, we can start looking at writing some code for this clock. I used 2 libraries in the programs, the FastLED library, and the DS3232RTC library. These two libraries will do almost all the work for you, and allow someone with very little programming experience to write programs.

Underneath here you can see The code that I used in the video on the top of this Instructable, and in most of the pictures. (timeWhiteBackgroundRainbow.ino)

<p>#include <FastLED.h><fastled.h><br>#include <DS3232RTC.h><ds3232rtc.h>
#define LED_PIN     9
#define NUM_LEDS    128
DS3232RTC myRTC(false);
tmElements_t tm;
CHSV colour( 0, 255, 180);
int counter=0;
const int Digits[10][10] =
void setup()
    pinMode(17, OUTPUT); //ground and v5 for clock module
    pinMode(16, OUTPUT);
    digitalWrite(17, HIGH);
    digitalWrite(16, LOW);
    FastLED.addLeds<</ds3232rtc.h></fastled.h>WS2812, LED_PIN, GRB>(leds, NUM_LEDS);</p><p><fastled.h><ds3232rtc.h><ws2812, led_pin,="" grb="">    myRTC.begin();
}</ws2812,></ds3232rtc.h></fastled.h></p><p>//function that uses the Digit aray to display numbers between 0 and 100
void displaynumber( int place , int number){
  for (int i = 0 ; i < 10 ; i++) {
    if (Digits[number/10][i] != 0) {
      leds[(Digits[number/10][i]+place)] = CRGB(255,255,255);;
    if (Digits[number%10][i] != 0) {
      leds[(Digits[number%10][i]+28+place)] = CRGB(255,255,255);;
}</p><p>void loop(){;
  //changes the colour of background every 10 cycles
  if (counter<10){
    colour.hue = (colour.hue+1)%256;
  }</p><p>  // sets background to rainbow colours
  for ( int i=0; i< 128;i++){
    colour.hue = (colour.hue+1)%256;
    leds[i]= colour;
  colour.hue = (colour.hue+128)%256;
  displaynumber(70,tm.Minute);</p><p>  //display colons
  if ( tm.Second%2 == 0 ){
    leds[64] = CRGB(255,255,255);
    leds[66] = CRGB(255,255,255);

I think the Code is relatively short, but it can, of course, be improved. All it does is reading the time from the RTC and displaying that time. The location of the LEDs that should be lit to form a digit is hardcoded in the matrix 'Digits'. For example, Digits[0] contains the location of the LEDs that should be lit to form a zero.

I also provided the other programs I made, they are slight alterations of the program above. The program 'CycleThroughDigits.ino' just counts up to 9999 to demonstrate how all the digits look. The program 'onlyTime.ino' just displays the time in changing colors, with no background color. Finally, 'FastledExampleCode.ino' is some code provided by the FastLED library that demonstrates some simple animations.

Step 13: Add Every Feature You Want

This project can be so much more than a basic clock, you can add buttons, make it change brightness depending on the light, have it display just some colors, make it reactive to music, connect it to wifi with an ESP. It's basically an Arduino connected to a display, everything is possible

Epilog X Contest

First Prize in the
Epilog X Contest