Arduino Matrix Clock With 3D Enclosure




Introduction: Arduino Matrix Clock With 3D Enclosure

About: I'm technician on Electronic (Data Acquisition System) with a Technological University Diploma in Electrical Engineering and Industrial Computing. Arduino and 3D Print are my hobbies.

This project is a Clock based on Arduino with a Black and White 3D enclosure.

This project uses an Arduino Mega todisplay the date and time on a RGB Panel Matrix 64 x 32 pixels.

Clock is saved by a DS1307 module.

The total dimension of the project is 20.5cm x 10.5cm x 9.5cm.

Some other ESP based project exists and works with matrix panel like this, so you can use the 3d box with it if you have an ESP card under your hand.

I'm not going to spend too much time on installing the arduino IDE or installing the arduino board on PC, because there are a lot of things on this.

Without enclosure or version whithout scaterring you could see each pixel on matrix. Print enclosure whith light scattering for apeaceful atmosphere.

I spent a lot of time to obtain a functional and pleasant result, so I can share it with all of you.

Many projects exist but none of them have been fully completed. You could look the work of the others they also deserve a big thank you. Thank for community.

There is two versions of display and two versions of enclosure:

Display version:

- Big clock date and time swaping

- Little clock with date and time on same display time

Enclosure Version:

- Light scattering, more peaceful in the dark environment, recommend big clock for it

- Without scattering for looking each pixel, recommend little clock version

Everything could be change in the code, you're free to make your own style.

I hope you will like it. Don't forget to add to favorite.


Step 1: Parts Order List

To carry out this project you will absolutely need some elements.

You can do it without a 3D printer but the rendering will be less interesting and the project also.

You will absolutly need an Arduino Mega with Dupont wires, a DS1307 clock with CR2032, a P3 RGB 64 x 32 panel and a power supply (5V, 5A or 10A) with outlet cord.

For Arduino Mega:

(6.26€ on Aliexpress)

For DS1307:

(1€ on Aliexpress)

DS1307 required CR2032 battery:

(1€ on Aliexpress)

For Panel:

(11,19€ on Aliexpress) (1/16 SCAN)

For Power Supply:

(10,08€ on Aliexpress)

For Dupont Wire:

(2.92€ on Aliexpress)

Total cost : < 40€

For make full project you need inserts and some screws. (3.20€ on Aliexpress) (3.06€ on Aliexpress)

It's depend on what you have at home, for me it's M2.5 M2 or M3 screw and inserts.

All print are made by my Anet A6 printer and PLA filament, need a printer with printable dimension 22cm x 22cm x 25cm. May you could do this with wood and CNC. (20€ / kg x 2 colors)

Equipment that I used: Screwdriver, Iron Solder for put inserts and others, Dremel for make hole for additionnal screw.

Step 2: Wiring Electronics

For electronics, connect the Arduino Mega to the matrix panel and the DS1307 clock using Dupont wires.

You must scrupulously respect the wiring diagram to avoid any risk of breakage or damage.

The wiring table and the diagram are in pictures. Some pictures are available for helping you.

Try to respect color wires for red blue and green wires. It's more simple for connecting on arduino.

Double check before energizing.

All connections are made without power.

Time for this is around 2 hours.

Step 3: Wiring Power Supply

Connect power outlet to the power supply like the picture.

L is BROWN, N is Blue and GND is YELLOW and GREEN.

Connect panel power cable to power supply, respect polarity. Red is (+) and Black is (-).

Don't forget to put your Power supply on your voltage country mode.

Please respect the power supply wiring to avoid personal injury, double check the connections. Connect the matrix to the power supply but do not yet power on the matrix.

You could add a dc connector male for arduino power without usb.

All connections are made without power.

The Unit need to look likes the global picture.

Time for this is around 30 minutes.

Step 4: Arduino Mega Code and Upload

You need to use Arduino IDE.

You need to use some libraries for use your project.

Download and install them on arduino IDE before uploading code on the Mega:

All right reserved to their creators. Thank them for their work.

Connect the arduino to the PC and connect the power the matrix with power supply.

After installing libraries, you could uploading code, maybe create a folder project with both files on it. Bitmap file is for displaying image on matrice, it work well.

After this you could powered the panel with outlet on power.

Normaly everything works, if you look on the code, you could see the attemps i've made, and some works perfectly like feuartifice() function (firework generate) with great animation, some others are working but they are not mines.

Display show time and date in light blue. Three bar show in real time, hour in blue minute in white and second in red with one pixel incrementation for each. All colors and disposition could be changed on code, it's pretty simple. (Matrice_v1.0.ino)

If you use with scattering light enclosure take the file Matrice_v2.0 for better look. It simple display time and after delay show the date. (Matrice_v2.0.ino)

For changing date and time, remove slashes, change the date and time, upload, add slashes in front of date and time, upload again.

Tip: It could work with button for adding some mode like picture or animation. I try with infrared and it's work too. You could customize it. Look Rinky Dink website for pictures.

For use it with same power supply, add arduino DC connector to the PSU. Respect polarity Red is + and Black is -.

Warning with short circuit.

NB: If you already have a 1/32 scan with E pin on matrix, you need to replace RGB_matrix_panel matrix constructor by another and look here for adapt

Time for this less than 1 hour.

Step 5: Printing Enclosure

Format of the files are STL. It's created with Autocad:

I have used CURA for slicer, it is good free slicer.

Put G-CODE or other printer format for print them on the printer, files on SD card or with an USB connection.

There is some parts to print for this project. It's made up of 5 parts:

- The base 4h15 Matrix and main board are screwed here later.

- The left side 1h25

- The right side 1h25

- The cover 5h15

- The screen 4h50 for scattering version or 2h for without scattering version

Approximately 18 hours of total impressions. I print it with PLA filament with following settings 0.3mm layer,210°C nozzle, 70°C bed and 20% infill. I didn't make timelapse of my prints only pictures of screen print part.

Tip:You may need sanding screen part for scattering version, it's delete imperfections and smooth the renderer.

Prepare Threaded Insert if you want:

After this, prepare printed parts with inserts like this:

Use M2.5 inserts on base print and sides prints. Make holes on cover part for 2.5 screw. You could add M3 inserts for others but not needed for me, it's work well without.

Tip: For screen print use white or transparent filament not a dark filament for scattering, for version whithout it doesn't matter.

Step 6: Assembly Project

Try to let a little offset between matrix panel and printed parts, leave a gap corresponding to a cutter blade.

Following the assembly of the five parts with the panel and arduino:

1 - Screw the panel matrix with two screws M3 and the arduino to the base with two or four M2.5

2 - Screw two sides with one M3

3 - Screw screen part with one M3

4 - Don't forget to connect power supply to matrix and arduino. The square hole is for the passage of the power wires. Also, screw the cover with 4 screws M2.5 to the two sides.

Tip: If you have offsets between parts, do not hesitate to add inserts on the pieces and holes on others pieces to fix them straight. Heat cover piece on corner if needed.

Assembly time is less than 5 minutes now.

Step 7: For Finish

Thank for read this.

Choose your own style, with or whitout 3D enclosure. Change colors, add controls and display pixel pictures.

For questions, do not hesitate to ask them in comment, I answer if you need help with something.

Reminder it's a personnal project not a professionnal one, it could be better, the code could be simplify but I share it to you.

Design it by myself. I made it the most simple as possible with classic style, use your own color filament and your own color for displaying the clock.

Please stay creative.

Clocks Contest

Participated in the
Clocks Contest

Be the First to Share


    • Make It Bridge

      Make It Bridge
    • For the Home Contest

      For the Home Contest
    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge



    Question 7 months ago

    I built it and it is a really nice display. Can you tell me how the numbers are created please?
    The 6 and 9 have an extra dot that should not be there.


    2 years ago

    Is there any good resource for RGB panels explanations?
    This is awesome project!


    2 years ago


    This seems to be a lovely project and I wish you do win a place in the contest. I will surely make it when I steal some time from my daily routine. I do have all the stuff needed for this project. The only difference is the RGB Display panel. I have a 32x64 P3 but the scan rate of it is 1/32s whereas you have used a 1/16s matrix panel. Any suggestions how to use a 1/32s panel with your code and the necessary changes to be made both in the code as well as the hardware connections as we have an additional E pin on a 1/32s display panel.
    Hope to hear from you soon.

    Thanks and good luck.


    Reply 2 years ago

    Well library I used could'nt work with scan because creator only use A B C and D.
    But I see an other library,
    You just need to add one dupont wire between E and A4 (arduino pin) and replace matrix constructor

    Add this :

    #define E A4

    Replace RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, true, 64) by :

    DFRobot_RGBMatrix matrix(A, B, C, D, E, CLK, LAT, OE, true, 64, 32);
    //or false
    Commands seems to be the same for control panel because use Adafruit GFX too.

    Reply 2 years ago

    Thanks for your reply. Will apply the same and update when I do the project.