Arduino Forum

Topics => Interactive Art => Topic started by: exesnot on Nov 20, 2012, 11:48 am

Title: very long countdown art project
Post by: exesnot on Nov 20, 2012, 11:48 am
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
Title: Re: very long countdown art project
Post by: graynomad on Nov 20, 2012, 02:25 pm
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
Title: Re: very long countdown art project
Post by: CrossRoads on Nov 20, 2012, 05:11 pm
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.
Title: Re: very long countdown art project
Post by: CrossRoads on Nov 20, 2012, 05:13 pm
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 ...
Title: Re: very long countdown art project
Post by: exesnot on Nov 20, 2012, 06:26 pm
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.

Title: Re: very long countdown art project
Post by: robtillaart on Nov 20, 2012, 07:44 pm
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)
Title: Re: very long countdown art project
Post by: CrossRoads on Nov 20, 2012, 10:39 pm
Whatever - I would niot find watching 2,000,000,000 count down 1 second at a time is not very interesting to see tho.
Title: Re: very long countdown art project
Post by: robtillaart on Nov 21, 2012, 08:51 pm
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?
Title: Re: very long countdown art project
Post by: graynomad on Nov 22, 2012, 02:16 am
Quote
it might show the 2 billion numbers in random order without using one twice

And that's more interesting how? :)

______
Rob
Title: Re: very long countdown art project
Post by: robtillaart on Nov 22, 2012, 08:10 pm
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 ...;)
Title: Re: very long countdown art project
Post by: Tvex on Jan 02, 2013, 08:56 pm
What would happen when it got to zero?
Title: Re: very long countdown art project
Post by: CrossRoads on Jan 02, 2013, 09:54 pm
I don't think it ever will - like our national debt ...
Title: Re: very long countdown art project
Post by: Tvex on Jan 03, 2013, 06:24 pm
Why 70 years? It might be more interesting if it were counting down to something.
Title: Re: very long countdown art project
Post by: antimodular on Jan 10, 2013, 12:40 pm
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.