Buy Products

Distributors

Categories

Maker Faire Bay Area 2012 Countdown Timer

Great news! The Call for Makers has been launched for Maker Faire Bay Area 2012. We're excited and apprehensive at the same time...the days seem to melt away in the months before Maker Faire. The Maker Faire site has a nice countdown timer, and we wanted to duplicate that so we could always keep an eye on the dwindling time. So we did it...in style! Check out the video below:

A big Betabrite LED sign (scored from Silicon Valley Electronics Flea Market) receives serial data from an Arduino. The Arduino is keeping track of the difference in time between now and 10:00 AM on May 19th, 2012. Since the Arduino by itself would quickly drift into the meaningless voids of time, we have a ChronoDot installed to keep everything precise. The very handy Time Library by Michael Margolis works as-is with the ChronoDot, and also provides some handy data structures to help do the necessary math.

Here are a few technical details:

The ChronoDot is wired to the Arduino on the following pins:

Arduino GND to ChronoDot GND

Arduino 5V to ChronoDot VCC

Arduino Analog 4 to ChronoDot SDA

Arduino Analog 5 to ChronoDot SCL

No pull-up resistors were installed since the Arduino Wire library already enables the internal pullups, which are OK for such a short I2C bus.

The Time Library works great with the ChronoDot since the DS3231 on the ChronoDot works the same as many other Maxim RTCs, like the DS1307 and DS1337. It's just way more accurate, especially in changing temperature. Between now and Maker Faire, we won't be more than 20 or 30 seconds off the real time. Simply download the Time library, and put the "Time" and "DS1307" folders in your Libraries folder within your Arduino sketch folder. Restart Arduino and it'll pick up the new libraries. Go to Sketch > Import Library... and choose the Time, DS1307, and Wire libraries. Don't forget to look under File > Examples > Time for some good hints on how to proceed.

The Betabrite sign was old and slightly damaged, but a great deal at the flea market for $20. The protocol is pretty complex, and doing something wrong can corrupt the internal memory and require a reset. However, a decent amount of information is available. Most of the protocol info in this document applies to the Betabrite signs: http://www.ams-e.com/Download_files/97088061E_lite.pdf

We don't need to worry about baud rate much, since the Betabrite will detect it. However, it does want a 7E1 serial protocol, instead of the normal 8N1 you get from the Arduino serial port. So we need to tweak some registers to get the correct protocol. Also, the LED sign expects standard RS232 voltage levels instead of TTL RS232, so we need a level converter. We simply threw a MAX232 and capacitors on a piece of proto board.

The idea behind the Arduino sketch is simply to get the Time Library running, synchronize to the ChronoDot, calculate the difference between the current time and a hardcoded time for the start of Maker Faire, and output that time to the Betabrite sign. Controlling the sign was a little less direct than it could be; the sign will shut off the display when you write a new text file, so instead we needed to allocate memory, define a string that can be called within the text file, and then update the string only. That allows the time to be updated as the message begins to scroll across the display.

Suggestions for improvement: detect when Maker Faire arrives and display an exciting message! However, we'll be there and will never see it, so it didn't seem worthwhile. I'd also like to attach PIR sensor so the display can be turned off when no one is around...alternately, it could shut down the display during timeframes where no one is likely to be nearby.

Feel free to suggest your own improvements in the comments, show off your own LED signs, or ask for help building something similar!

// this can be modified on the fly for dynamic output, it would think.
void sendText(){
for(int i = 0; i < 5; i++) Serial.write((byte)0x00); // auto baud rate
Serial.write((byte)0x01); // SOH
Serial.print("Z00"); // All displays
Serial.write((byte)0x02); // STX
Serial.print("G1"); // Write to string 1
Serial.print("Lunch has been canceled. Management will issue Red Bull and Power Aid at 12:45."); // this can be modified on the fly for dynamic output, it would think.
Serial.write((byte)0x04); // ETX
}