Introduction

Содержание

So this project came about because Wanita at ICStation was kind enough to send me some of their MAX7219 Dot Matrix Module Control Display DIY kits. These little 8×8 red LED matrix modules are super cute, and a steal at only $2.86 each!

IMG_0941

8×8 red LED module from ICStation

I had 4 of the modules, so I took the code from my Pong Clock, stripped it down and created a mini clock. As well as the LED modules I used an Arduino to run code and a DS1307 clock module to keep time. If you want to make one yourself it’s not too hard read on!

Mini LED Clock Features:

  • Basic mode with large digits
  • Slide mode where digits roll on and off screen
  • Small digits with seconds mode
  • Time written in words e.g. “Ten past Twelve”
  • Date display
  • 12/24 hour option
  • Brightness option
  • Random clock mode option that changes the display mode every few hours.
  • Push button driven menus for setup display selection.

Parts List

  • 4 x MAX7219 Dot Matrix Module Control Display DIY kits.
  • 1 x Arduino Uno or Duemilanove with 32k RAM.
  • 1 x DS1307 real time clock module.
  • 1 x Arduino prototyping shield
  • 1 x breadboard for testing (optional)
  • 2 x Push to make buttons such as these.
  • 1 x A to B type USB Lead
  • 1 x Mains to USB power adapter
  • Wire

You’ll also need some tools:

  • Fine tip soldering iron
  • Solder
  • Liquid solder flux
  • Tweezers
  • Wire cutters
  • Magnifying glass if you don’t like squinting at tiny components.

And the code itself:

Building the Matrix Kits

The kits use a red LED matrix which plugs into a PCB with onboard MAX controller chip. The chip takes all the hard work out of controlling the LEDs. You simply need a few wires to connect the module to an Arduino, then you can control it using software. The other cool thing is these matrix PCB’s clip together with plastic jumpers, so you can make displays as big as you like. The kits need to be soldered and uses surface mount components. I was a little nervous about building them at first some of the resistors and capacitors were super tiny!

IMG_0951

The parts in the kit

IMG_0936

Teeny surface mount resistor

IMG_0937

MAX surface mount LED Controller IC

Surface mount soldering wasn’t as hard as I thought. There are some useful surface mount soldering videos which, whilst not the most exciting thing to watch, really helped me get the hang of it. The secret sauce to it all is liquid solder flux. This makes the solder bond to both the component and the circuit board.

IMG_0935

Tools I used liquid solder flux, solder, and a fine top soldering iron.

Basically you wet the PCB metal pads with the flux, melt some solder on the iron, then whilst holding the component in place with your finger or tweezers, touch the iron to the joint and the solder flows onto it. It’s actually quite satisfying to do when you get the hang of it. I found using a breadboard was helpful to hold parts in place.

IMG_0952

As for what components to solder where, you can work it out pretty easily from the ICStation website. One thing you need to be careful of is making sure you solder the pins that are used to connect different matrix modules together on at 90 degrees to the PCB. I did a few at a bit of an angle by mistake, and it meant the matrix modules didn’t clip together as well, so I had to go back and re do them.

IMG_0940

Make sure the pins around the edge are at 90 degrees to the PCB, or the boards don’t clip together well.

Once each matrix was built, I tested it using the demo program available from the matrix product page on ICStation’s website. I’ve also put this program in the download with my clock code. It’s called “LEDDemoMatrix.pde” and can be found in the matrix_test/LCDemoMatrix folder. To use it, one matrix needs to be connected up as follows:

  • Arduino Pin 10 to LOAD
  • Arduino Pin 11 to CLK
  • Arduino Pin 12 to DIN (Data In)
  • Arduino 5v to 5v
  • Arduino GND to GND

All being well your matrix should light up in various patterns to show it’s working.

IMG_0942

The test program running

IMG_0953

4 modules built don’t look too closely at the surface mount soldering!

So as I said the clever thing about these modules is that they join together using little jumper connectors, so you can chain them together in a line to make bigger displays. We need all four in a line for our clock, so join them as in the picture below. Make sure all the matrices are facing the same way, so that you connect the DOUT (data out) pin from one to the DIN (data in) pin on the next.

IMG_0955

Joining the modules together

OK let’s take a look at the other bits we need for the clock.

The Arduino

The Arduino microprocessor runs the clock software, plus provides inputs and outputs that we connect the matrix modules, buttons and clock module to. Ensure you get an Arduino with 32k RAM such as the The Arduino Uno. Older Arduino’s with 16k won’t have enough room to store the clock code.

Arduino this one is an older 32k ‘Duemilanove’, the latest model is the Uno. Both will work fine.

The DS1307 module

DS1307 module

The DS1307 module contains a DS1307 chip that keeps time, along with a battery that runs the chip if the main power is disconnected. That way even if you unplug the clock, when you plug it back in the time will still be correct. It only needs 4 wires to work. 5v and GND for power, then SDA and SCL which are used to send clock data via the i2c protocol to the Arduino.

The Protoshield

The prototyping board or ‘shield’ plugs into the Arduino making it easy to add other components. It brings the Arduino’s input and output pins onto a circuit board we can solder things to. We’ll use this to mount the DS1307 module, plus to connect the matrix display connections and buttons to.

I can’t really give you detailed instructions for what to solder where on the protoshield, as different boards have different layouts. However it should be pretty easy to figure out when you look at the list of all the pin connections needed further down. Make sure your shield comes with header pins so you can plug it into the Arduino (they’re not shown in the picture above). Some shields also come with additional bits often a reset button as they mask the one on the Arduino, and sometimes extra LED’s for you to use.

Buttons

You can use any push to make buttons. For example PCB mountable ones like below are good for soldering to the protoshield, or you could have some other type you connect via wires, say if you wanted to mount them in a case.

pcbswitch

PCB mounting buttons

Power

For the power supply I used a 500 milliamp USB adapter like this one with an A-B type USB cable into the Arduino’s USB port.

USB Power supply

USB Power supply

A to B type USB Lead

A to B type USB Lead

For testing I powered the clock with my Macbook, but be careful, if you have any shorts you could fry your computer’s USB ports!

Connecting it all up

Like I said, I can’t give you detailed instructions on what to solder where on the protoshield as they differ depending on what you buy, but below is a list of all the pins and what they need to connect to. Ideally try it out on a breadboard first to check it works, then move it to the protoshield.

Connecting the LED Matrix modules:

Once your 4 matrix modules are joined together in a line with the black jumper connectors as described earlier, look for the end one with the DIN (Data In) pin free. Connect the pins on that matrix as follows:

  • Matrix LOAD to Arduino digital pin 10
  • Matrix CLK to Arduino digital pin 11
  • Matrix DIN to Arduino digital pin 12
  • Matrix 5v to Arduino pin 5v
  • Matrix GND to Arduino pin GND

IMG_1227

I created a connector board that plugged into my matrix using some PCB stripboard and a 6 pin IDC socket. That way I could plug or unplug it from the Arduino.

Connecting the DS1307 module:

  • SDA to Arduino analog pin 4
  • SCL to Arduino analog pin 5
  • 5v to Arduino pin 5v
  • GND to Arduino pin GND

IMG_1218

Here’s my DS1307 module with the 4 connectors. Green is SCL, yellow SDA. Red and black are +5v and GND.

Connecting the Buttons:

  • Button 1 goes between Arduino digital pin 2 and GND
  • Button 2 goes between Arduino digital pin 3 and GND

IMG_1210

All the connections completed. The wires for the buttons go off top left. (Ignore the extra brown wire there it was just for testing!)

IMG_1217

My protoshield came with 2 LEDs and a reset button. I connected the green LED between 5v and GND to show power on. The red LED is connected between Arduino digital pin 13 an GND as the clock sketch flashes this to show it’s running. The reset button was already connected to the Arduino’s reset pins. You can also see the connections for the displays on the left (cable tied to the board), and the button connections top left.

Uploading the Clock Code

The last job is to upload the clock code to the Arduino. First you’ll need to download the Arduino programming software called the Arduino IDE. The current clock code was tested with IDE version 1.6.5. You can download the IDE from the Arduino site: http://arduino.cc/en/Main/Software

Once the IDE is installed download the Mini LED Clock code from my page on GitHub by clicking the “Download Zip” button bottom right. Unzip the file and inside you will see 3 folders:

  • libraries contains extra software code the clock needs to work
  • matrix_test this is the demo program ICStation provide to test the matrix kit is working as explained earlier.
  • mini_clockx_x (where x is the version number) this contains the main clock code.

Next job is to install the libraries. When you installed the Arduino software it should have created a folder somewhere for your sketches (projects) to go in. Inside that folder should be another folder called libraries. Open the libraries folder in the clock download and copy the 4 folders there into the libraries folder in your Arduino projects directory. The 4 libraries are called ‘Button’, ‘FontLEDClock’, ‘LedControl’ and ‘RTClib’.

Now quit and restart the Arduino IDE to make it pick up the new libraries. After restarting, go to the Sketch — Import Library menu. If the libraries are in the right place you should see the 4 names listed in this menu.

Look for the 4 library names to appear in this menu.

Look for the 4 library names above to appear in this menu. (My menu has some extra libraries listed too that aren’t needed for this project)

If not, go back and check you have them in the right folder.

Now go to the File menu and open the main clock sketch it’s in the mini_clock folder and is the file ending in .ino. You should see the code appear in the main window. Pick your Arduino board type in the Tools — Board menu and hit the Verify (check mark) icon. This tests the code and should compete without errors. If you do get errors here, you’ve most likely not got the 4 libraries in the right place or you’re not using the correct version of the Arduino IDE software make sure you are using 1.6.5 and not a newer version.

OK, time to upload the code to your Arduino. Plug the Arduino into your computer with the USB cable. Click upload and wait for the code to be uploaded. Watch the TX and RX LED’s on the Arduino flash for signs of data transfer. If you’ve got everything plugged in right the clock should spring to life. Now you can unplug it from your computer and use the USB power adapter. Use the buttons to set the time and then sit back and admire your handiwork.

And if you really, really like the project, here’s my bitcoin address! 1JPdDk4DiKYDsjTYghHatJp1FFQsv6bpEv

IMG_1222 IMG_1225IMG_1221

Troubleshooting

I get an error compiling:

  • Check the libraries are installed in the correct folder and appear in the menu
  • Make sure you have restarted the Arduino IDE after adding the libraries.
  • Make sure you are using Arduino software version 1.6.5.

I get an error uploading to the Arduino:

  • Check your board type and serial settings are correct in the Tools menu.
  • Check your Arduino has 32K RAM or more.

The clock doesn’t change:

  • Normally a wiring issue. Check the LED on Pin 13 of the Arduino flashes. If not then the clock chip is not being read. Check your connections to the DS1307.
  • You must have a working battery on your DS1307 module for the clock to run.

The displays don’t light up / light up erratically.

  • Check your wiring to the first matrix.
  • Check all the jumper pins are pushed in on the other matrices.
  • Try another power supply.
  • Check each matrix with the Demo program as described earlier to make sure they are soldered correctly.

The text on the displays is rotated.

  • This is most likely because you don’t have the exact matrix modules from IC Station. Other modules from eBay can be wired up differently, so the LED’s are in a different order. You can usually fix things by tinkering with the function “plot” in the code. Look for the comment “plot a point on the display” and the line starting “void plot”. Switch the x and y in the 2 lines that start ” lc.setLed(address, y, x, true ); and lc.setLed(address, y, x, false);”. This will plot the pixels 90 degrees around.

The text on the displays is garbled or out of order.

  • This is most likely because you don’t have the exact matrix modules from IC Station. Other modules from eBay can be wired up differently, so the LED’s are in a different order. You can usually fix things by tinkering with the function “plot” in the code. Look for the comment “plot a point on the display” and the line starting “void plot”. If the text is our of order you can try changing the address=0 to address=3 lines around. These control which display is 0,1,2, and 3. If you swap the numbers around so they go from 3 to 0 this will invert everything. It’s worked for a few people!

Share this:

Like this:

399 thoughts on “ Mini LED Clock ”

Hey, I used your code to make this clock, but I’ve had no end of grief using the DS1307 adafruit library that you’re using here. It just doesn’t work properly with most of the Chinese TinyRTC modules. I’ve re-written your code to use the new default DS1307 and TIME libraries and all of the weirdness I’ve experienced with the RTC is gone. Also I’ve noticed that the matrix seems to draw faster as well (that might be subjective though). I’m working to expand the clock to use the Dallas temp sensor you can solder in to the Tiny RTC module and expand the matrix to 24×16 to display the extra information. Everything was going swimmingly except now when I try to read the temperature from the Dallas device the LED matrix freezes so I’ve got some work left. If you’re interested I can post the updated code to use the default Arduino DS1307 and Time libraries. I’ve found them to work 100% with the TinyRTC modules vs the adafruit DS1307 library.

Hey, what issues have you been seeing with the RTC modules? I’ve seen my clock lose accuracy.

Love to have the code with the new libraries if it’s functional I can post on my page as an alternative.

When you say these are the new default libraries where are they from?

Just started playing with this today.

Has a twelve hour function that is very easy to use.

I think I mentioned it to you recently.

i made it, so beautiful

Hello,
thanks for the code for this great and nice clock!
I changed the RTC 1307 with RTC3231 and it works more precise.
Now, I’d like to add a DTH22 Sensor to show the temp and humidity … Someone have already done this mod ?

Thanks and Cheers

Hey Enzo, I’m not sure if anyone has. You’d need to create a new function to get and display the temp just copy one of the more simple functions like the one that prints the version to see how it works writing characters to the display, then have it call it when you press a button (like the date) / or every X seconds / mins.

Hello jjazzyj!
Managed to finish all your code?
I am interested, for goodness and kindness!
Thank you

Hi
“Greeting of the day”

When I am verifying the code, getting this msg. ………..

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino: In function ‘void switch_mode()’:

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1255:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1255:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1255:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1255:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1255:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino: In function ‘void setup_menu()’:

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1339:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1339:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1339:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1339:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1339:3: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

D:\MK\ELE\miniclock-master\miniclock-master\mini_clock1_0\mini_clock1_0.ino:1341:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Sketch uses 14,100 bytes (43%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,203 bytes (58%) of dynamic memory, leaving 845 bytes for local variables. Maximum is 2,048 bytes.

Are you using the version of the arduino software specified in the blog?

Fantastic man! for me work fine with ds3231 module and arduino nano! it’s really precise with ds3231 ! thanks thanks thanks. You are great.

My friend how to use DS3231 in this clock can you please help me.

some time has gone since your comment.
I’ve build the pong-clock and simply replaced the DS1307 by the DS3231 (as I only have the DS3231 at home). Same pins used, same I2C-address, … No need to change the code (OK,I’ve removed the debug-output to serial as I don’t need it). So I believe it should be the same to replace DS1307 by DS3231 in this project, too (will try later still waiting for the LED-matrix to arrive from china…).

I tried everything to run the clock. I changed two clock modules. But the clock is not running. Matrix check, version 1.o Hello are displaying. I can toggle the switch 1. But I cannot toggle the switch 2. led on pin 13 does not flash. What is that I am doing wrong ,
Please someone help to run the clock
Sudha
s_dandala@yahoo.com

Hard to say without looking but sounds like the clock chip not running somehow.

Download one of the many simple DS1307 demo sketches i think some come with the library I use if you google it. And just see if that works. There is one that prints out the time to the serial display I used. Then you’ll see of the clock chip is ok.

It Looks like as someone mentioned the cheap DS3017 module does not work with the code in your project. I am going to try DS3132 module with Arduino Time code.

Nick in your project you mentioned connect to DATAIN to end module. Do you mean Left end module ?

After connecting the 4 modules you should only have one module left with DataIN. That is the one you need to connect to. The other end will be DataOUT.

Nice project Nick. Thanks for sharing. I’m not able to set the time with Button 1 and Button 2. Clock is up and running well. Not able to understand “After connecting the 4 modules you should only have one module left with DataIN. That is the one you need to connect to. The other end will be DataOUT.” and not using the IC station MAX module. Please help

Thanks in advance.

Thanks! Check you have the right pins on the arduino for the buttons. They should just work if you have the wiring right.

As for the modules, they should have an “in” and an “out” pin on each one. So when you have connected all 4, you will have one module with an “in”, say on the right, then one on the far left with an “out” connector. The arduino is sending data to the modules, so you need to connect the line out the arduino to the “in” on the matrix. You can leave the “out” disconnected.

Be aware if you don’t use the IC station modules, some are connected differently which means you might get the text rotated or flipped in some way

Can send me default DS1307 and TIME libraries .

Thank You
Sudha

RTC is not running eventhough I changed 3 DS3017 modules. I checked the circuit several times.
Initial displays comes as mentioned. But the clock is not running. On the serial monitor it sya RTC is not running. What else I need to do to run the clock. I checked with RTC test sketches it also saya RTC is not running.

use arduino Leonardo sda and scl pin to ds1307 sda and scl pin. doesnt work with uno.

Now I got the clock ticking. How do set the correct time, day, year etc.,

There is an option in the menu

Thank You. It did work.

Good morning,
Have been having a lot of fun the mini clock built, except that the display rotated 90 degrees.
Now runs the clock of vertically instead of horizontally.
How do I change it.
Many thanks
Martin Saarberg.
From the Netherlands.

Hi Martin, I’ve no idea how you’ve done that! Could you post a picture?

Got the display used picture 1

This side by side picture 2

The result is picture 3

Would have liked picture 4

Hi Nick,
Have you seen the photos ?
The question is how can I the numbers on the display 90 degrees turn.
Would love to hear from you.
Thanks.
Regards
Martin.

Hey Martin, the photos don’t show up on my phone. I’ll need to check on my laptop tomorrow. Nick

Try this void plot (byte x, byte y, byte val) <

//select which matrix depending on the x coord
byte address;
if (x = 0 x = 8 x = 16 x = 24 x = 31) <
address = 3;
x = x 24;
y = 7 y;
>

if (val == 1) <
lc.setLed(address, x, y, true);
> else <
lc.setLed(address, x, y, false);
>
>

Hello Friend! First, thanks for the reply; My Matrix looks like the picture (attached); Is an FC-16 Module. Thank you

________________________________ De: Nick&#8217;s LED Projects Enviado: quarta-feira, 8 de julho de 2015 07:02 Para: meuviolino@hotmail.com Assunto: [New comment] Mini LED Clock

Thanks in advents
Martin

Hey Martin i don&#8217;t see the pictures on my website either. Can you try and post them again?

Nicely done! It works perfectly for me &#8212; almost. My modules, however, run 0-3, right to left, the opposite direction of the ones in your video. Hardware connections are solid, and of course I&#8217;m using the data-in side. But I get seconds on the leftmost matrix in the chain (#3), hours in the first, rightmost (#0), tens minutes in #1 and minutes in #2. It&#8217;s a working clock all right, but a little disconcerting, and consistent in the startup screen and all modes. My coding skills haven&#8217;t let me find a workaround yet. Any suggestions would be appreciated. I can send a photo if that would help.

Found it in the morning after a cup of coffee. Pretty simple, thanks to your excellent documentation. Looking forward to the Pong clock build next. Thanks.

Hi Nick,
I&#8217;ve just finished building your little mini clock project and It worked first time. The display looks great and it has some nice options in the menu. I noticed that you had problems with creating a scroll option, did you ever have another look at it. Is it also possible to have a time option for the random mode or changing the code to alter the time it takes.
I&#8217;m now designing a case for it using Corel and 3mm acrylic. Keep up the good work its much appreciated.
Kevin.

Great that it worked first time! I did have a scroll option on another project but I never ported it over. I don&#8217;t really have much time at the moment to go back and look at it. The random one should be easy to change, just play around with the coiners in the loops and delay statements to change it. Love to see the case when it&#8217;s done.

I went step by step and I&#8217;m finnaly finished with the clock. I got an issue. The third display is doing some weird things. Depends on what is on the screen, sometimes the frist, second, third and the forth row doesnt lit up. Every led works as I tested them. Can this problem occur if there are wires touching? meanwhile, in order to make your projet work I had to offset the displays by adding wires between the connectors and flip the display for 90 degresee for the text to display in the right order. I can send you pictures of my setup and i can even film my screen so you can see the problem. If you can give me your gmail adress I can send it.

Yeah sounds like a bad joint somewhere. Maybe try and re-flow the solder on the LED matrix board and check nothing is shorting out.

That&#8217;s strange you had to offset the displays, did you buy the same ones as in the example I posted or a different make? I know some other makes have the matrices wired different so they show at 90 degrees. You could also try and change it in the code to flip X and Y per matrix.

Already tried to do the flip in the code itself but it didnt worked at all. Doing that half the leds didnt worked for some reason. Maybe it&#8217;s because I&#8217;m not that good at coding.

I bought 4 of these. And because I&#8217;m not carefull enought I shorted some wires and now the third display is dead and I already bought a new one 😛

Maybe the solder melted the plastic around the connetor and shorted 2 wires and that&#8217;s why the display acted so weird. It&#8217;s funny how, when I turn the arduino on. Every LED turns on. When I&#8217;m in basic mode the forth column of the third display works ( Yes I did a typo before, I meant the 2nd, 3rd and the 4th column didnt worked well). Anyway, when I go to small mode the 4th column stops working and when I go to words mode, the 2nd,3rd and the 4th column stops working. AND this issue is only present on the third display, every other display works perfectly.
Now I need to wait 4 days for my new display to arrive and then I will be extra carefull to not short anything.

If the issue is not resolved with a new undamaged display than there is probably something wrong with the second display? I mean can a faulty MAX chip transmit wrong data to the next display?

hello nick, i have build your mini clock and it is great to see it works
there is one problem when i see the dat ( example 23rd ) the numer 3 is not right
the date numbers 1 to 9 are correct but when the numbers 10 to 31 some pixels are missing can you help me see what that problem is? regards from the netherlands

Hey, that&#8217;s very strange. Do those leds work at all? Is it just when the date is shown?

I doubt it&#8217;s something wring with the second display but you could swap the order around and see if the problem moves along with it. The fact the 4th display is OK seems like the data is getting transmitted OK. Let&#8217;s try a new display first and see.

As for the rotation, it&#8217;s most likely those displays you have are wired the other way around. You should be able to swap it in code. In the function called void plot, what happens if you swap x and y in the 2 lines that say:

lc.setLed(address, y, x, true);

lc.setLed(address, y, x, false);

lc.setLed(address, x, y true);

lc.setLed(address, x, y, false);

Hi,
i tried this, but the text is rotated and appears mirrored. do you have an idea to fix this?
thanks.

Hey, try swapping the x and y in the plot function there are (I think) instructions in the thread for someone else. Let me know! Nick

Today I recieved the replacement display and it works now. Somehow I managed to damage the MAX clip and then the matrix display. OH well 😛
So&#8230; because I&#8217;m done with the your project I made some changes to the code itself. I translated every word to &#8220;Slovenian&#8221; language and it works and I fixed the text offset when displaying date eg. &#8220;29th&#8221;. I had to change the offset value from 8 to 9 in order for the display to display the number correct. When the value was set to 8 the last column in the number 9 was offscreen ( It didn&#8217;t transfered to the third display).

offset = 9; //offset to centre text if 4 chars

My next goal is to change all text display to be scrollable in order to display all characters. eg. (Sept September &#8220;scrolling from right to left&#8221;).

PS: I tried to flip the x and y in the code and it didn&#8217;t worked well. Half of the characters were missing or missplaced. Maybe I did something wrong or the matrix displays are wired in another way.

Thanks for the help anyway 😛 I hope you will post some more awesome DIY projects.

Hey, great you figured it out and cool there is now a Slovenian version out there! I&#8217;ve not noticed the offset problem I&#8217;ll have a closer look thanks for pointing it out, and thanks for building one!

I forgot to post the picture of my mini clock and how I did the 90* flip.

I think that looks pretty cool with those extra wires! Nice how you have built it so it stands up on a board too.

i want to upload photo, when i made it from pcb dual layer and dot matrix 8&#215;8 2,3 inch. but i can,t do in this site

now going to design a 2.3-inch dot matrix 5&#215;7 6 pcs in dual layer pcb

with arduino pro mini 5v, ds1307 i2c bus

These displays modules are sold on aliexpress and also on ebay?
It is difficult to buy in Brazil
thanks

hi
i have question. how can i turn right position this numbers.normaly as show 21:45:34 but all numbers 90 degree left position . i cant turn led matrix how can i with code. help me please. can you give me you mail address plase.

Hi, I have the same problem, I connected four modules together and they are displayed like the person above me said. I need them rotated 90 degrees to have the correct orientation for my modules to fit in an enclosure. Thanks for the code by the way, it works well either way aside from the issue I&#8217;m having.

Hi, guess you didn&#8217;t buy the ic station displays ? Yours are wired up
differently. If you are ok with
Coding you can try swapping the x and y in the draw function. Alternatively the other guy here retired the displays so they were a rotated round.

Hi,
I used kits like the ones you use but with the MAX chip in a DIP package (the ones you put in a socket). That means the chip is located on one side of the module, making it longer. I saw you use a package with a surface mounted chip, so you can orient it any way you like. Next time I&#8217;ll get those modules, for now I&#8217;ll try swapping x and y. Thanks for the response. 🙂

how to change 5&#215;7 font to 6&#215;8 font ?
because i modified fontledclock.h to 6&#215;8 font, not working. still 7 rows in display.
any idea for this is ?

Not easy I&#8217;m afraid, lots of things in the main code would need to be changed. You&#8217;d have to work through each function.

ok, thanks for your attention.
unfortunately, there are only 7 8 row flaming row. it would be good if the 8 row lit up into a bold character

there is a bounce effect, if the power supply connect outlet adjacent to the switch.
you can try it

Great work I liked very much. I will make one for me.thanks for the all idea. but I have a little doubt can I use DS3231 clock module. If can use how to do. Please reply &#128522;

Awesome work! I have 8 of the led matrices so 64&#215;8 leds, how can I display both the time and date at the same time? I&#8217;m not very experienced at programming, could you point me in the right direction?

Great you like the project, unfortunately showing both time and date is quite a major rework of the code if you are a beginner. You&#8217;d first need to adapt the driver functions to map pixels to a bigger display, then adjust all the routines to draw in the larger space. Not impossible but not trivial either!

Hey Nick, built the Pong clock sucessfully but cannot find the code for this one pops up a dropbox error&#8230; Any ideas?
Chris

All found and now working 🙂 Thanks

Hooray, I managed to make the font 6&#215;8.
look it this : https://youtu.be/Mp_xlsuyIMc

Hey that&#8217;s awesome! Can you put in a mode where you can switch between the 2 fonts?!

plot (15 offset, 2, 1); //top point
plot (16 offset, 2, 0); //top point
plot (15 offset, 5, 1); //bottom point
plot (16 offset, 5, 0); //top point
count = 500;
if (count == 0) <
plot (15 offset, 2, 0); //top point
plot (16 offset, 2, 1); //top point
plot (15 offset, 5, 0); //bottom point
plot (16 offset, 5, 1); //top point
>

yellow dot matrix each 2,3 inch (6cm x 6cm)

but not work in slide mode

bisa dishare code nya gan ? taruh di gist.github.com atau di pastebin.com .

hi nick, thanks for your nice clock !!

it&#8217;s work perfectly, but strange with display. it should rotate 90 degree, but not problem. i added
y = 7 y; at plot function, it&#8217;s works .

void plot (byte x, byte y, byte val) <

//select which matrix depending on the x coord
byte address;

// byte address;
if (x = 0 x = 8 x = 16 x = 24 x = 31) <
address = 3;
x = x — 24;
y = 7 — y;
>

if (val == 1) <
lc.setLed(address, x, y, true);
> else <
lc.setLed(address, x, y, false);
>
>

Hi, can you put here one more time the code change for 90 degree rotation? I&#8217;m looking for that solution and the image link that you posted is broken. I would be grateful for your response 🙂

hi nick, thanks for your nice clock !!

it&#8217;s work perfectly, but strange with display. it should rotate 90 degree, but not problem. i added
y = 7 y; at plot function, it&#8217;s works .

void plot (byte x, byte y, byte val) <

//select which matrix depending on the x coord
byte address;

// byte address;
if (x = 0 x = 8 x = 16 x = 24 x = 31) <
address = 3;
x = x — 24;
y = 7 — y;
>

if (val == 1) <
lc.setLed(address, x, y, true);
> else <
lc.setLed(address, x, y, false);
>
>

thank’s for this code, it’s work perfectly !
but i have a probleme, i use a DS3221.
can you give me the code for use it and i don’t know i can set the right time and date.
thank’s for all

post from france

it&#8217;s me again,
i found how to set the correct date and time, electrical probleme with the button !
sorry !
so i use the DS3221 and your original code for the DS1307 and it seems works,
but Time move in the time, minute by minute&#8230;what&#8217;s the problem ?

for the rotation probleme i could see in the differents comments, this code works:

//select which matrix depending on the x coord
byte address;
if (x = 0 x = 8 x = 16 x = 24 x = 31) <
address = 3;
x = x 24;
y=7-y;
>

if (val == 1) <
lc.setLed(address, x, y, true);
> else <
lc.setLed(address, x, y, false);
>
>

Hey Laurent. Not sure what you mean here, can you explain more?

hi,
I would like to bulid this clock, but I always get an error message.Please help me. these are the messages:

C:\mini clock\mini_clock1_0\mini_clock1_0.ino: In function &#8216;void switch_mode()&#8217;:

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1224:3: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1224:3: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1224:3: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1224:3: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1224:3: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino: In function &#8216;void setup_menu()&#8217;:

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1307:45: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1307:45: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1307:45: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1307:45: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1307:45: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

C:\mini clock\mini_clock1_0\mini_clock1_0.ino:1309:18: warning: deprecated conversion from string constant to &#8216;char*&#8217; [-Wwrite-strings]

Sketch uses 15,826 bytes (49%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,248 bytes (60%) of dynamic memory, leaving 800 bytes for local variables. Maximum is 2,048 bytes.

I dont have too much experience . Anyone know what should I do.

Hi, Are you using the Arduino software IDE version 1.6.5 like the instructions say?

hi,
I downloaded the latest 1.6.7 software from https://www.arduino.cc/en/Main/Software page. Is it a problem?

i tried with 1.6.5 and its working fine THANK YOU. Its really nice I love it thank u

Hello,
Could somebody please upload a code where the 90degree rotation is included. I cannot seem to get control of that problem. The cirrent code shows too much space between the modules. My modules have true hole parts and no SMD so the problem is the IC that prevents me from placing the LED modules close together. A fix would be fantastic!
Thanks!

thx that saved me from roteting the display fysicly

Hi All,
I got it working with the github link and 1.6.6
Pongclock is next&#8230;. The panels are here.

Very nice , but I did bug .dotm matrix where numbers and letters left oblique . Help please.

Il faut modifier le code suivant:

//select which matrix depending on the x coord
byte address;
if (x = 0 x = 8 x = 16 x = 24 x = 0 x = 8 x = 16 x = 24 x = 31) <
address = 0;
x = x 24;
>

Comme ça ils sont dans le bon sens!

Et aussi pour que la date soit bien affichée et non coupée.
offset = 8; //offset to centre text if 4 chars
vers:
offset = 10; //offset to centre text if 4 chars

A cet endroit:
//select which matrix depending on the x coord
byte address;
if (x = 0 x = 7) <
address = 3;

changer les lignes
address = 0
address = 1
address = 2
address = 3
vers:
address = 3
address = 2
address = 1
address = 0

Very good and thank you very much!
I read and modify on proteus. This project is very good!

This project is very good. Thank you very much!
And &#8220;void scroll&#8221; is not working. Anyone modify and finish it?

It&#8217;s been quite a while since I built this mini LED clock and I have noticed something. After few days or up to 2 weeks after I uploaded the sketch to the arduino I noticed that the clock / timer is running ever so slightly faster than a normal clock would, so the mini LED clock gets unsynchronized and that bothers me enough that I need to fix it somehow.

Do you maybe got any clue what&#8217;s the cause of this problem? I&#8217;m assuming it&#8217;s the DS1307 that is causing the problem.

Hi, I&#8217;ve had a Ds1307 do similar, the click gained 5 minutes a day. I changed the IC and the crystal and it solved the issue. Maybe start just with a new crystal.

Did you bought the replacement parts from ebay or from a better shop who sell better quality timers?

Yes I went to a better quality shop the first parts I got were cheap eBay ones

I just checked some posts on arduino forums and it seems that people prefer the DS3231 chip. Can I just replace it without messing a lot around the sketch code?

I think so, there were some other posts about doing that have a search of the comments on this and pong clock.

I searched all around the web but I can&#8217;t seem to find how to readjust the sketch code to work with the DS3231 module. I saw a few comments on this site but all of them are about people asking the same question as me.
This is what I did:
I replaced the DS1307 module with DS3231 module by connecting it the same way with the battery. So that is that
The time is frozen on the clock when I power it up.
The seconds are not shown
The DS3231 module seems to be connected right because of the red LED being lit.
reuploading the sketch again doesn&#8217;t fix the issue.

I don&#8217;t know where to begin solving this issue. It&#8217;s probably a small change that needs to be done but by looking at the size of the sketch I really don&#8217;t know where exactly to search.

P.S. The module started to work just by it self for some odd reason.
After it started working I recompiled and uploaded the sketch again. It works but the &#8220;ds1307.adjust(DateTime(__DATE__, __TIME__)); // sets the RTC to the date time this sketch was compiled&#8221; part of the sketch doesn&#8217;t work with this module. So I had to manually set the date and the time. Now I need to test how it works. Will reply in a few days to see how well the clock is synced with the real time clock.

Oui, le DS3231 fonctionne bien avec ce code, il n&#8217;y a rien à changer par rapport au DS1307.
Pour moi environ 1 seconde de décalage par jour.

Scrolling message has low speed.Is there any way to increase the speed with analog input.
waiting for the reply.

Hello,
Came across your site and was interested in your led mini clock, had some matrices laying around and build your clock, had to redo the fonts and digits since they showed up on the display mirrored and tilted 90 degrees, but enjoyed it and got it to work.
Here is my video.

Hello,
i have a problem&#8230;sometimes, one matrix freeze, or all the leds are illuminated.
when i shutdown the system, or unplug it, the clock leds works perfectly .
can you give me the code to reboot the system automaticaly at the same time all days. at midnight for example.
thank&#8217;s

post from france

hi bro , thank you so much by sharing your proyect , so awesome &#8230;the only think what needs is to watch temp and one kind of alarm, would be awesome..congratulations! 😀

Glad you like it! There are a few people who&#8217;ve modded the code for alarm / temp etc search thru the comments!

hi, Niks, slide effect and random clock setting is not running in my clock.
thanks for your coding..its a wonderful clock. please suggest me what should i need do for getting this 2 modes. and also i want for scrolling watch

Great project, I built mine just over 9 or so months ago and still working flawlessly, however I&#8217;d like to make a modification by adding 2 more LED matrix squares to the existing 4 to display the hours minutes and seconds (Small mode) in that rounded characters found in basic mode, only I&#8217;m not that great at coding and simply would not know where to begin, Thanks for sharing this great project.

Hey David, glad it&#8217;s still going. Adding 2 more matrix units will be quite involved, you&#8217;d need to alter quite a lot of the code. Not something that would be a quick explanation unfortunately.

hi nick. im trying to do one as well but i only have two matrices. do i have to change a lot in the code when i subtract the number of matrices?

Hi, yes you&#8217;d need to change a lot not an easy task unfortunately

Hi,
i´m using the DS3132-RTC-Chip and the 4 8&#215;8 Matrix-Displays. I downloaded the latest Version of IDE 1.6.8. I´m using your script, but i have a Problem to set the Time manualy.
There is a Problem in the Date-Display. If i set the Date to &#8220;&#8230;adjust(DateTime(2014, 1, 21, 3, 0, 0));&#8221; , the Display Shows &#8220;Sunday&#8221; &#8220;2 ST&#8221; &#8220;JANUARY&#8221;. The Line &#8220;ds1307.adjust(DateTime(__DATE__, __TIME__));&#8221; is not working. is this a known Problem?
What can i do?

Hi Nick, i will show you (my and your) project — a led miniclock with a bmp180 temp/pressure sensor&#8230;.

Great Project, thanks again&#8230;. 😉

Hey that&#8217;s fantastic great you created a custom board for it too.

can you share of the code ?

The link is in the blog under the section &#8220;Uploading the clock code&#8221;

Hi. Thanks. Nice project. Help me please. How to remove left null? 00:10 — 0:10

Hi friend! I am getting the following: error: variable &#8216;mytinyfont&#8217; must be const in order to be put into read-only section by means of &#8216;__attribute __ ((progmem))&#8217;
unsigned int PROGMEM mytinyfont [42] [3] = <

An answer, I would be grateful!

I think the arduino ide has changed which means the code no longer works. Make sure you are using the version of the arduino software listed in the readme file

my buttonA not function. buttonB funtion correctly. I have try swap it, but still doesn&#8217;t working.

Sounds like faulty wiring / button or some such.

already check my button condition, swap button and pin but still doesn&#8217;t working.

Hmm, very hard to say unfortunately without seeing the board. You could set the button to another pin at the to of the script and try that pin instead

Thanks Nick. Will check the wiring and update. I dont have rotation issue as I have uploaded the updated code.

Apologies for the delay Nick. Still facing problem with Button 1 and 2.(Doesn&#8217;t work).

Find below for your reference.

Similar issue was faced by Sudha as well and later it was fixed. How did you fix it Sudha?

Thanks in advance.

Hi Nick,
Now the clock is up and running and able to setup through button A and B. Thanks many for the wonderful project.

Glad to hear it!

I wanted to let you guys know that I was facing this issue where the clock was ticking randomly for the past two days. After checking step by step I understood that the USB power was the culprit due to which RTC was not running,

Connected power supply to Matrix display through separate adapter and connected USB supply to arduino and RTC after which clock started running properly.

Hope this will help.

Thanks Nick again for the excellent project.

Great project dude.. loving this project.. i faced same 90 degree rotation issue. might be this will help to me..

can i have more project like this? or any idea for encloser/housing for this 8X8 4 mertix clock?

Thanks i will try sure. want to more project like this.

thanks man really.

hello I saw this and thought this is just what ive been looking for so I built it and its great aslong as I use a mirror and hold it upside down. any ideas the display is upside down and mirrored
and yes I&#8217;m using different LEDS

Hey, you just need to play around with the plot() function.

The program assumes a display where the top left corner LED is pixel 0,0. The bottom right is 31,7. The plot function takes pixel points in this coordinate range and translates them into which individual matrix to use and where to put them on that matrix.

If your display is upside down it means when it&#8217;s plotting y=0 your LED&#8217;s are wired so it&#8217;s actually putting it at y=7. To account for this you can use some simple maths to swap the numbers over (so a 7 becomes a 0 and a 0 becomes a 7). To do so try changing the 2 lines that plot y:

lc.setLed(address, y, x, true);
lc.setLed(address, y, x, false);

lc.setLed(address, 7-y, x, true);
lc.setLed(address, 7-y, x, false);

I.e. so when it&#8217;s fed a 7 it becomes 7-7 = 0. When it&#8217;s fed a 0 it becomes 7-0=7. When it&#8217;s 5 it&#8217;s 7-5=2 and so on.

Let me know if that helps then we can tackle the mirror bit!

That is the solution. Thanks

Hi I have implemented same clock and seems good. I have made DS1307 circuit myself and implemented with ardunio mini pro.
Clock circuit is below which i have implemented exact same (expect 0.1. But this running very fast by 10-12 min per day. Can anyone please help me for fix this issue?
thanks in advance.

Video of this clock

Looks great! I like the case!

I had this same issue and it was the crystal. It was cheap from eBay. I got one from another supplier and it fixed it.

Dear Nick
Thanks for your reply.
Let me try after replace crystal.. let you know the result.

Now i have installed this clock on my living room 🙂 thanks for your support.

i am in trouble since yesterday. yesterday i have observed my clock is running 10 min faster. i have perform sketch burning process for sync time again from PC. But this time date/time not syncing with PC time and CLOCK RUNNING THREE TIME FASTER like raise. i have performed all troubleshooting step what i can do. rechecked, wiring circuit, replace crystal DS1307 chip, battery, fixed crystal body with ground etc. even try different version of code also. On serial monitor i have found wrong date/time is printing and two different value of date/time showing like:

0:8:23 Date 31 (Wrong time and day)
165:166:342 Date 232 (Not able to understand what is this)

there is two problem i am facing.

1) Clock running three time faster. This case clock is not usable for me
2) Date/Time not syncing with PC time after burning sketch

You can check my video which are showing clock running very fast

Please help&#8230; Thank you so much in advance

Hey, sorry to hear you are having so many problems. I doubt it&#8217;s anything to do with the code as it&#8217;s working for other people but what you could do is search online for a basic sketch that reads the time from the ds1307. There should be some very simple examples you can upload just to check the time is OK. Maybe run it for a day printing to the serial console and then you can see if the basic hardware is OK.

i have performed below action:

1) Changed crystal
2) Make ground to crystal and given more space on PCB for paste horizontally
3) Added some glue to crystal for paste in PCB
4) Added more wire for shorten path to battery ground
5) I was doing mistake while time sync that keeping power off to DS1307 circuit while sketch uploading to Ardunio mini by FTDI uploaded. After power on DS1307 circuit while sketch uploading now time sync properly with PC.
6) Added 22pf bypass caps to crystal legs.

Now clock working but still it&#8217;s 2 min delay on 10 hrs.

Seems good progress.. Still finding the way for fixed this issue as well.. 🙂

Definitely sounds like good progress so far! A few people have tried other clock chips if you search DS in the thread for this and the pong clock you should find their posts.

Thanks.. Let me check

Hi Nick,
thanks for your nice Clock, i replaced the DS 1307 with the DS3213 without any problems
and also i made a PCB.

Nick Hello good day. I thank you for presenting your project. I made the clock and mel result was very good, but I want to ask why the set in 12 Hr mode and adjust the brightness to minimum and if disconnected from the source, the restart takes intermediate brightness and time 24 Hr ?, it is what I set unconfigures 🙁
Also after setting the date, day always appears independent of the current day d ela week Sunday.
Thank you very much for the help.
Sincerely,
Regards.


Источник: 123led.wordpress.com