Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: BroHogan on Jun 28, 2008, 09:49 pm

Title: Life Clock
Post by: BroHogan on Jun 28, 2008, 09:49 pm
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.

(http://farm4.static.flickr.com/3278/2619214778_6ef271aa0e_m.jpg)

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

(http://farm4.static.flickr.com/3291/2619214774_19c7a1697e.jpg)

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 - http://www.youtube.com/watch?v=bNNSmVmwCU0

I hope it may stimulate some ideas.
Title: Re: Life Clock
Post by: trialex on Jun 29, 2008, 01:32 am
Wow, excellent work!
Title: Re: Life Clock
Post by: Oracle on Jun 29, 2008, 02:02 am
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?
Title: Re: Life Clock
Post by: BroHogan on Jun 29, 2008, 09:00 pm
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
Title: Re: Life Clock
Post by: wheagy on Jun 30, 2008, 02:42 pm
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!   :)
Title: Re: Life Clock
Post by: Oracle on Jun 30, 2008, 03:38 pm
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!   :)


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.
Title: Re: Life Clock
Post by: BroHogan on Jun 30, 2008, 08:30 pm
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.
Title: Re: Life Clock
Post by: florinc on Dec 24, 2008, 03:22 am
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.


Title: Re: Life Clock
Post by: Arnonh on Jan 03, 2009, 06:51 pm
Could you please post the schematics?
Title: Re: Life Clock
Post by: kitschpatrol on Jan 07, 2009, 04:33 pm
Also interested in schematics
Title: Re: Life Clock
Post by: florinc on Jan 08, 2009, 02:45 am
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).


Title: Re: Life Clock
Post by: BroHogan on Jan 08, 2009, 07:03 am
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  :)

FWIMW - http://farm4.static.flickr.com/3114/2628485492_85b7963e37.jpg and http://farm4.static.flickr.com/3103/2628485440_ca0a7db0fd.jpg
Title: Re: Life Clock
Post by: florinc on Jan 08, 2009, 04:20 pm
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.
Title: Re: Life Clock
Post by: florinc on Jan 08, 2009, 04:48 pm
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?

Title: Re: Life Clock
Post by: BroHogan on Jan 08, 2009, 05:49 pm
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.  :)

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?  :) ) 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


Title: Re: Life Clock
Post by: florinc on Jan 08, 2009, 07:40 pm
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 :)

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?







Title: Re: Life Clock
Post by: florinc on Feb 06, 2009, 05:57 am
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.


Title: Re: Life Clock
Post by: NVRDUNN on Feb 06, 2009, 07:21 pm
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!  :)
Title: Re: Life Clock
Post by: florinc on Feb 20, 2009, 03:24 am
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:

(http://farm4.static.flickr.com/3402/3294361564_b5217d8c12.jpg?v=0)

More photos here:
http://flickr.com/photos/11567579@N05/3293540285/in/set-72157612254405335/

I added a (poor quality unedited) video as well:
http://www.youtube.com/watch?v=PEtojxk4Cpg

Title: Re: Life Clock
Post by: boerner on Feb 21, 2009, 12:50 am
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?
Title: Re: Life Clock
Post by: florinc on Feb 21, 2009, 02:45 am
Thanks.
I reckoned that using a glass dome would be suitable for a clock. Plus, being transparent, it gives access to the IR receiver.

No, I did not use the seedstudio's RainbowDuino. I designed my own and I got it manufactured by them. (My previous posting has a link to the photo of the little black board, the LED matrix shield).

I can provide more hardware details if you are interested.

Title: Re: Life Clock
Post by: boerner on Feb 21, 2009, 06:55 pm
Yes, more details please!  :)

Did they do this for you as a one-off, or are they going to manufacture your design?
Title: Re: Life Clock
Post by: florinc on Feb 21, 2009, 10:16 pm
Seeedstudio offers this so called "Propaganda PCB service" , check it out at http://www.seeedstudio.com/forge/wikka.php?wakka=Propaganda.
You email them the Eagle board file (must be open source) and they send you 5 boards for $30.

I had the shield for the 8x8 RG LED matrix made by them.
Theoretically, you should be able to buy the boards I designed from their website, although I did not see them posted yet. Just ask. Anyway, I just finished revision 1.1 and I will get it manufactured in bigger batch.

As for the arduino, I used one made on the small prototype shield, since I wanted all the boards in the sandwich to have the same dimensions, and also because I wanted to eliminate some components (from the original arduino) that I did not need and which took some juice out of the batteries. I almost finished the design of this board (waiting to get a few more components). This should be also available soon.

After much thinking, I came to realize that Mr. BroHogan's original "sandwichduino" is the best approach for this kind of project. And coming up with a case is as challenging. The glass dome I used is not cheap, but the cherry case required even more effort, I assume.

The project is still in development, since I plan to add a few more things, as suggested in previous postings here.

Title: Re: Life Clock
Post by: florinc on Mar 23, 2009, 03:18 am
Here is a new version of the clock project:
(http://farm4.static.flickr.com/3420/3377192655_d13b940c70.jpg?v=0)

The idea was to be hung on a wall. I had a few options for the case, but they would require some fine work and skills, so I opted for the easiest and quickest, a bent piece of plexiglass (clear acrylic).
The circuitry fits on one custom board. It should have been black, but I forgot to ask when I ordered it.

Title: Re: Life Clock
Post by: florinc on May 12, 2009, 04:37 am
My friends asked for a larger display. Using the same LED driver circuitry, I replaced the bi-color 8x8 LED matrix with two, single color (red), 8x8 LED matrices. The result is shown below.

(http://farm4.static.flickr.com/3582/3523555349_bf28d207b8.jpg?v=0)

(The case, bought from a photo shop, was designed for storing 4x6 photos. It has a hinged glass door, held in place with small magnets. It can be also hung on the wall (this has become an obsession, it seems :'())
Title: Re: Life Clock
Post by: k2pek2 on May 12, 2009, 05:19 am
wow, i'm impressed. I like how your project got increasingly more complicated!

as a sidenote... any figures in terms of total cost?
Title: Re: Life Clock
Post by: zooto68 on May 12, 2009, 08:58 am
Quote
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


Not sure what you mean by that. You only need 3 pins to drive 74HC595's.
Title: Re: Life Clock
Post by: florinc on May 12, 2009, 03:47 pm
Mike,
My approach uses a combination of 595 (2 pieces) and direct outputs, as shown in the schematic here:
http://www.flickr.com/photos/11567579@N05/3178651230/in/set-72157612254405335/
I could have used a third 595 to drive the rows and save some 5 outputs.
Since I dropped some "requirements", there are still 3 analog/digital pins available (for alarm/buzzer/x10, for example).
As for the input pins, I only need to use two: one is for IR receiver, one for a redundant push button. I am trying to funnel every user input through the remote control, including setting the time and the alarm.

Regarding the cost: the parts, PCB included, would run between US$60 (digikey) and $75 (sparkfun).
Title: Re: Life Clock
Post by: zooto68 on May 13, 2009, 01:17 am
I see. Nice project by the way.