Life Clock

No, it doesn't tell you how long you're going to live. It's simply a combination of several things I've been working on these last few months.

The Life Clock plays Conway's game of “life” and displays the time and temperature as a marquee between games.

Hardware:
I had 3 pc boards made that connect together along with the RG matrix. Together, they make a sandwich – a Sanduino. (sorry Massimo)

The bottom board contains the ATmega168 and a MAX756 step-up converter that takes as little as 1 AA battery and steps it up to the 5V used by the board. It's pretty much the standard circuit found in the datasheet (and Adafruit's “MintyBoost”) with the exception that the “LOW BATT” line is used to pull down the RESET line of ATmega when the battery gets low.

The middle board is sort of a shield for the first. Most everything on it is accessed via I2C. It contains a DS1307 RTC (with b/u battery), a DS1621 temp sensor, and a 24LC256 256K EEPROM. It also contains a MAX3232 for serial I/O, and loading sketches to the board from the IDE. Finally, it contains a piezo and an IR receiver so that a Sony TV remote can be used for input.

The top board contains a pair of MAX7221's used drive the RG matrix. (see Arduino Playground - MultiplexMAX72xx for details.)

Software:
Conway's game of “life” was adapted from an example on processing.org and outputs through the LedControl library. It stops after a set number of generations or if the colony dies or goes into a single static pattern.

I wrote the marquee code to access the EEPROM for it's 5x7 font set, and preset messages. The marquee and game can be run in red, green, and orange (red+green).

The rest is just accessing the various devices.
The case is cherry wood.

Short video here - Arduino Life Clock - YouTube

I hope it may stimulate some ideas.

Wow, excellent work!

That looks really nice. The construction details were interesting. I like the sandwich design.

Since you have the RG matrix, could it be made to play two games of life at once, one red, one green at the same time?

Thank you both for comments.

Oracle, yes it can play life in three colors at once. Since the cell keeps the color it was "born" with, alternating generations between read and green gives all 3 colors. Very colorful. Thanks for the idea.

A few things I forgot to mention that may be helpful:

  • a separate sketch is used to load the characters into EEPROM and to set the time
  • I got 14 hours on 2 AA 2000mAH NiMH batterys
  • it is also powered by a USB port

This is excellent! What is needed to pull off a simplified version of this with a plain Arduino Decimal? I have an 8x8 matrix and got Life running on it without the Max chips (uses every free output). What would be used to add appropriate clock capabilities to an Arduino board? What else would be missing? Again, nice work! :slight_smile:

This is excellent! What is needed to pull off a simplified version of this with a plain Arduino Decimal? I have an 8x8 matrix and got Life running on it without the Max chips (uses every free output). What would be used to add appropriate clock capabilities to an Arduino board? What else would be missing? Again, nice work! :slight_smile:

The easiest way to add a real time clock is to use a 1307RTC clock chip as this project actually uses. You'll need a couple of IO lines for the interface though so, I'm not sure you'll have enough with 16 lines tied up for the matrix.

You can try keeping track of time in software using timer interrrupts, but it puts a lot more burden on your code.

wheagy,

Thank you.

Yes, the DS1307 RTC is the way to go IMO. Especially with a battery B/U. However you will need to squeeze out 2 more pins - analog 4&5 - for the I2C.

Beyond that, you will likely need code to display and scroll the time on the matrix. Mine is tied to LedControl & characters in EEPROM, but I would be happy to post it if you think it would be useful.

Something you could do is make your own shield that holds the DS1307, battery, and what ever else. If you want the schematics I could post them or PM them.

I built myself a similar project recently, on a single shield. Features (software, supported by hardware) include:

  • dual colour (red, green (orange by subtraction)) 8x8 LED matrix;
  • user menu, through either push button or infrared (Sony remote), which allows one of the following options:
  1. scrolling text message (hardcoded for now);
  2. scrolling time (from DS1307 clock);
  3. Conway's game;
  4. set scrolling speed;
    I am thinking of adding a few more features, but they will be on a separate shield.

The circuit was built on a protoshield, with soldered wires connecting the parts, a pretty messy job, but fast enough for a prototype.
The schematics is based on the one posted here:
[I am not allowed to post the link, but google for "led-matrix-projector"]
(it uses 2 shift registers 74HC595 and ULN2803 sink driver).

I am wondering if there is interest in building a shield for a LED matrix display. (The only problem I see at the moment is the multitude of 8x8 LED matrix types out there. This means that the matrix I used won't be necessarily available to everyone.)

I already designed the board (Eagle) and I can share it.

Could you please post the schematics?

Also interested in schematics

Schematics can be found here:
Imgur

You can also find a few more photos of the project in the same photo set.

I should mention that the LED matrix I used is UVP2788, or GMA4688C. These are not pin-to-pin compatible with the RG 8x8 matrix sold by sparkfun. By looking at the photos posted by Mr. BroHogan I can tell that the matrix I used is not compatible with the one he used (pins on mine's are shifted by one).

The matrix/display board/shield is being manufactured by seeedstudio. They may offer it for sale on their site. I did not receive mine yet, so I don't know if it will be final or needs adjustments.

The clock (DS1307) is on another protoshield (not yet built). In my prototype I used a small DS1307 evaluation kit bought from wulfden (you can see the wires for the clock in one of the photos).

With all the current functionality, the code takes the whole flash memory of the atmega168 (I actually had to move things around when I realized that some weird behaviour was caused by memory being (almost) full).

The next steps would be:

  • h/w:
  1. get the displayed text messages through wi-fi (I just acquired a cheap fonera box);
  2. tengu (need to use an audio amplifier, probably on the same protoshield as the clock);
  • s/w:
  1. sleep function for the display (woke up by command from remote);
  2. 8 channel audio spectrum VU meter (use the same circuitry from tengu (mic, amp), but may need some more h/w (filter ICs));

For the above features, I plan to switch to atmega 328 (already ordered from adafruit).

florinc,

Very nice! I like that you did it with 74HC595's instead of the MAX.

Just a thought regarding the memory issue, if you haven't considered it. For $2 and a few wires you can add an I2C 256K EEPROM to store your fonts, messages, reminders, tengu faces etc. I found that it's quite fast enough to pull this stuff out of EEPROM realtime.

I was also looking into adding a mic driven VU meter / tengu - sensitive to 3 frequency bands. (Did you bug my basement?) I was experimenting with Sparkfun's LM4970 breakout (http://www.sparkfun.com/commerce/product_info.php?products_id=8247) with inverters and filters to get the PWM that represented the 3 frequency bands back to the Arduino via an I2C ADC. I got very close, but all that analog stuff was frustrating.

I wonder if anyone knows of a nice chip that splits audio into 3 bands and outputs them as analog voltages?

Anyway, you now have a nice I/O platform (viewable at a distance) that you can do all sorts of things with. Enjoy :slight_smile:

FWIMW - http://farm4.static.flickr.com/3114/2628485492_85b7963e37.jpg and http://farm4.static.flickr.com/3103/2628485440_ca0a7db0fd.jpg

Mr. BroHogan,
Thank you for your nice comments.
You must have put quite a bit of work (and skill) in that beautiful cherry wood case. I myself used an empty box of Ferrero-Roche chocolates. Another case I am thinking of using is a glass dome, usually used for displaying pocket watches (I bought one from ebay, did not receive it yet).

The good thing about using 74HC595 is the price. The bad thing is that most of the digital outputs are used, there is no room for other add-ins like an ethernet card (for wi-fi I am going to use the serial communication pins).

I have to do the I2C memory, indeed. And I can load it with a book of quotations (256K would cover aprox 128 book pages), for example.

As for the VU meter, check out this chip, MAX7400 (see http://datasheets.maxim-ic.com/en/ds/MAX7400-MAX7407.pdf) that filters audio frequencies based on the clock signal. I did not test it yet myself (I just ordered a sample from maxim). According to specs, filtering should be handled through software.

I am thinking of a novel solution for the power supply. Even though the whole rig takes an average of 15-20 mA, the set of 4 AA batteries dies out rather quickly, in about 20 hours. If I want to add the wireless, they will last much shorter. I am thinking of hanging the whole box from the bulb socket in the ceiling, and eventually make it to rotate (with the remote, of course) for the best reading.

Nice brainstorming session you started here. Thanks. You really stimulated some ideas. I will keep you posted.

PS Wow! If I get it hooked to the bulb socket, then I can also have some X10-based functionality available.

Mr. BroHogan,
A question for you: in your implementation of Conway's game, how do you know when the game ended, so you can switch to displaying the time?

florinc,

Thanks for the tip on the chip! Although a "8th-order low-pass elliptic switched capacitor filter" sounds a little scary, it's definitely worth looking at. :slight_smile:

Re stopping the game, I didn't do a complete job, but I did 3 things:

  • had a max generation count that always stopped after 50 or so generations.
  • checked each generation for >0 leds to light to stop if the colony died.
  • set a flag in "BirthDeath()" that indicates that cells are still being born or dieing. If the flag is not set after leaving the function it's assumed the colony is static.
    Note the above does not catch an alternating static patern. That would be nice, but I got lazy. (The max gen will eventually stop it, but it would be nice not to have a max gen.)

Re: X10, I also added that. (You sure you didn't bug my basement? :slight_smile: ) You can do it wirelessly using this: Arduino Playground - CM17A.
(Take it out of the case, remove the DB9's and use a large shrink tube or tape to make it even smaller.) You can use the IR remote or your clock to turn on lights.

Re: power, I also use a USB wall wart besides batteries. Is your idea like a screw in light fixture that powers a power adapter?

Finally, thanks for your comments on the case. I also enjoy woodworking which fits in nicely with this hobby.

John

Thanks for the X10 link. Total news to me. (I already have an X10 receiver that I use, so I am half way there already :slight_smile:

That's right, a screw-in light fixture, like a light bulb. I think the glass dome I mentioned earlier will fit well in here, but used upside down (with the wooden base part on top, and a light bulb screw attached to it). We would need to find a way to secure the dome to the wooden base. A small power adapter (the "USB wall wart") should fit in the dome as well. I am thinking that even a glass jar can be adapted for the job, and it would be easier to attach the screw to the metal lid.
A servo will be required to rotate the display (to position it for the best viewing).
Also, a set of high intensity LEDs could be installed opposite to the display matrix, and used as directed, remote-controlable, light source. (now that this Arduino contraption is screwed where the old light fixture was).

I see a few challenges that need to be resolved:

  • mic and buzzer are inside the jar/dome/bulb now;
  • IR receiver should be reachable by remote even when the whole thing is rotated 180 degrees and not facing the remote (can you have 2 IR receivers in parallel?);

And, listen to this: if an accelerometer is included (or some positioning sensor), then the contraption can be screwed up in the ceiling (hanging down) or screwed down in a desk lamp, and the display will still show the text in the correct stance.

What do you think?

A bit of an update on the slow progress of my version of "Life Clock" (I could not resist :-[):

  • I switched to atmega 328, $2 more expensive, but lots of memory for future expansions;

  • I was able to store my character set definition (8 bytes per character x 96 characters) in the local eprom (1K now); so now the 24LC256 eprom has only messages (32K, aprox 16 book pages);

  • implemented "sleep mode", through remote control; in sleep mode, the whole thing is taking now 3.5 mA (an off-the-shelf arduino takes at least 15 mA in sleep mode). For this purpose, I had to build a custom arduino board, basically a protoshield (the small/short version) with only the processor on it. I eliminated the power LED (20 mA wasted right there), the FTDI chip, and the voltage regulator and the reset button (I always use a shield that has a reset button).

  • I am still waiting for the LED matrix shields from seeedstudio; they should be available for everyone soon;

I think there would be a need for yet another arduino-compatible board, one similar to Arduino Pro from sparkfun, but with an atmega 328 on it and no LEDs, plus some other provisions for sleep mode.

BroHogan,

Could you send me a copy of the schematics and code? I'm really interested in the code for loading and reading the eeprom for font data. I'm looking at making a sign, but the main part i'm hung up on is the way to take a message and lookup the font data in eeprom. Nice project! :slight_smile:

More progress! Today I received the shields from seeedstudio. Everything worked like a charm, no glitches, no surprises, almost unbelievable!

This is how it looks like:

More photos here:

I added a (poor quality unedited) video as well:

That looks amazing. Great work. I just posted the other day asking for an update on the RainbowDuino http://www.seeedstudio.com/blog/?page_id=187

Can I assume that you are using what will be that product?