Ping Pong Ball LED Clock

34,974

363

34

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

note:

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:

Materials:

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)

optional

- Female pin connectors

- Resistor (between 300 and 500 Ohm)

Tools:

- 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

note:

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 back side 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.

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) 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;
CRGB leds[NUM_LEDS];
CHSV colour( 0, 255, 180);
int counter=0;
const int Digits[10][10] =
{
  {7,8,10,11,14,18,22,24},
  {14,16,18,22,24},
  {7,8,9,11,14,16,18,24},
  {7,9,11,14,16,18,22,24},
  {9,10,11,16,18,22,24},
  {7,9,10,11,14,16,18,22},
  {7,8,9,14,15,16,18,22},
  {7,11,14,16,17,24},
  {7,8,9,10,11,14,16,18,22,24},
  {7,9,10,11,14,16,17,24},
};
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(){
  RTC.read(tm);
  
  //changes the colour of background every 10 cycles
  if (counter<10){
    counter++;
  }else{
    colour.hue = (colour.hue+1)%256;
    counter=0;
  }</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(0,tm.Hour);
  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);
  }
  FastLED.show();
}</p>

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

Share

    Recommendations

    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019
    • Tape Contest

      Tape Contest

    34 Discussions

    0
    None
    PhilipB31

    5 days ago

    I've seen a fair few instructables that have inspired me, but this is my favourite so far. I enjoyed reading about your design and thinking process, the job you did was really well executed, and your instructions and the presentation is excellent. The design itself is fantastic ... Simple, low cost, and a very impressive final piece of work. This is a great example of creativity and engineering coming together really well. I know it's probably subjective, but I think a company like Ikea would pull your arm off if you wanted to sell the design (assuming it could be made at the right cost).
    Thanks very much for sharing this.

    PS. I imagine that as word gets around about this design, it must be annoying having people constantly asking to see your balls. Any tips on how to deal with that?

    2 replies
    0
    None
    thomasj152PhilipB31

    Reply 4 days ago

    Thanks, feedback like this really makes my day and motivates me to make more projects :) I'm really glad I could inspire you. I actually wanted to produce these clocks ( with an CNC and a tool to make grooves this clock can be made way easier and faster) , but unfortunately I don't have the tools, recourses and experience needed to do that. And luckily people do not ask me about my balls all the time, although I did get a reputation as the guy with a huge load of ping-pong balls

    0
    None
    PhilipB31thomasj152

    Reply 17 hours ago

    Yes, having the preferred kit required to build something efficiently is a similar issue for me. It isn't cheap. I'm currently pondering a build, but using dark tinted marbles instead. I'd say watch this space, but it could be a while.

    0
    None
    ferra1980

    Question 6 days ago

    Great project Thomas! Congratulations.
    I really need to build one of this! I have a simple question, where did you put the "5V 10A power supply"? Isn't it too wide to place it in the back of the clock? Thanks

    2 answers
    0
    None
    thomasj152ferra1980

    Answer 6 days ago

    I just placed the power supply on the ground. Im quite sure there would've been a power supply that would've fitted behind the clock since there is quite some space left. This was the first project I made that could not be powered from an usb port, and I decided to just go with a normal power supply to see how it works. I was worried that it might get to hot when placed behind the clock. Also, 10a might have been a little to much, but I'm not sure.

    0
    None
    ferra1980thomasj152

    Reply 6 days ago

    I think 128 led ws2812B absorb 7,04A at maximum. I will try to put the power supply in the back. I'll let you know! Thanks

    0
    None
    grbreda

    Question 9 days ago on Step 11

    First congratulations gorgeous design!
    I am having difficulty making the electrical connection between all the components, I could draw or better explain the connection of the circuit
    Congratulations again fantastic!!

    Thanks!!

    Gustavo Breda

    1 answer
    0
    None
    thomasj152grbreda

    Answer 8 days ago

    I'll try making a digital image of the connections. What problems do you have with electrical connections?, I might be able to help you if you could specify what is not working.

    1
    None
    alinke

    13 days ago

    nicely done!

    1
    None
    Vex-

    18 days ago

    Hi Thomas!

    First of all, thank you for sharing this project with us, it looks quite stunning, affordable and
    relatively easy to make thanks to your detailed instructions. You'll get my vote for the contest!

    ̶I̶ ̶w̶o̶u̶l̶d̶ ̶h̶o̶w̶e̶v̶e̶r̶ ̶l̶i̶k̶e̶ ̶t̶o̶ ̶a̶s̶k̶ ̶a̶ ̶q̶u̶e̶s̶t̶i̶o̶n̶ ̶a̶b̶o̶u̶t̶ ̶t̶h̶e̶ ̶L̶E̶D̶ ̶l̶a̶y̶o̶u̶t̶ ̶b̶e̶h̶i̶n̶d̶ ̶t̶h̶e̶ ̶p̶i̶n̶g̶-̶p̶o̶n̶g̶ ̶b̶a̶l̶l̶s̶ ̶s̶i̶n̶c̶e̶ ̶I̶'̶m̶
    ̶s̶o̶m̶e̶w̶h̶a̶t̶ ̶c̶o̶n̶f̶u̶s̶e̶d̶.̶ ̶I̶ ̶m̶a̶d̶e̶ ̶a̶ ̶t̶w̶o̶ ̶p̶i̶c̶t̶u̶r̶e̶s̶ ̶e̶x̶p̶l̶a̶i̶n̶i̶n̶g̶ ̶m̶y̶ ̶c̶o̶n̶f̶u̶s̶i̶o̶n̶ ̶a̶b̶o̶u̶t̶ ̶t̶h̶e̶ ̶b̶a̶l̶l̶ ̶b̶a̶c̶k̶l̶i̶g̶h̶t̶.̶

    ̶I̶n̶ ̶t̶h̶o̶s̶e̶ ̶p̶h̶o̶t̶o̶s̶,̶ ̶I̶'̶v̶e̶ ̶p̶o̶i̶n̶t̶e̶d̶ ̶o̶u̶t̶ ̶2̶ ̶i̶s̶s̶u̶e̶s̶ ̶t̶h̶a̶t̶ ̶I̶'̶m̶ ̶n̶o̶t̶ ̶q̶u̶i̶t̶e̶ ̶s̶u̶r̶e̶ ̶h̶o̶w̶ ̶y̶o̶u̶ ̶m̶a̶n̶a̶g̶e̶d̶ ̶t̶o̶ ̶s̶o̶l̶v̶e̶ ̶w̶i̶t̶h̶
    ̶t̶h̶e̶ ̶l̶a̶y̶o̶u̶t̶ ̶o̶f̶ ̶t̶h̶e̶ ̶L̶E̶D̶ ̶s̶t̶r̶i̶p̶s̶ ̶b̶e̶i̶n̶g̶ ̶w̶h̶a̶t̶ ̶i̶t̶ ̶i̶s̶ ̶i̶n̶ ̶t̶h̶i̶s̶ ̶g̶u̶i̶d̶e̶.̶ ̶(̶L̶E̶D̶ ̶s̶t̶r̶i̶p̶s̶ ̶v̶s̶ ̶i̶n̶d̶i̶v̶i̶d̶u̶a̶l̶ ̶L̶E̶D̶s̶)̶

    ̶I̶'̶d̶ ̶a̶p̶p̶r̶e̶c̶i̶a̶t̶e̶ ̶i̶t̶ ̶i̶f̶ ̶y̶o̶u̶'̶d̶ ̶t̶a̶k̶e̶n̶ ̶a̶ ̶l̶o̶o̶k̶ ̶a̶t̶ ̶t̶h̶i̶s̶ ̶"̶a̶n̶a̶l̶y̶s̶i̶s̶"̶ ̶a̶n̶d̶ ̶e̶x̶p̶l̶a̶i̶n̶e̶d̶ ̶w̶h̶e̶n̶ ̶y̶o̶u̶'̶v̶e̶ ̶g̶o̶t̶ ̶a̶ ̶m̶o̶m̶e̶n̶t̶:̶ ̶h̶t̶t̶p̶s̶:̶/̶/̶i̶m̶g̶u̶r̶.̶c̶o̶m̶/̶a̶/̶l̶b̶D̶K̶m̶a̶Z̶

    EDIT: I figured it out (I didn't see all of the images you posted earlier).
    If anyone else is confused about this like I was, here's the answer:

    https://cdn.instructables.com/FPJ/XK9U/JTON6BBX/FPJXK9UJTON6BBX.LARGE.jpg
    https://cdn.instructables.com/FYN/31JU/JTENANP7/FYN31JUJTENANP7.LARGE.jpg

    1 reply
    0
    None
    thomasj152Vex-

    Reply 16 days ago

    I understand your confusion, the LED strip is placed in an unusual way. I moved one of those images on the page, so it is better visible, to avoid confusion. If any other things remain unclear I'll happily answer any questions.

    1
    None
    diyperspective

    17 days ago

    Looks absolutely stunning! Great idea! Love it!

    0
    None
    Quinnadt

    Question 20 days ago

    Could you send me the code you came up with to have the background of the clock display fade through colors?
    Thanks

    1 answer
    0
    None
    thomasj152audreyobscura

    Reply 19 days ago

    I entered it, I did not know about contests, thx for the tip :)

    2
    None
    Zachary Goodeaudreyobscura

    Reply 4 weeks ago

    I agree, this is pretty cool and really creative. You have a chance at that contest.

    This is so original and doesn't look like $h*t unlike other Nanoleaf imitations. Voted for you!

    2
    None
    sparkydave

    22 days ago

    Awesome project! Do you mind sharing the code for the other light effects? They look really cool and really top off the overall appeal of it

    1
    None
    dejanf2

    23 days ago

    Good idea!