Go Down

Topic: Arduino WordClock (Read 18 times) previous topic - next topic

liudr

Sorry, it was for Stijn. I can see small light spots in the middle of each text so a diffuse LED may help illuminate larger portion of the text stencil and make reading it easier.

Riva

Quote
Hello again Riva,

I'm having a little trouble understanding some parts of the schematic, I added some notes for the questions that I have.  http://cncorpmisc.weebly.com/  It's probably obvious and I don't realize it. the one caption is supposed to read "how does this connect"
Klawd


Attached is an image that should make the connections clear.


boguz

Great project with really nice outcome!  Congrats!!
=)

saturno

Hello Riva and everyone,

After almost a year, I finally got some "extra" time to start to build my word clock.
I was revieweing the code to fit my purposes and when I started to search for the MAX 7219 library that is included in your sketch <MAX7219.h>, I found that there are more than one libraries to work with this IC.
There are libraries that support cascading when others don't...
There are libraries with names like LedControl that are also supposed to work with this IC

Can you (or anyone that knows) please give me the link to the MAX7219 library that I should use in this project?

Thank you for any help.

Riva


Can you (or anyone that knows) please give me the link to the MAX7219 library that I should use in this project?

The libraries I used for this project are in a file called 'WordClock Libraries.zip' attached to post #4
Good luck with the build, both my clocks are still working nicely. The one with the DS3231 is a lot more accurate than the DS1307 version but with code tweaking I have managed to get it within 2 minutes per year time drift.

saturno

Hi Riva!

I did missed that link. Thanks for pointing me out.
Actually, the RTC I have available right now for this project is the DS1307 which from your experience is not the best one for this kind of project. I'll change it...

Another thing that I will have to work is the Font. I need to add some "special" characters like ç, é, í, etc...
From my understanding, I need to add their "design" to the Fonts you already included, in the first place. After this, is there anything else that I need to change to be able to use them in a scrolling message?

Still regarding the Fonts, can you explain to me what's the meaning of the last digit/couple of digits defined after each character?
e.g.:
Code: [Select]

    B11001100, B00000000, //"
    B11001100, B00000000,
    B11001100, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    8,

    B00110011, B00000000, //#
    B00110011, B00000000,
    B11111111, B11000000,
    B00110011, B00000000,
    B11111111, B11000000,
    B00110011, B00000000,
    B00110011, B00000000,
    12,


I am referring, in this example to the 8 and 12 in the last line of each character. Other characters have different codes.

Once more, thank you for all your help.
When I get something that worth to show, I'll post some pictures.

Riva


Actually, the RTC I have available right now for this project is the DS1307 which from your experience is not the best one for this kind of project. I'll change it...
You can get reasonably accurate with a DS1307 given a little time. For me the DS1307 was loosing about 8.5 seconds per day (It take several days to get a good average) so I just put in a bit of code to add 8.5 seconds at midnight each day.

Another thing that I will have to work is the Font. I need to add some "special" characters like ç, é, í, etc...
From my understanding, I need to add their "design" to the Fonts you already included, in the first place. After this, is there anything else that I need to change to be able to use them in a scrolling message?
If you want to add the characters into the correct position to match the extended ASCII table then you will need to define all the characters prior to the last one you need or at least put spaces in the chars you don't define else the loadBufferLong code won't work properly (It will also need altering to accept a larger font tabe as it's current upper limit is 0x7F). You could also define the extra characters to replace un-used characters in the current font (things like {}[]|<>).

Still regarding the Fonts, can you explain to me what's the meaning of the last digit/couple of digits defined after each character?
The last number is used for kerning the font character. It is normally the bit number of the right most bit  (start counting from the left of the two bytes) + 2 and defines how wide the character is. I have highlighted the right most bits in both examples and you will see the number is the bit position of the widest point (starting with left byte/bit) plus 2 bits.
e.g.:
Quote

    B11001100, B00000000,   //" Bit position 6 (counting from left) highlighted in red
    B11001100, B00000000,
    B11001100, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    B00000000, B00000000,
    8,     // 6+2

    B00110011, B00000000,   //#
    B00110011, B00000000,
    B11111111, B11000000,   // Bit position 10 (counting from left) highlighted in red
    B00110011, B00000000,
    B11111111, B11000000,
    B00110011, B00000000,
    B00110011, B00000000,
    12,    // 10+2


I am referring, in this example to the 8 and 12 in the last line of each character. Other characters have different codes.

Once more, thank you for all your help.
When I get something that worth to show, I'll post some pictures.
Will be nice to see someone else's work

saturno

Superb explanation!

As for the space reserved for the loadBufferLong, I understand that it needs to be increased to allow loading more characters.
Since there are only few characters that I need to add, maybe I'll take your suggestion to replace some of the unused to the ones that I need to add.

Thank you.

saturno

Hello Riva,

After several hours around the build of the matrix (mine is 475 x 475 mm), I've just managed to see the result of half of the matrix (just one MAX completely connected by now).
The result is not what I was expecting. Without thinking or questioning, I used the diagram presented in the file "Clock7.pdf" to wire the first max to the arduino and as I can now see, my assumption was not correct.

Here is what I have done:
Since we usually read from left to right, I supposed that since you placed the IC1 at the right side of IC2, the schematic was drawn as seen from the back, i.e. when you see the watch from the front, the IC1 becomes the left and the IC2 on the right; and I wired my matrix exactly as in the schematic. At the moment, only the IC1 that, seen from the back of the watch, it is on the right side (right half) and when we turn around to see the "lights", it is on the left side.

Well the problem is that I missed something and now I have the initial string appearing from the left to the right (wrong) and, even worse all the characters are backwords (like mirrored). To see the characters correctly, I would need to turn around and see the watch from it's back...
(I hope my explanation make sense).

So, the question is: Can I "fix" my matrix without the need of rewiring everything?
What is the correct way to build the matrix?
(I can upload a little video to show you the problem)

Thank you for any help.

Riva


After several hours around the build of the matrix (mine is 475 x 475 mm), I've just managed to see the result of half of the matrix (just one MAX completely connected by now).
The result is not what I was expecting. Without thinking or questioning, I used the diagram presented in the file "Clock7.pdf" to wire the first max to the arduino and as I can now see, my assumption was not correct.
The schematic was the one I used to build both clocks so should work. It is based on this article. What you may have done (I did it first time) is forget that when your wiring the back of the board the SegX are reversed.
Here is what I have done:
Since we usually read from left to right, I supposed that since you placed the IC1 at the right side of IC2, the schematic was drawn as seen from the back, i.e. when you see the watch from the front, the IC1 becomes the left and the IC2 on the right; and I wired my matrix exactly as in the schematic. At the moment, only the IC1 that, seen from the back of the watch, it is on the right side (right half) and when we turn around to see the "lights", it is on the left side.
I'm not sure what the effect would be with only one chip as the matrix information is cascaded through one MAX into the next from right to left when LED's viewed from the front.

Well the problem is that I missed something and now I have the initial string appearing from the left to the right (wrong) and, even worse all the characters are backwords (like mirrored). To see the characters correctly, I would need to turn around and see the watch from it's back...
All you need to do is reverse the order of the 8/16 SegX pins and it should come good.

saturno

That must be my mistake also. I will reverse the SegX wiring.

After some rest, I did a quick test viewing from the back, and everything showed correctly.

Just a quick question: When looking to the watch (front face after ready) what is the side of each IC?
I suppose that IC2 controls the left side of the matrix and the IC1 the right side, correct?

Thank you.

Riva


Just a quick question: When looking to the watch (front face after ready) what is the side of each IC?
I suppose that IC2 controls the left side of the matrix and the IC1 the right side, correct?

Correct. Looking at the front (clock face) IC1 is on the right and IC2 on the left.

saturno

Hi Riva,

After some early matrix wiring "orientation problems", here is a quick video to show you my wordclock matrix.

https://www.youtube.com/watch?v=Cl2p8FcFMuw&feature=youtu.be

The base is MDF, CNC machined 20 mm front / 5 mm back holes and since it is 475 x 475 mm I made the electronics independent: i.e.: 1 stripboard for the arduino, 2 stripboards for the MAX7219, 1 stripboard for the rotary encoder and the LDR is directly connected with a three wire cable (I need to see where I am going to place it at the final)
Right now, everything is just wired together and suspended. When I figure how to fix everything to the clock's back, I'll post some pictures.

I had to uncomment the setBrightness function to be able to make the auto-adjustable brightness work. Is there any reason for the function to be disabled in the code? It seems that it is working correctly without any further adjustment...

Working on the translation to see some "meaningful words", I noticed that there are two ways to light up a led:

Code: [Select]

lc.setRow (0, 0, B01111000)
lc.Setled (0, 1, 2, true)


After some changes I am experiencing some slight flickering when some (already translated) words light up.
When translation, I always used the function:
Code: [Select]
lc.setRow (0, 0, B01111000) as it seemed easier to do the match between the clock face and the code.

Can you explain to me why and when should I use each of these functions?

Thank you

Riva


After some early matrix wiring "orientation problems", here is a quick video to show you my wordclock matrix.

https://www.youtube.com/watch?v=Cl2p8FcFMuw&feature=youtu.be
The face looks good. Having access to CNC machine and creating the light wells is a good idea and should make the thing less susceptible to light bleeding from one cell to the next. Hence me having to use bits of black plastic straws.

The base is MDF, CNC machined 20 mm front / 5 mm back holes and since it is 475 x 475 mm I made the electronics independent: i.e.: 1 stripboard for the arduino, 2 stripboards for the MAX7219, 1 stripboard for the rotary encoder and the LDR is directly connected with a three wire cable (I need to see where I am going to place it at the final)
Right now, everything is just wired together and suspended. When I figure how to fix everything to the clock's back, I'll post some pictures.
Will be nice to see some finished pictures. You could probably have mounted all the electronics on one piece of stripboard to reduce the complexity. I don't envy the wiring looms you must have  :)

I had to uncomment the setBrightness function to be able to make the auto-adjustable brightness work. Is there any reason for the function to be disabled in the code? It seems that it is working correctly without any further adjustment...
setBrightness is still active but I moved it to the doTime routine so it only adjusts every minute as the clock face is changing. I found you could get into a brightness hunting condition sometimes where it originally was. The brightness would adjust every second between two brightness levels and as the MAX chips only have 16 levels you really noticed it.

After some changes I am experiencing some slight flickering when some (already translated) words light up.
When translation, I always used the function:
Code: [Select]
lc.setRow (0, 0, B01111000) as it seemed easier to do the match between the clock face and the code.

Can you explain to me why and when should I use each of these functions?
I would use setRow if no other letters from potential previously illuminated words are in that row else I would use setLed to finish filling the row and then setRow or setLed for the next row if the word spread across more than one row. Your likely getting flickering because your setting a led/filling a row and then another word is using setrow on the same row at a later point and wiping the previous led settings.

saturno

#44
Sep 25, 2013, 03:28 am Last Edit: Sep 25, 2013, 03:58 am by saturno Reason: 1
Hello Everyone, Riva specially!

Finally, my wordclock is ready to be shown. It is not completely terminated, but it will probably remain like this until I can have some more time to do what I have in mind.

It consists in a 475 x 475 mm MDF panel, with an acrylic on the front (with a black vinyl sticker with the lettering), three MAX 7219 that drive the 132 5mm white leds, an LDR to change the led intensisty according to the ambient light and a rotary encoder to set it up (just like Riva's).

Before I started this project I already had done a few experiments with the MAX7219 to drive a 7 segment display. So I took the strip-board that I've made and built two additional in order to be able to drive the remaining LEDs (132 total).

Right now everything follows very nearly the original project from Riva, besides the enclosure.
What I would like to do in the future is to change the rotary encoder with two capacitive touch buttons to make it real stealthy ;-)

In order to make it work with the three MAX7219, I had to modify the MAX library provided by Riva.
Initially, the library only supported 2 MAX ICs and to make the four corner leds work, I had to make it support all possible addresses of the three MAXes.
This one made me scratch my head a couple of hours. When I introduced the third MAX, at the beginning I started to see the corner leds light up but not in the way I was programming them. Test after test I started to realize that the leds were responding as they were controlled by the IC1. This led me to the solution as I stated for my own that it only could be a library related problem. After digging a little in the library I found that it was only prepared to manage addresses for 2 MAXes. Changed that and the corner leds started to work as expected! One per minute between each five minutes interval written with words

I just didn't realize yet how I will introduce some extended ASCII characters.
I didn't yet found where should I extend the loadBufferLong to accept all of the 255 characters. I think it is from the standard AVR library...
The other suggestion of replacing some unused characters of the fefault ASCII table is easier to implement. The only problem is that I did not figured yet how can I concatenate a character specified at the position 0x7f (for example) in an Birthday message or in a string of a Month...
I did see that for example you've used the character 0x7f (the 127 position) with the º character and that you've specified it's use in the temperature string.
How can I use such a character in a month string? Let's say "Março" that means March?

Thank you.

Ho! Here are some pictures:

Go Up