Mini Dotclock

18,334

16

28

Posted

Introduction: Mini Dotclock

An array of LEDs randomly changes patterns every 10 seconds or so. To read the time, simply count the number of dots per digit. The main pic shows the time, 22:11. Different colours are assigned to different digits, red-10hours, amber-hours, green-10minutes, blue-minutes. Using 3mm superbrights means the clock can be read daytime or night (though it'd be washed out in full sunlight).
Having a random pattern is a lot less distracting than having numeric digits staring at you...this would also be a great project for adding to the front or size panels of a PC mod.

Step 1: Overview

This project was inspired from the TixClock device I saw being advertised at ThinkGeek. That was a little large for my application, I wanted a clock above my DVD because it didn't display the time when playing a DVD.
The design is based around the case, a low profile 'display' case from Jaycar Electronics (www.jaycar.com.au) catalog number HB6083. If you want to put this clock in another case, you'll have to modify the PCB layout.
A zip file with sourcecode, pcb files in EagleCad format and some pics is included in the project.

Some tracks are a bit narrow and have very little clearance. I built this using press-n-peel film, so it can be done....just take a little care not to smudge things and carefully check the result, scratching out any blurred tracks that might be touching another.

The PCB is designed for two layers, however I constructed this on a single sided board to save effort. There are only a few tracks on top, and these can be dealt with by using hookup wire. Note the picture is a little different from the PCB design in the zip file. The changes were connecting the enable pins of the 74hc154 chips directly to ground and an extra diode to step down the voltage across the supercap to make it closer to the 3.3V required by the RTC chip.

Some handy hints when doing double sided board using single layers is to:
- do as much trackwork on the bottom side as possible
- when laying a track on top, always take it to a via, rather than connecting the top layer track directly to a component.
- when using press-n-peel, print out the silkscreen (in reverse) and iron this to the PCB after drilling and etching. This not only gives you component placement, but if you print the top tracks out as well it is an easy guide for hookup wire. Note the black lines in the PCB below....these would be where the top layer tracks would be.

Step 2: Front Panel Design

A handy trick for cool looking front panels aligning with your PCB layouts is to print an image of your silkscreen, then edit out any non front panel items. In this case I have kept only the LEDs. The image was edited in a photo editor and text added. Using a photoprinter you can get colourful designs (although the colour scheme is a bit minimal in this). The LED holes were cut out with a sharp knife and some tracing paper added to the back to diffuse the light a bit.
My little photo printer created prints a little too narrow to fit the entire case, so a little strip was added to fill it out. It looks OK in this case because the front panel is so minimal.

Step 3: Control Switches

You need to be able to set the time. I used three microswitches I salvaged from an old stereo, mounted them to a bit of veroboard (or stripboard) and gummed the switch assembly using hot glue to the case.
The first switch selects the time set mode, the second selects the digit and the third increments the digit. After changing the time select the first switch again and the clock will run.
The ribbon cable from the switch has 5 lines, vcc/gnd and the three switch inputs. Each switch is momentary closed. On size connects to ground, the other to the switch input line and a resistor pullup to vcc. In other words the inputs are normally high, then pulled low to activate. See the schematic for details on the wiring.

On thing that was useful in using veroboard was that the board itself because the drilling template for the switch holes. Small holes were drilled in exactly the right positions, then squared out with a file. It made a nice fit.

Step 4: Final Assembly

The PCB was designed specifically for this case, so simply slid over the mounting posts. Because space was very tight, the switch assembly was soldered directly to the PCB and a piezo buzzer hot glued to a chip. If you want a louder piezo you'll have to add a driver as this is driven directly from the microcontroller. You really do need to glue or fix the piezo to something in oder to increase the volume.
The power supply lead was tied around the bottom mounting post as a strain relief. I've just pocked it out the mounting holes, but you can use a proper grommet if necessary.
That's about it really, the device is powered from a 9V plugpack and sits above my dvd player merrily changing patterns.

Step 5: About the Firmware and Supercap Backup

This firmware was designed with the Sourceboost compiler and uses the Sourceboost I2C library to talk to the RTC chip. I had to modify the i2c driver to use longer delays in order to get reliable operation.
The firmware initialises io, then reads the every ten seconds or so (you can modify this in the code if you want a quicker update or random update times. I found this period to be the least distracting). If keypresses are detected then it goes into the clock time change routine until exited with a press of switch one.

Also in the design is a space for a supercap. I haven't tested this, but installing one should allow the clock to handle power outages for a short period of time.

In the firmware once the RTC data is read, a routine takes the digit values and assigns a random selection of active LEDs to that digit, the same number as the digit value. These are kept in a table. An interrupt routine takes one value out of the table at a time and sends them to the LED driver chips, and an LED is lit (actually two, one per chip). Next entry to the routine gets another and so on. When run fast enough the LEDs active in the table all appear to be lit at the same time. You can change the timing of the interrupt routine to make it faster if you like.

Have fun, and if you build one of these into something cool...send me a picture.
Philip Pulle
www.rgbsunset.com

Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Spotless Contest

      Spotless Contest
    • Science of Cooking

      Science of Cooking
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    28 Comments

    i just lost all i wrote uhhhhhh i had an idea for you to make a diffuser. i made the linux leech that i found on here, and i was going to use a cd cover for a case. i cut it to size using a utility blade and a piece of wood and a hammer ( score the plastic reeealy deep, place the score line on the end of a table and place the wood over the top of the line then smash the open bit with the hammer and it should brake clean off) i was sanding down the rough edges with some wet rub ( in the kitchen sink ) and i scratched the top of it a little accidently i didnt realise this till i finished. when i dryed it i saw what i had done ( there was a square line all along the edge ) i thought it looked cool and knowing how it was going to be treated ( like everything else i own ) it was going to get scratched one day, one big scratch dosent look very nice so decided to just keep scratching it, little fine scratches look way better than big ones ( i just dont recomend it for psp or phone screens and ipods have the same problem ) i did both sides and took it out of the water. it was looking like some frosted glass. i thought it was so good i left you a picture lol it makes the leds inside the hub shine allthe way around the outside, like a big ring. if you make a v2 of this i would say cd covers are the way to go for the diifuser instead of baking paper

    linux leech.jpg

    nice watch....this would be about the same complexity (not counting the mechanical trickyness of making it so small). You've got some sort of timekeeper...perhaps you could save money by not using an RTC and just clock the microcontroller directly off the watch crystal (pics can have two crystal oscillators or a seconday oscillator...look at pic datasheets for oscillators that connect to the timers).....Also the same sort of thing would be needed for the display, unless you have lots of i/o pins on the micro, you'd need a expander of some sort or a multiplexed display arrangement of the leds.

    user

    "perhaps you could save money by not using an RTC and just clock the microcontroller directly off the watch crystal (pics can have two crystal oscillators or a seconday oscillator...look at pic datasheets for oscillators that connect to the timers)." I just started thinking about that today for my nixie watch. I need to look at the datasheet, but I recall that the timer can increment while the pic is asleep, then wake the pic on interrupt. That would be a HUGE power saver. Just sleep the pic between interrupts.

    user

    the 16F684 has this on timer1

    It'd be great to see your results if you went this way. I went the RTC route because I was not getting accurate enough results on the main microcontroller oscillator with a 20Mhz crystal...maybe a lower frequency crystal is more accurate? In the code you see the display update routine being called from a timer interrupt, this isn't necessary and it can be just updated from a main loop, freeing up timer1 for timekeeping functions.

    user

    Picture

    LEDwSize.png

    Here goes an attempt at posting a cool little anim of my proposed dotclock. Had to edit the POV file to get the SMD LEDs to rotate right. Ive uploaded the eaglecad project file for this in my library....don't know how to make it appear here. However if you email me I'll post it over.

    microdot.gif
    user

    are they 0604 size? looks cool. I read the data sheet and realized the LCD driver wont work with LED because of its funny waveform. I thought I might be able to use a transistor on the common lines to make a DC system out of the AC waveform, but, sadly no.

    The LEDs are actually 1206......I've had another pass at the design after downloading a few clock designs from Microchip,.....looks like putting a 32.768 kHz XTAL on the timer pins is OK...just need to pick the right load caps. I've re-done it with a more efficient 6 line charlieplex configuration (instead of 8), but haven't got around to routing this new cct. On the rear I I have pads for switch connections and the mcu....not too sure to do with the battery yet. I'm thinking two 3V coin batteries. Incidentally...did the gif animation work out OK...you may need to go to the image page and download the full size pic original.

    user

    I downloaded the GIF and it displayed right. Cool animation. Do you hand solder SSOP? I'm doing my first surface mount (SOT-23 and SO-28) soldering on this project. I'd like to do SSOP, but the pads seem to be less than 16mils. I think I need to make a few boards at 16 mils first before I try something even smaller.