Shop OBEX P1 Docs P2 Docs Learn Events
Binary clock — Parallax Forums

Binary clock

Jeff DegeJeff Dege Posts: 85
edited 2006-03-09 00:41 in Robotics
After fooling around with the Pocket Watch B, I thought I'd make a binary clock.

This uses a 5x7 LED display to display the time as binary values. Leftmost column is months, then days, hours, minutes, and seconds.

There are two buttons that are used to set the time. First button selects the column, the second increments the value in that column.

The LCD is a UJ2041-21 I picked up from Jameco (Cat #335290). The LCD is driven by a MAX7219 - the wiring is straight out of Nuts&Volts #70. The Pocket Watch B came from Parallax, and it's wiring is straight out the datasheet.

The code is attached.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-06 02:07
    Jeff,

    · Neat display...Although I must admit I am having a little trouble following the seconds since it seems to jump to a number high than allowed, but maybe you've set it up like that to handle the missing column?

    ·· Also I find it interesting that the breadboard you laid this out on is the same setup as I laid my binary clock out on when I ran out of room on the PDB (Don't ask).· =)

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jeff DegeJeff Dege Posts: 85
    edited 2006-03-06 02:45
    Higher than allowed?

    Highest value displayed, except when in setting mode, is 59. Then it rolls over to 0.

    In the GIF, it starts out at 32+16+8 = 56. When it increments past 59, it resets to 0 and the minutes column increments from 16+2=18 to 16+2+1=19. Of course, after the GIF gets to 3/5 10:19:04, it loops back to 3/5 10:18:56

    There are a lot of LEDs that aren't really used. Seconds and minutes only need six, hours and days need 5, months needs only four.

    In setting mode, I blink the top LED in each column in turn.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-06 02:50
    Okay, if the last column is actually both seconds digits, then what are the other 4 doing?· I am just trying to get a handle on the layout of the binary patterns.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jeff DegeJeff Dege Posts: 85
    edited 2006-03-06 04:36
    The columns are, from left to right, months, days, hours, minutes, and seconds.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-06 15:16
    Jeff,

    ·· It makes a lot more sense now.· =)· Very nice.· Are you planning on putting it into a more permanent enclosure?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jeff DegeJeff Dege Posts: 85
    edited 2006-03-06 15:57
    Not as-is.

    I'll be swapping the Pocket Watch for a DS1302, so I can add a backup battery.

    And as it is now, it draws too much current to be useful as a battery-powered clock. It's running off of 9V through a 7805, and it's drawing 40-50 mA. Which means roughly three hours life on a battery.

    I'm thinking about replacing the 7805 with a charge-pump DC-DC converter, so I can run it off of a pair of AAs, which would have a lot more mAH. But even then, I may have to put in a sleep mode, so the display is only powered when needed.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-06 20:39
    Jeff,

    ·· The DS1302 is my personal favorite...Along with a backup battery you will be able to back up other data in the DS1302 RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jeff DegeJeff Dege Posts: 85
    edited 2006-03-06 20:45
    BTW - I looked at your "binary clock" project.

    And I can see the source of your confusion. The hackers clocks you'd copied weren't binary clocks, they'd be more correctly called BCD clocks. So naturally you expected one column per decimal digit.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-06 20:52
    Interesting view...The fact that the time is displayed in binary inherently means that any clock showing a binary display would still be a binary clock.· As you see from mine though, I am also displaying in Decimal and including the date information as well as the temperature on an LCD.· So you really get three different displays in one project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • John CoutureJohn Couture Posts: 370
    edited 2006-03-09 00:14
    Hey guys, how about adding a module to get the time from WWVB?

    Her is an analog clock movement but with a WWVB receiver in it (about $14)

    http://www.klockit.com/products/dept-159__sku-AAAAH.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-03-09 00:25
    · Parallax·used to have/stock an item just like that, JC.· I think that it was dropped more than a few years ago (sales were less than brisk.)
    · Wonder what's the "hackability" of the Klockit unit.
    · GPS time is pretty easy to get.

    ** Edit Addendum **
    Sorry, Jeff, we shouldn't hijack your thread/subject.·
    My apologies.

    Post Edited (PJ Allen) : 3/9/2006 1:10:52 AM GMT
  • John CoutureJohn Couture Posts: 370
    edited 2006-03-09 00:41
    yes, but GPS's units need a clear sky view, active antenna and generally cost quite a bit more (grin). Clock movements, on the other hand are designed for inside use and a while back that company had a special going for less than $7.

    The trick is to get timing down. I haven't done it yet but it would seem it would be a matter of getting the signal then measuring the carrier. A full time message is very slow (1 minute) .... someday I'll tackle it. In the mean time, I'm also thinking about making a binary clock for a friend.

    Description of Time Code Format
    http://tf.nist.gov/stations/wwvb.htm

    Graphic
    http://tf.nist.gov/stations/wwvbtimecode.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
Sign In or Register to comment.