Pages: [1]   Go Down
Author Topic: very long countdown art project  (Read 5766 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I need to make a more than 70 years countdown in seconds, i could turn off and turn on without loosing count.  ( then i'd like to link it with sensors )
The main question is : Can arduino uno handle this ?

For now i have 10 seven segments common cathode displays / 2 Max7219 chips, and i roughly understood why i should use these to link the displays and have a clean signal
but i'm still far away from being able to do it by myself.

Can you help me learn to do this ?
Regards
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can arduino uno handle this ?
Yes, that's only ~91 million ~2 billion seconds so a 32-bit variable will hold that easily.

Quote
i could turn off and turn on without loosing count.
Save the counter in EEPROM, either every second (I assume this isn't really going to run for 70 years, you may need to do some, wear levelling) or just before you shut down.

But you don't need it to keep counting while turned off do you? It can start form where it left off.

______
Rob
« Last Edit: November 20, 2012, 11:18:25 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26538
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Put a battery backed RTC on it, can check the displayed time left against the actual current time & adjust accordingly.
Then all you need to store is the end date.  Replace the battery every few years.
70 years * 365.25 days/year * 24 hr/day * 60 minutes/hr * 60 seconds/hr = 2,209,032,000 seconds
Guess that is 10 digits.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26538
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Pluse there will  be some leap seconds in there too.

Assuming we make it past the end of the Mayan calendar. Or the next rapture.  Or ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much for your answers.
First excuse me, I was not very clear. The idea is to have it running for a little more than 70 years, but when it's off i just want it to remember when it stops and start at the last knew count when i turn it back on.
So is real time clock necessary ? i guess i'll need a independent battery device anyway.

The next steps are :

1- getting the 10 diplays, the 2 max7219, the memory device, and the arduino mounted correctly together.  I'll try to do it by myself but if you can give me any advice or link or help, it will be welcome.

2- put the right countdown program in the arduino.

3- link the two sensors that can pause the countdown when they are both activated.

I'll share my progessions with you
If i make any mistake in my steps feel free to warn me, i only wish to learn.

Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might invest some time in sleep modes of the Arduino as only once per second the clock needs to be adjusted.
The rest of the time it can sleep.
So your battery will last longer (you might use some super capacitor)
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26538
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Whatever - I would niot find watching 2,000,000,000 count down 1 second at a time is not very interesting to see tho.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it might show the 2 billion numbers in random order without using one twice (and still change one digit at the time) don't know if that is possible mathemagically?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it might show the 2 billion numbers in random order without using one twice
And that's more interesting how? smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could make bets on the next number for a beer !
with the normal sequence that would be too easy (although after a few beers ...smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

If I'm online, I'm in front of the computer. If else, I'm not.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
I do not help for personal status or gain. The karma button is there because it's pretty.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What would happen when it got to zero?
Logged

Device: Arduino Mega 2560 R3
Experience: Done blinking LEDs. Looking for something new.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26538
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think it ever will - like our national debt ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

If I'm online, I'm in front of the computer. If else, I'm not.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
I do not help for personal status or gain. The karma button is there because it's pretty.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why 70 years? It might be more interesting if it were counting down to something.
Logged

Device: Arduino Mega 2560 R3
Experience: Done blinking LEDs. Looking for something new.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did you ever find a solution to counting up to such a large number?

i looked i to the problem too. specifically only using the eeprom to store the counter.
but the limits are how often you can toggle a bit = 100K times.

i looked in to balanced gray code, which would turn your counter number in to a bit series. this series of bits will use all the bits equally often.

the problem so far is balanced gray code can not be generated with a simple formula, like regular gray code can.

for balanced gray code you need to store a transition sequence that is basically as long as you counter.
in my case that would be 2^21 x 4 bits. so too big to be stored in the progmem.

Logged

Pages: [1]   Go Up
Jump to: