Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: November 20, 2012, 05:48:47 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
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #1 on: November 20, 2012, 08:25:34 am » |
Can arduino uno handle this ? Yes, that's only ~91 million ~2 billion seconds so a 32-bit variable will hold that easily. 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
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16459
Available for Design & Build services
|
 |
« Reply #2 on: November 20, 2012, 11:11:47 am » |
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
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16459
Available for Design & Build services
|
 |
« Reply #3 on: November 20, 2012, 11:13:46 am » |
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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #4 on: November 20, 2012, 12:26:57 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.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #5 on: November 20, 2012, 01:44:08 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)
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 240
Posts: 16459
Available for Design & Build services
|
 |
« Reply #6 on: November 20, 2012, 04:39:09 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.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #7 on: November 21, 2012, 02:51:27 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?
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6809
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #8 on: November 21, 2012, 08:16:13 pm » |
it might show the 2 billion numbers in random order without using one twice And that's more interesting how?  ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #9 on: November 22, 2012, 02:10:54 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 ... 
|
|
|
|
|
Logged
|
|
|
|
|
If I'm online, I'm in front of the computer. If else, I'm not.
Offline
Newbie
Karma: 0
Posts: 12
I do not help for personal status or gain. The karma button is there because it's pretty.
|
 |
« Reply #10 on: January 02, 2013, 02:56:23 pm » |
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
Online
Brattain Member
Karma: 240
Posts: 16459
Available for Design & Build services
|
 |
« Reply #11 on: January 02, 2013, 03:54:20 pm » |
I don't think it ever will - like our national debt ...
|
|
|
|
|
Logged
|
|
|
|
|
If I'm online, I'm in front of the computer. If else, I'm not.
Offline
Newbie
Karma: 0
Posts: 12
I do not help for personal status or gain. The karma button is there because it's pretty.
|
 |
« Reply #12 on: January 03, 2013, 12:24:27 pm » |
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
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #13 on: January 10, 2013, 06:40:16 am » |
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
|
|
|
|
|
|