£5* Pizza Box RGB Clock

About: Adventuring in electronics. Arduino, ATTiny, ESP8266, ESP32.

Intro: £5* Pizza Box RGB Clock

This project started when I was fortunate to find some rolls of WS2811 RGB LED tape for £1/roll on a market stall. The bargain was too good to miss and so I had to find a reason to use my newly acquired 25m of what essentially is NeoPixel tape. I used about 3m in this project.

Inspiration came in two forms from two much respected names in the maker community - neither of whom were, at the time, building clocks. The mechanics of the box were inspired heavily by a video from Fran Blanche about making a giant 7 segment display and the idea of using the NeoPixels to make each segment change colour came from the Unexpected Maker and his Neo7Segment Display project (YouTube & Tindie). You should check out both of them - they're awesome.

This Instructable is a step by step guide to creating a working display and putting a basic clock on it. At the end there is a step entitled "Make it your own" with some hints and tips on where to go next. If you do make one, please post a picture in the comments - I'd love to see how people make it their own.

Step 1: Parts List

The £5 price tag in the title is genuinely what this project cost me to make. Whether it can be replicated at that price will depend on prevailing prices at the time you purchase the parts required. I got a bargain with the LED strips and I do appreciate that not everyone will be so lucky. I have not included the cost of the pizza in the project as the boxes were only used after it was eaten :-)

I used the following purchased parts (where links in this section are marked with a * they are affiliate links - this means I earn a few pence for each purchase, but you don't pay anything more). The prices shown here are correct on the day of writing:

*Total cost for me for this project = £4.15 (£8.20 at the prices in the links above)

I also used the following materials I had around the house:

  • 4 large cardboard boxes from frozen pizzas
  • Double sided adhesive in various widths
  • Metallic Tape (though gaffer tape or any tape which will stop light getting through will do)
  • Tin foil
  • Hookup wire
  • Scrap of proto-board
  • 12V power supply, salvaged from an old printer

The tools I used were:

  • Steel ruler
  • Scalpel or sharp knife
  • Adjustable hole cutter for paper and card
  • 10mm drill
  • Soldering iron and solder

I very much used what I had to hand, there may well be different or better ways to achieve the same results. If you choose to change one part (like the LED strip for example) then you may also need to change others (like the power supply).

Step 2: Make the Box

The top of the box is made from one pizza box and the bottom from another. The dimensions I used were an accident of the size of the pizza boxes I had, but worked quite well. The dimensions for the top and bottom after trimming were 632mm x 297mm. And the final clock is 562mm x 227mm x 40mm deep (inlcuding the button).

Open the first box flat by carefully working your finger through all the glued edges then trim off the sides all round so that you have two large square-ish pieces attached by a narrow strip. Repeat this with the second box ensuring they are both the same size. There should only be score marks left down the middle of each box.

With a scoring tool (if you have one) or a blunt knife or biro score all down all sides of each box. The score lines should be 37mm in from all edges on one (this will become the bottom) and 35mm in from all edges on the other (the top). The difference here ensures that the two pieces will sit one over the other when the project is finished.

The score lines form a square at each corner. Cut along the side of the square in the long edge to leave the shorter edges with tabs at each end, then cut a small triangle off the square next to your cut line so that the tab will fit inside the completed box half. Apply double sided adhesive to the grey side of these tabs. Do this for both top and bottom. You can see the detail of the tabs and where to cut in the picture showing the template attached to the top.

We'll work on the bottom next. In the second picture (apologies for the focus issue - I didn't notice until it was too late) you can see where the tin foil should go - everything marked with a 'X' is where you don't want foil all of the rest should be covered. Leave the backing on where there is an X, place the foil and carefully trim round those areas. Be careful to avoid placing foil in the two middle sections where the electronics will go. Essentially you need to leave the areas for the electronics (see the pictures in the final section) and each of the places where tabs will be stuck to complete the box and fit the dividers.

The bottom box can then be made up by folding the edges up and sticking down the 4 small tabs. 4 dividers can then be added one at either side of the small central section and one in the middle of each resultant square. These can be made from the 3rd pizza box and should be the same width as the top and bottom were and scored 37mm in from each end. The two that fit in the middle need to be covered in foil all over on the side that points away from the middle section and only for the centre 120mm on the side that points towards the middle. The other two can be completely covered.

For the top, print the attached SVG (scale it to fit your box if it is a different size) and then cut out the white parts to the inside of each black line. Apply this template to the top and draw through to form 4 digits, 2 each side of the centre. You may find it easiest to start with the two centre digits one each side of the centre section and then the two outer digits lining the edge of the template with the score lines. Carefully cut these through with a scalpel or sharp craft knife. Using a hole cutter set to cut the width of the sections removed from the template, cut two holes in the centre section for the colon. These should be about as far apart as two opposite segments in the same digit. Finally, turn the top over, bring up all four edges on the score lines and stick down the tabs to complete the box. The top is now done and can be set aside until the last step.

Lastly make two small U shaped pieces and one bridge piece as shown in the pictures. The first two are to strengthen the areas where the electronics will be housed and the latter holds the LEDs for the colon in the centre of the clock.

Step 3: Create the Digits

This section is much easier than it looks!

Simply cut 32 of the shapes shown in the first picture (using the dimensions in the 2nd) and slot them together as shown in the third picture. If you've used a different size box you'll need to use different measurements. Essentially these follow the black lines on the template for the top but extend outwards to the corners and edges of each of the four digit sections.

I covered the printed side of the card with white sticky back paper to make them more likely to reflect the light and hide the pizza pictures from view.

Step 4: Attach the LEDs

This whole process is quite fiddly and it wise to take it slowly and patiently. The strip is fairly resilient but can be damaged if you bend it too harshly or too many times. The pics show what you are aiming for (the first has the first segment at the left and the second has it at the top).

The LED strip I used is made such that 1 pixel is comprised of 3 LEDs. So I have used 3 LEDs for each segment of each digit. You could though, just as easily, use 1 LED per segment if you used individual NeoPixel LEDs.

If you've purchased LED strip that has self-adhesive tape on it - well done, you just saved yourself an hour of pain. If, like me, your tape doesn't have a sticky backing - take some double sided sticky tape and stick it to the back of your strip. I found the easiest way was to line one edge up and then slice the overhang off the opposite side with a sharp knife.

In order to maximise the viewing angle of the display the LED strip needs to be mounted as near to the tops of the segment boxes as possible, the higher it is mounted the less chance there is of seeing the LEDs themselves as you look at the display. If you're using individual NeoPixels then these should be mounted as far into the "centre corners" of each segment for the same reason.

The LEDs need to be one "pixel" per section. In each digit they start in the top segment and go all round the edge segments in a clockwise direction. The arrows on the strip always need to point in this direction also. The last pixel goes in the middle segment. I tried a few ways of doing this and the pictures show the easiest way. You may find (as I did at first) that you cannot get the sections of tape to line up with the segments of the digit - don't worry, cut the tape at a cut point and start a new section at the next segment around.

Once the LEDs are laid into one segment cut a slit in the segment divider so the tape can be passed through without letting light through and then gently fold the tape around so that it sticks into the next segment as per the picture.

I chose to attach the LEDs to the segment dividers but it would be just as possible to attach them to the box and digit dividers (though if you intend to do that don't cover these pieces in foil when you make the box, cover the segment dividers instead.

Once you have all your LED tape stuck into each segment then you will need to connect together any sections you cut (at the very least the middle one). The data line needs to be one continuous path around each digit starting at the top, proceeding clockwise around the edge and then across the middle. This will normally be taken care of by the strip by where you have cut it simply join `Dout` at the end of one section to `Din` at the start of the next.

Now you have the data line, connect the power. The only requirement here is that one `12v` connection on each section and one `GND` connection on each section needs to be connected either to another section or to the power. It doesn't have to be at the end or even in the same place. All that is required is that all the sections of tape in a digit are connected together in some way. In the next step we'll connect the digits to the power lines and each other.

Step 5: Bring It All Together

You'd never believe it given the size, but this is the most fiddly part of the whole project. The aim is very simple, to place all the parts together and tape them down to ensure that as little light as possible can get from one segment's light box to the next.

First stick down the small spacer pieces at the top and bottom of the small central sections - the ends with the cutaways for wires should face the middle. Drill a 10mm hole right through each to the back of the box (the one at the top for the button and at the bottom for the power jack).

To the left most digit made earlier, connect two long power tails (about 40cm long) to the connections right hand bottom corner. To the next digit do the same with shorter tails (about 20cm). Repeat with digits 3 and 4 adding the tails to the bottom left corners with the short tails on digit 3 and the long ones on digit 4.

Fit the first of the digits into the first space, feed it's power tails under the dividers at the bottom until they come out in the middle section. Connect a wire to the first `Din` and feed this in the same way to the top middle section (the green one in the pictures). Repeat with the next section in and then connect the last `Dout` (middle segment) of the first digit to the first `Din` (top segment of the second digit.

Repeat with the right hand digits ensuring that the `Dout` of one digit is always connected to the `Din` of the next such there is, in effect, one continuous length of LED strip

Once all 4 are fitted apply tape to the 4 inner edges of the middle diamond of each digit and the back of the box, repeat this for the bottom and top triangles and also along the left hand side of each of the vertical dividers (I did this in two sections to allow a space for the wire which connects the segments to go through the middle. It's difficult to describe exactly where the tape goes but it should be fairly obvious in the picture.

Once all four digits are in place connect power and gound wires to the small central section of LEDs at the bottom end and a data wire to the `Din` at the top. Feed these through the appropriate gaps and place the spacer in the centre of the centre section.

Step 6: Connect It Up

Begin by soldering tails to the power socket and button and adding a little tape or heat shrink to prevent the contacts shorting. Place these in their holes and screw down.

If using the prototyping shield, add suitable headers to the shield and the Wemos (these are usually supplied with the Wemos and a further set were supplied with the shields I purchased also).

Take a small piece of scrap proto-board and solder the DC-DC converter to the middle of it (as in the picture).

Lets work at the bottom of the middle section first. Take all the positive connections (there should be 6 wires in total - one from each digit, one from the colon in the middle and one from the power jack). Solder all of these to the proto-board in holes adjacent to the `+in` of the DC-DC converter. Then bend each over and solder it to the next so that all of them and the `+in` of the converter are connected together.

Now take all the GND connections and repeat the above connecting them all to the proto-board and to the `-in` of the DC-DC converter. The model of converter I have connects the ground in with the ground out on the PCB, if your's doesn't then do this also.

The first photo shows the proto-board with all the tails from the LEDs and the power connected along with the DC-DC converter and one of the wires to power the Wemos.

Connect two long wires from the output of the DC-DC converter (again solder them to adjacent holes on the proto-board and bend them over to touch the pins of the converter) and connect them to a multi-meter set to `Vdc`, apply 12VDC to the power jack and measure the voltage at the output of the converter. Adjust the converter until it reads 3.3v. Disconnect the tails from the muti-meter and feed them up to the top part of the centre section.

Connect these tails to the prototyping shield (or directly to the ESP if not using the shield) in the positions marked `3v3` and `GND`. Connect one side of the button to `GND` also. In the picture you'll see a small switch on the proto-board, this was to allow in testing for disabling the power from the DC-DC converter when I had the ESP connected to the USB. It's not needed for normal running.

Lastly the two sets of NeoPixels (the long strip for the digits, and the colon in the middle) and the other side of the button need to be connected as follows:

  • Digit Strip - D2
  • Colon Strip - D3
  • Button - D7

Simply solder the three wires to the shield (or ESP) and that's everything connected. Use a foam sticky pad or similar to secure the protoboard in it's place and the shield or ESP also.

Step 7: Add the Code

Firstly, if you've never used the ESP8266 before, check out this video by Brian Lough for details of how to set it up.

The biggest problem when building a clock is creating the user interface for setting it. To get around this I have used an ESP8266 and the clock sets itself with NTP. This way the time should always be correct.

I'm not going to go through the sketch line by line explaining how it works as this isn't an Arduino/ESP coding tutorial and it is long enough already. There are some comments in there for those interested in how it works.

The attached sketch is a very simple one to show the basic features of the clock. The sketch is dependent on a number of libraries to make it work (some are installed by default, some are available in the library manager, some only on GitHub):

*My thanks to Ralph Crützen for merging the necessary changes into his RGBDigit library so that I can offer this project without maintaining a second version of it.

Currently the following features are implemented:

  • Displays the time in the colour set in the code
  • Flashes the colon in the middle in green where there is an internet connection and red if there isn't.
  • Toggles between showing the time (HH:MM) and the date (DD:MM) each time the button is pressed.

Ultimately many more things are possible both in terms of colour manipulation using the RGBDigit library and also in terms of fetching information to display from the internet (after all this uses an ESP8266).

I intend to continue improving the code and future versions will be available on the GitHub page. If you build this and add features to the code yourself, please do feel free to submit a pull request.

Step 8: Make It Your Own...

You now have a fully working Pizza Box Clock. The question now is what do you do with it!

At the moment my clock is still in it's "brutalist" grey board colour. However it will eventually be transformed into something rather more gentle on the eye. I have a couple of ideas of how I might ultimately make it better and these are in a list below:

  • I've thought about covering the front in wood effect vinyl and then simply slicing it away with a sharp knife where the light gaps are. It would look much more distinguished then I think.
  • I have also considered following this guide (paid for - not affiliate) and decorating the front in a steampunk/dieselpunk style.

I'd really like to see what other people do with their clocks too.

The same applies with the code. The display was conceived as a clock but there are a thousand and one ways to add extra functionality. My to do list for taking this project to the next level is below, what would you add?

  • Add temperature, humidity, pollen count from weather forecast in a cycling pattern or on the press of a button.
  • Change the brightness based on time of day (dim or off at night).
  • Change the colour of the time display based on events in my Google calendar.

I didn't put all these things here because this was long enough detailing how to create the display. Maybe I will write a follow up with some more code in the future.

If you read this far, thank you! Enjoy your clock if you make one.

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge

    Discussions