Pages: [1] 2   Go Down
Author Topic: Life Clock  (Read 5809 times)
0 Members and 1 Guest are viewing this topic.
Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://www.arduino.cc/playground/Main/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 -

I hope it may stimulate some ideas.
« Last Edit: June 28, 2008, 02:51:09 pm by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, excellent work!
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!   smiley
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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!   smiley

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.
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
   0. scrolling text message (hardcoded for now);
   1. scrolling time (from DS1307 clock);
   2. Conway's game;
   3. 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.


Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you please post the schematics?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also interested in schematics
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Schematics can be found here:
http://www.flickr.com/photos/11567579@N05/3178651230/

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:
    3. sleep function for the display (woke up by command from remote);
    4. 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).


« Last Edit: January 07, 2009, 10:30:19 pm by florinc » Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley

FWIMW - http://farm4.static.flickr.com/3114/2628485492_85b7963e37.jpg and http://farm4.static.flickr.com/3103/2628485440_ca0a7db0fd.jpg
« Last Edit: January 08, 2009, 01:06:11 am by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 08, 2009, 10:40:12 am by florinc » Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley

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?  smiley ) You can do it wirelessly  using this: http://www.arduino.cc/playground/X10/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


« Last Edit: January 08, 2009, 11:56:04 am by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Pages: [1] 2   Go Up
Jump to: