Construction of Word Clock v1

Rasprava o AVR mikrokontrolerima, AVR projekti i drugo vezano za AVR...

Moderators: pedja089, stojke369, trax, InTheStillOfTheNight

Post Reply
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Nope, I meant like this:

It is 5 hours and 17 minutes.
It is 3 hours and 30 minutes.
It is 1 hour and 59 minutes.
It is 12 hours.
It is 9 hours and 1 minute.

Ok?

Something like this (I don't speak german so this is my guess):

Es ist funf uhr und siebzehn minuten.
Es ist drei uhr und dreißig minuten.
Es ist zwölf Uhr.

and so on...

or just: Funf uhr und siebzehn minuten. (wihtout "Es ist")...

P.S. For English version check this out: http://www.mediafire.com/?6lkbs64pl3s42dt
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

Es ist funf uhr und siebzehn minuten.
Es ist drei uhr und dreißig minuten.
Es ist zwölf Uhr.

and so on...
yes we speak this so.

i have viewed the english version and have recognized the problem.
it is twenty one minutes past...
or
it is fifty two minutes past...
this is in german not a good choice of words. it is possible in the code at every time of day from ...:15 o'clock to ...:59 o'clock one hour to add? Or every time of day completely enter in the "lang_ba.h"

for example

Code: Select all

// 02:30 - displays "Es ist halb 3"
const char MAX_h_2[] PROGMEM = {
	// MAX 2	// MAX 3
	0b00000000, 0b00000000,		// not on display
	0b00000000, 0b00000000,		// not on display
	0b11011100, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b01111000, 0b00011110,
	0b00000000, 0b00000000,
	// MAX 1	// MAX 4
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
};
i know that's a lot to demands but it would be a pity if it fails because.
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Pielo wrote:
Es ist funf uhr und siebzehn minuten.
Es ist drei uhr und dreißig minuten.
Es ist zwölf Uhr.
and so on...
yes we speak this so.
Excellent, there is no problem then! Bosnian version works like this. Now, make a version of front panel with this kind of pronunciation and you are done. This is how Bosnian version is made: http://www.elektronika.ba/wc.jpg
Can you make the same in German? The top two rows are for the hours, the third row is for the word "hour" and "hours" (in german: stunde/stunden or urh/urhen?) and the remaining rows are for the minutes. You can, of course, use first three rows for the hours, and the fourth for the word "hour/hours" - there is no limit.

Forget about the english version, it was just an example. English version is also not good idea for Bosnian pronunciation of time.
hibs
Posts: 8
Joined: 29-01-2013, 20:34

Re: Construction of Word Clock v1

Post by hibs »

Hi Trax.

I've finally finished your clock in English. You can see it here:

http://www.youtube.com/watch?v=u6ZMiYeZ6pc

It's half the size of yours with 8mm high letters. I'd like to thank you again for sharing such a great piece of work. I think what you have created is really beautiful. For any English speakers I've uploaded the relevant files here:

http://www.mediafire.com/?wzfflp2mncsgabx

I can't wait to see V2 of your Word Clock. How is it coming along?

Hibs
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Hi Hibs,

Great work! It looks super :-)

P.S. What software did you use to edit the video?
hibs
Posts: 8
Joined: 29-01-2013, 20:34

Re: Construction of Word Clock v1

Post by hibs »

Hi Trax

Thanks for your comments. I used Adobe Premiere Pro for editing but this is completely overkill for the very basic editing I did. Pretty much any video editor would be capable of doing what I did as long as it can do panning/zooming across still images, video/still image crossfade transitions, speeded up video, zooming on video.

I have a little request. I have mentioned previously that I have no programming skills, and was wondering whether you'd be able to alter the firmware to enable me to alter the displayed temperature as my clock is constantly showing a temperature 2 degrees higher than it really is. ie. when the DS3231 reads for example 24 degrees the displayed temperature on the clock face should be 22 degrees. If you're busy then don't worry about it.

Thanks

Hibs
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Hello,

So, you too are having problems with +2 degrees, I thought that was just me :-)

I will look into this problem ASAP, and I also noticed that when you first power up the clock it shows correct temperature, and after few minutes it shows those +2 degrees. I cant believe that something on this PCB is heating up. There is only ATmega328p and DS3231 IC, so I have no clue why this happens...

Trax
hibs
Posts: 8
Joined: 29-01-2013, 20:34

Re: Construction of Word Clock v1

Post by hibs »

Hi Trax

The combination of Atmega328 and DS3231 consumes about 10mA at 5V (almost all of which is used by the Atmega328) which is 0.05W of heating. Maybe this is enough to raise the measured temperature by about 2 degrees over a period of several minutes due to the proximity of the DS3231 to the Atmega.

In my setup the DS3231 is on a separate pcb (although linked mechanically to the Atmega pcb) and doesn't really show this temperature increase over several minutes. I just have a natural 2 degree positive offset compared to a variety of other temperature sensors. I guess this falls within spec of the chip as the datasheet says an accuracy of +/- 3 degrees.

Hibs
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Yep, you are probably right. I will make an option so user can set +/- offset in the Menu...
Thanks :)
hibs
Posts: 8
Joined: 29-01-2013, 20:34

Re: Construction of Word Clock v1

Post by hibs »

That's great news. Many many thanks in advance.

Hibs
ioanniskar
Posts: 1
Joined: 01-02-2013, 23:59

Re: Construction of Word Clock v1

Post by ioanniskar »

Hello,
thanks for this amazing word clock tutorial. I don't have experience on AVR programming but I'd really want to create this clock. I have made a similar to this following a tutorial but it was made with Arduino and it was easier.
I have a few questions before ordering the parts I need to start this project. Here we go:

1) I saw the datasheet of the DS3231 RTC module and it says "3.3V operation" but you connect it with 5V on the schematic. Does this work fine with 5V? Should I use a voltage regulator for the RTC?

2) I have never used a MAX7219 and I don't know how this is working. You connect it on 5V but your LEDs require ~3V. How do you get this value? Does the resistor on pin 18 of the MAX7219 drop the voltage? How could I calculate the value of the resistor I need on pin 18?

3) Could I use a voltage regulator instead of the zener diode?

4) I have some questions about the corner LEDs. Could these LEDs showing the minutes have passed? For example: The time is ten minutes past eight. The LEDS behind the words ten+minutes+past+eight are turned on. The very next minute I want to turn on the top left LED. One minute later the top right, then the bottom left and the bottom right. At quarter past eight the four corner LEDs will turn off.
Could this be possible? Could this be possible without losing the blinking function? I don't know how the program works but it would be great if there was a third option for the corner LEDs (a. "Blinking on", b. "blinking off", c "Showing the minutes"). What do you think about that?

Have you made a V2 of the clock? What are the improvements?

Thanks in advance.
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Thanks :-)
ioanniskar wrote:1) I saw the datasheet of the DS3231 RTC module and it says "3.3V operation" but you connect it with 5V on the schematic. Does this work fine with 5V? Should I use a voltage regulator for the RTC?
Don't worry about this, it works on 5V!
ioanniskar wrote:2) I have never used a MAX7219 and I don't know how this is working. You connect it on 5V but your LEDs require ~3V. How do you get this value? Does the resistor on pin 18 of the MAX7219 drop the voltage? How could I calculate the value of the resistor I need on pin 18?
Yes, that resistor limits the current through LEDs. The current is what matters with LEDs. You can find a table of resistor values, voltages and currents in the MAX7219 datasheet.
ioanniskar wrote:3) Could I use a voltage regulator instead of the zener diode?
Zener diode is not used here to regulate the voltage. It is only used as a protection diode since the entire clock is powered from a 5V 1A SMPS "wall wart" power adapter. You can use LM7805 to regulate the power if you have a higher-voltage power source.
ioanniskar wrote:4) I have some questions about the corner LEDs. Could these LEDs showing the minutes have passed? For example: The time is ten minutes past eight. The LEDS behind the words ten+minutes+past+eight are turned on. The very next minute I want to turn on the top left LED. One minute later the top right, then the bottom left and the bottom right. At quarter past eight the four corner LEDs will turn off. Could this be possible?
I know what you mean, just like the original Qlocktwo. This clock is not designed that way, because I wanted it to display all possible "times" with words. But, you can make changes in the source-code and do it yourself! So, yes, it can be done!
ioanniskar wrote:Could this be possible without losing the blinking function? I don't know how the program works but it would be great if there was a third option for the corner LEDs (a. "Blinking on", b. "blinking off", c "Showing the minutes"). What do you think about that?
Yea, I don't know how would that look :-)
ioanniskar wrote:Have you made a V2 of the clock? What are the improvements?
The improvements are: factory made PCBs (main board, touch boards, and 4 tiny corner LED PCBs). There are few minor improvements in source-code but nothing worth mentioning. The schematics are the same except some pins of ATmega are mixed/changed because of new PCB layout.
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

Hello,

i'm again. I had to take a break with this project, but now i want to finish. The clock is going well.

But i want some specials in the program, can you help me?

I want on 6:20 to 6:25 o'clock a other text and not the time on the display. The letters are on the "letter mask foil".

I have insert a new block in the "lang_de.h" under the minutes.

Code: Select all

// Good Morning
const char MAX_X_GM[] PROGMEM = {
	// MAX 2	// MAX 3
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00111100, 0b00000000,
	0b00000000, 0b01111111,
	0b00000000, 0b00000000,
	// MAX 1	// MAX 4
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
	0b00000000, 0b00000000,
};

// Pointers to hour arrays in PGM space
PGM_P const MAX_X[] PROGMEM = {
	MAX_X_GM,
};

I think i must change/insert the code on this position, or?

Code: Select all

// find the words to describe time
void display_time()
{
	// if we have something new to display / if the minute has changed inside the RTC chip
	//if( !bv(bRTC_MinChg,BAPP1) )
	if( !bv(bRTC_SecChg,BAPP1) ) // seconds, not minutes. because of corner dots blink on every second if user wants them...
	{
		return; // we don't, so get outta here
	}

	// clear all but dots in the corners
	display_clear(1);

	// since time is kept in 24 hours format inside of DS323X IC, and we can show only 12 hours, we must reduce it to 12 hr mode
	uint8_t time_h = RTC[TIME_H];
	uint8_t time_m = RTC[TIME_M];

	if( time_h == 0 ) time_h = 12;
	if( time_h > 12 ) time_h = time_h - 12;

	// fetch the appropriate arrays from PGM space into RAM
	char hour_arr[32];
	memcpy_P(hour_arr, (PGM_P)pgm_read_word( &MAX_h[time_h-1] ), 32);
	char minute_arr[32];
	memcpy_P(minute_arr, (PGM_P)pgm_read_word( &MAX_m[time_m] ), 32);

	// turn ON current hour's LEDs for all MAXs that might have an ON LED for this hour
	// we will turn ON current minute's LEDs also here
	// we do that 8 times for each MAX, for each "column" of data, even though it is actually row data because that's how I soldered the LEDs :(
	for(uint8_t i=0; i<8; i++)
	{
		// MAX 1
		display_matrix[0][i] |= hour_arr[16+(i*2)]	| minute_arr[16+(i*2)];		// turn ON hours & minutes that need to be ON for this MAX
		// MAX 2
		display_matrix[1][i] |= hour_arr[i*2]		| minute_arr[i*2];			// turn ON hours & minutes that need to be ON for this MAX
		// MAX 3
		display_matrix[2][i] |= hour_arr[(i*2)+1]	| minute_arr[(i*2)+1];		// turn ON hours & minutes that need to be ON for this MAX
		// MAX 4
		display_matrix[3][i] |= hour_arr[17+(i*2)]	| minute_arr[17+(i*2)];		// turn ON hours & minutes that need to be ON for this MAX
	}

	// send the "display matrix" to all MAXes on the bus
	max72xx_send_matrix();

	bc(bRTC_MinChg,BAPP1); // clear and wait for another minute-change so we can do this stuff again. can't wait .) - arrrgh
	// we need to falsify other changes, so that the next function in line executes at least once
	bs(bRTC_SecChg,BAPP1);
	bs(bRTC_TempChg,BAPP1);
	// next one...

	return;
}
Can you tell me please what i must change? :oops:

Thanks :)
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

Pielo wrote:Hello,

i'm again. I had to take a break with this project, but now i want to finish. The clock is going well.

But i want some specials in the program, can you help me?

I want on 6:20 to 6:25 o'clock a other text and not the time on the display. The letters are on the "letter mask foil".

I have insert a new block in the "lang_de.h" under the minutes.
.
.
.
Ich have solved the problem, but i have a new problem.

Is it possible to show the date after the weekday? I have seen in the datasheet that the DS3232 has the function. I have it try a long time, but without success.

Thanks
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

I just saw your posts...

DS3231(2) has DATE inside, you just need to display it. How are you planning on displaying it? Can you share your vinyl-front design?
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

I will show the weekday after the date is running over the matrix.

for exable:

<--- 25.03.2013 Monday <---

Edit: The link to my 2 mask foil's
http://imageshack.us/photo/my-images/82 ... 67615.jpg/
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Hello,

You can do that in the function that displays time. Find function:

Code: Select all

//##############################
// Displaying stuff functions //
//##############################
// display date, in scrolling fashion
void display_date(void)
{
	char buff[20];

	sprintf(buff,"&&&&%02u/%02u/%04u",RTC[DATE_D],RTC[DATE_M],(2000+RTC[DATE_Y]));

	// clear all but dots in the corners
	display_clear(1);

	// scroll this stuff
	text_scroll(buff,100,1);

	return;
}
and replace it with this one:

Code: Select all

//##############################
// Displaying stuff functions //
//##############################
// display date, in scrolling fashion
void display_date(void)
{
	char buff[50];
	
	char day_name[20];

	// "dow" is global variable that you need to declare in wc2.c
	switch(dow)
	{
		case 1:
			sprintf(day_name,"Sunday");
		break;
		case 2:
			sprintf(day_name,"Monday");
		break;
		case 3:
			sprintf(day_name,"Tuesday");
		break;
		case 4:
			sprintf(day_name,"Blabla");
		break;
		case 5:
			sprintf(day_name,"Blablabla");
		break;
		case 6:
			sprintf(day_name,"Blah");
		break;
		case 7:
			sprintf(day_name,"Saturday");
		break;
	}

	sprintf(buff,"&&&&%02u/%02u/%04u %s",RTC[DATE_D],RTC[DATE_M],(2000+RTC[DATE_Y]),day_name);

	// clear all but dots in the corners
	display_clear(1);

	// scroll this stuff
	text_scroll(buff,100,1);

	return;
}
In interrupt routine "ISR(PCINT2_vect, ISR_NOBLOCK)" you need to find this code:

Code: Select all

		// skip this one
		//uint8_t dow = twi_rx_ack(); 			// dummy read Day Of Week
		twi_rx_ack(); 			// dummy read Day Of Week
		// date
and replace with this:

Code: Select all

		// skip this one
		dow = twi_rx_ack(); 			// real read Day Of Week
		//twi_rx_ack(); 			// dummy read Day Of Week
		// date
in wc2.c at the top where other variables are declared, you need to declare "dow" variable as:

Code: Select all

volatile uint8_t dow = 1;
That should work! (I didn't try compiling it.)
User avatar
trax
Administrator sajta
Administrator sajta
Posts: 3508
Joined: 08-01-2005, 18:04
Location: 75k, BA
Contact:

Re: Construction of Word Clock v1

Post by trax »

Oh, and in the function where you the time is set, you must also set the day of week. Day of week in DS3231 is not "linked" to calendar functions if I remember correctly... it is only incremented at midnight by 1.
Pielo
Pocetnik na forumu
Pocetnik na forumu
Posts: 37
Joined: 15-01-2013, 13:23
Location: Germany, Thüringen

Re: Construction of Word Clock v1

Post by Pielo »

I have change this, but i have 144 errors

Code: Select all

stray '\240' in programm
what can i do?
Post Reply