+ Reply to Thread
Results 1 to 18 of 18

Thread: Binary Digital Clock

  1. #1
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default Binary Digital Clock

    Hello Everyone!

    There have been a few people waiting patiently for me to finish this project and get it uploaded. Thanks for your patience! Working for Parallax is the greatest job I’ve ever had, but sometimes you devote yourself more to other projects than your own. Eventually I get around to finishing some of these projects and post them here for our customers to use and enjoy.

    You’ve probably seen some of the “Hacker” clocks floating around the internet (eBay, ThinkGeek.com, etc.). These clocks display the time in binary format, the native language of a computer (Based on 1’s and 0’s). The time is shown using LEDs instead of 7-segment displays. Ever since I got mine people have asked me what it’s displaying, and some don’t even believe me when I tell them it’s the time in binary. I told a few people I was going to build a binary clock that also showed the “normal” time, so that people could see the relationship between the two formats and hopefully understand it better.

    When I started this project I already knew I was going to be using certain parts. All parts are available from Parallax. The original design used pushbuttons, but I couldn’t seem to make everyone happy with the button configurations. So if you want the ability to set the clock manually, you will have to write a routine and implement your own input device, such as push-buttons to do so. Please feel free to share this information with other users as more people may like your individual ideas. For now you can set the clock by using the DS1302_Demo.bs2 file. This is designed to help people understand the DS1302, but I used the same I/O lines so the code is compatible and allows you to use the DEBUG Screen to set the Date/Time. The DS1302 should be battery-backed anyway, so this shouldn’t be a problem. As a final note, I do have a BS2p version of the clock using an Optical Rotary Encoder with a push-button. This allows me to set everything with one input device. The code needs a lot of work to be User-Friendly though, so I will release that later.

    Since I already intended to use the DS1302 for timekeeping, I decided I might as well make use of the Date information available to me as well, and so a Parallax 2X16 Serial LCD Display was added to show the Day, Date and Temperature. The Temperature idea was added when I realized I had a lot of free space on the LCD, and could add the DS1620 using only 1 more I/O line. This also makes another point in that the DS1302, DS1620, MAX7219 and all three 74HC595s are all sharing the same Data and Clock lines. This saves a lot of I/O pins compared with them each using their own, and demonstrates one way to consolidate I/O lines. Another feature demonstrated here is shared variables and constants. By sharing I/O lines, we can also have some common constants. And for variables, we can re-use many of them. Variables are conserved by re-using the same variables in many routines where the information needs to be retrieved and displayed and then it is free to use for reading the next device in line.

    So now what we have here is a “Super Hacker Clock” with extra bells and whistles, including selectable hourly chime and 12/24 hour mode support. In 12 hour mode the AM/PM indicators light up. In 24hour mode neither LED will light up. J1 selects the hourly chime. If J1 is closed, every hour on the hour, there will be an audible beep. If J1 is open, the chime (beep) will be disabled. The neat thing is that everything is customizable. After all, we’re using the BASIC Stamp, aren’t we? So we may choose not to implement an hourly chime. We may also choose to lock the time into 12 or 24 hour mode, or we may choose to set it using our input device. The point is you can always change things if you don’t like the setup. This project is designed to be customizable.

    The code and schematics are believed to be accurate and error free, however neither Parallax, Inc. nor I accept any responsibility for the results of using the data presented here. It is intended as both a learning tool as well as enjoyment. It is my sincerest hope that you benefit from the information provided. Please post any comments, code suggestions, error/bug reports or pictures of your own implementations here on our forums.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    Attached Files Attached Files
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  2. #2
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    Okay, here are some pictures of the Binary/Digital Clock. These are a few from all of the ones I have taken so far. Later when I mount this in a cabinet I will post more pictures. For now here are the more informative ones.

    1) This was the first prototype. Notice I still needed more LEDs than the PDB had, but I chose to use the 7-Segment Display anyway and ignore the lower seconds digit. You may also notice the LCD was formatted differently.

    2) This one is a little blurry because I was trying to capture the backlight for the LCD. You can see the LCD is formatted differently now, and I added an encoder during testing. If you’re wondering by now why my LEDs on the PDB are different colors than what we have for sale, it’s because the PDB was a prototype too! =) Using a prototype to build a prototype.

    3) By now I had decided I wanted to see what my 1” 7-Segment Displays would look like, as well as the 10mm LEDs for the Binary section, so I moved it all to a Jameco Breadboard. All the main control circuitry is still residing on the PDB.

    4) Here is a close-up of the LCD Display.

    5) Here is a close-up of the Breadboard with the 1” 7-Segment Displays and the 10mm LEDs. I had to adjust the resistors for each color of LED since they all have different forward voltages and current draw. That was fun. When looking at the 10mm LEDs for the Binary section, it might help to picture each color group rotated 90 degrees counter-clockwise. That’s how they will be in the final unit. Unfortunately because of the way the breadboard was I had to orient them in this manner, but it’s very un-intuitive for reading that part of the display. I’m used to it now, but it throws my wife and kids.

    Now might also be a good time to mention too that originally I had 3 colors of 7-Segment Displays as well. But I learned something about these, especially with the way the MAX7219 controls the current. The yellow was really dim. The green was not too bad, and the Red was perfect, but in the end you should probably use all one color. I know I will be. The angle makes it hard to see, but the colons and AM/PM indicators were nicely lit. They will vary in brightness with the 7-Segment Displays, however the 10mm LEDs are connected to 74HC595s, so they won’t. This only affects things if you want to be able to dim the display. Comments are welcome.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	01_First Prototype.jpg‎
Views:	1747
Size:	96.2 KB
ID:	39056   Click image for larger version

Name:	02_Later Prototype.JPG‎
Views:	1385
Size:	64.6 KB
ID:	39057   Click image for larger version

Name:	03_Final Prototype.JPG‎
Views:	1611
Size:	76.3 KB
ID:	39058   Click image for larger version

Name:	04_Close-Up Of LCD.JPG‎
Views:	1670
Size:	44.4 KB
ID:	39059   Click image for larger version

Name:	05_Close-Up Of Main Display.JPG‎
Views:	1948
Size:	72.9 KB
ID:	39060  

    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  3. #3

    Default

    Cool project Chris!

    I'm used to looking at binary with the LSB on the right, but left works also.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  4. #4
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    Beau,

    Actually I covered in the text how the LSB is supposed to be on the bottom, and that the displays would normally be rotated 90 degrees counter-clockwise. You'll see in the final build. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  5. #5

    Default

    I agree with Beau. LSB on the right... kinda like the way most of us read decimal numbers too.
    Now, how 'bout the temperature in binary as well?

    Nonetheless, nice job there Chris!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  6. #6
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    Rusty,

    Thanks. For everyone wondering, the final product, mounted in a cabinet will have the Binary Display configured vertically, just like my desktop Binary Clock from ThinkGeek.com with the LSB at the bottom. See the following link for a picture.

    http://www.thinkgeek.com/cubegoodies/lights/59e0/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  7. #7

    Default

    That's a good looking project. OK, I'll admit it - I'm jealous that your clock project is working but mine isn't finished yet.

    Why is it that no matter how big your breadboard is, your circuit will quickly expand to fill all available space?
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  8. #8

    Default

    You must be left-handed Chris
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  9. #9
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    Sort of...I'm ambidextrous...In the sense of using both hands, anyway. =) Why do you ask? I hope you find the information presented to be useful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  10. #10

    Default

    I was referring to the LSB on the right comments. :)
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  11. #11

    Default

    I think I saw Jennifer Garner defuse one of those on Alias...
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  12. #12

    Default

    Chris, I see you used 7 segment displays. I am building a clock but it uses the month day year hour and min. I use common anode 7 segment displays. Can you expand the clock using 7 segment displays to include the year day of the month and then alpha numerics to show the first three letters of the month? How do I increase the brightness of my led displays?
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  13. #13

    Default

    Really cool Chris, by the time I finished getting the time computed in my head - it would be a different time.

    Think I'll stick with Mickey Mouse!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	images.jpg‎
Views:	3629
Size:	3.1 KB
ID:	49975  
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  14. #14
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    MR,

    The date/day information is available on the LCD. You could use 16-segment displays to get alpha characters for the day, kind of like the setup of the dash panels in Back to the Future. Increasing brightness depends on the displays. The MAX7219 I used has a brightness adjustment internally via software as well as an initial hardware setting determined by a resistor.

    Whit,

    No need to computer the time…Just look at the digital part of the display. This clock caters to everyone! =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  15. #15

    Default

    Chris Savage (Parallax) said...


    This clock caters to everyone! =)
    So simple, a caveman (like Beau or me)could use it!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  16. #16

    Default

    lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  17. #17

    Default

    hey chris i know this is an old fourm string but could post a brand new string on the BS fourm explaining what the MAX7219 and the other MAX chip's (its like 2....) schematics and then show a simple bit of code and what he circut would look like? maybe just use a LED matrix for testing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"

    Thomas Jefferson
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

  18. #18
    Parallax Engineering

    Chris Savage's Avatar
    Location
    Rocklin, CA
    Posts
    12,433
    Blog Entries
    8

    Default

    I think instead I will do a Savage Circuits TV episode on the MAX7219. I think it's about time for that IC to be demystified.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    Last edited by ForumTools; 10-01-2010 at 06:52 AM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts