“Counting Box” Also Saves Calculators From Small Children

[Nathan]’s son really loves numbers and counting, and one of his favorite things to do is add 1 to a calculator over and over again. Being the awesome dad that he is, [Nathan] built his son a counting box that has a 10-digit rotary switch and two arcade buttons to add and subtract.

One goal of the project was to have the counting box retain memory of the display while being powered off. The easiest way to do this is to write the display data to the ATmega’s EEPROM. This EEPROM is only rated for 100,000 write cycles (although in practice it’s much higher), so [Nathan] included a 24LC256 in a little spasm of over-engineering. All the electronics are laid out on perf board, and the case is constructed from bamboo that was laser cut by Ponoko. The quality of the case itself is fairly remarkable – we’re really impressed with the finish and the magnetic battery access door.

From experience, we know that playing with an HP-15C eventually leads to a broken calculator and having our Nintendo taken away. We’re really happy for [Nathan]’s son, and wish we had our own counting box at his age.

27 thoughts on ““Counting Box” Also Saves Calculators From Small Children

    1. You can. It is called a box joint or finger joint. All you need is a table saw and a little time to make a two dollar jig.

      Alternatively you can go for hardmode and use a backsaw and paring chisel.

  1. 100,000 cycles is a lot if you only write to the EEPROM when the box is turned off.
    Add a small capacitor, and measure the voltage. If it drops below a threshold, write the current number to the EEPROM.

  2. or just add a line of code that counts to 99,999 and then moves to next eeprom domain (cell), it`s the Cells that fail, not the addressing support logic for them ;)

    Nice work btw!

      1. i believe the AVR has a seperate ‘cell’ for each byte of the EEPROM

        its the flash that is in larger pages

        however, i have seen another method for saving the eeprom

        have an array of struct’s in the eeprom, with a serial# at the start of each one
        and rotate thru the array, updating only one entry each time
        when you start up, read the one with the highest serial#
        if you can fit 10 copies of the config in eeprom, you just extended the life *10

  3. A great build, with an absolutely far out finished product. I can’t recall at what age we learned to count, but I’m sure the technology at the time was paper,and a fat pencil. Writing down 1-2-3…98-99-100 would have certainly been seen as a waste of paper, and probably discouraged, unless the parent got tired of the child continuously verbally counting out the numbers.

    1. I have the math (gray one) and the reading one (yellow). the reading one really isn’t so fun without the books it came with, since it references them. both were only a few bucks at garage and estate sales. cool.

      I’d love to take the speech chip out and build my own talking box like what those with disabling diseases use– but I can’t find any documentation on it. just instructions on how to circuit bend.

      This box is cool though. I messed around with 7-segment LED modules and various ICs designed for them: 4026, 429+4511…

      I’ve been wanting to build a similar box like this but avoiding use of any kind of micro controller.. using the above listed ICs, I could build a box that counts up and down at the push of a button, but the rotary dial would be tricky, as well as power-off memory. it would also use a lot more chips and power than necessary.

    2. I have the math (gray one) and the reading one (yellow). the reading one really isn’t so fun without the books it came with, since it references them. both were only a few bucks at garage and estate sales. cool.

      I’d love to take the speech chip out and build my own talking box like what those with disabling diseases use– but I can’t find any documentation on it. just instructions on how to circuit bend.

      This box is cool though. I messed around with 7-segment LED modules and various ICs designed for them: 4026, 4029+4511…

      I’ve been wanting to build a similar box like this but avoiding use of any kind of micro controller.. using the above listed ICs, I could build a box that counts up and down at the push of a button, but the rotary dial would be tricky, as well as power-off memory. it would also use a lot more chips and power than necessary.

      1. @RunnerPack
        yes, that is probably everything I would ever need to know, and more!

        much of it is over my head, though I DO have a Timex machine, Like-New In Box, in the garage, I COULD try and fire it up and see if I can get this project going.

        but seeing that link you posted made me give google another go and so I changed my search terms a little and found this:

        http://highlyliquid.com/kits/midispeak/

        absolutely perfect, as my intended uses for a properly modded speak’n’spell unit were musical in nature. circuit bending is neat, but I want exact control, not random glitches. I will be getting this kit and seeing how that works, probably apply it to my Speak’n’Math, and maybe if I get inspired to work a little harder, fit my Speak’n’Read to work with the Timex computer (or at least build the interface and find a way to attach it to a newer PC– maybe whenever I finally give in to Aurduino)

        Thanks!

        –and on a side note, it’d be nice to be able to delete double-posts, or edit comments to prevent double posting. or at the least, report comments and be able to enter a reason it needs to be removed.

  4. It can count up to 99.999.999, so you would need 27 bits to store the count. The ATMEGA328 used has 1k of EEPROM. Using 4 bytes at a time to store the count, progressing through the EEPROM memory space, using the most significant bit to mark the previous value as invalid (bits can be cleared without erasing). This would provide space for 256 counter values before wrapping back to the first byte in the EEPROM, to make the whole thing last at least 25.600.000 cycles.

    I seriously doubt the on/off switch would last that long.

    Pretty neat toy though, it’ll be a nice anecdote many years from now.

  5. When I was a kid I saw a box about the size of a 1960’s TV, with a telephone dial and 10 lights. When you dialed, a stepper relay incremented once for each pulse and the next light lit up, so it added.

  6. You could also lump in a huge capacitor on its power and write EEPROM only when the brownout detector fires an interrupt (or a/d converter sees power drop below a threshold). Saves many write cycles I think.

    1. oh yeah.. not as cheap and simple but probably safer: you could also implement the on/off switch as a soft switch that either powers on a transistor that provides power from the battery or signals the mcu to power down (and the mcu itself could ground that transistors base). That way the MCU has all the time it wants to shut down. Further improvement could be a capacitor timing circuit in its base that cuts off power anyway if you hold the button for too long – to prevent lockups.

  7. Thanks for the feedback, all! These are some good ideas I can explore next time I deal with similar issues in memory and power consumption.
    By the way, the tracking I built into it shows that after one week of use so far the max number he’s reached is 2161 and the minimum is -93, with 1416 pushes of the plus and 642 pushes of the minus.

    1. given this data, it appears to be reasonably safe to assume that adding is indeed of greater entertainment value than that of subtracting.

      that said, I have a thing for counting devices as well. odometers, turnstiles, utility meters… not like OCD, but I find it’s neat to look at the numbers, especially when the various milestones are reached (888888, 123456, 101010, etc..)

      I have a general event counter project in the works, the end result will be a set of 7-segmented LED modules like this project, but instead of a + and – button, I’ll have jacks for plugging in remote triggers such as reed switches, micro switches, laser path break switch, mercury switch, dB level switch, etc… and also a clock to trigger it by the second or fraction of a second or minute, hour, etc.

      it’s been on hold, but after seeing this, I think I will get to it sooner rather than later.

      thanks.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.