A. PREFACE
Square clock inspired from combining between my static clock and my digital clock version. Using big seven segmen leds display for digit numbers and leds indicator for another visual number. This design could be found also on the net like some on Godier electronics site. In fact that, the original inspired idea come from elektor books some years ago. But to build the clock, it takes so many components, because the circuits itself build in pure electronics components. So now the idea become real. I plan to use PIC microcontroller also like the other of my clock design. May be the overload not to much, because it takes from a part that already done creations. While I have a few days spare time on these National day Idul Fitri 2009, a week vacation days. May be the project could be done!!!
B. SCHEMATIC
The circuit using PIC16F84/A or PIC16F628/A types. Some part is from Static Clock design, and some part from PIC Digital Clock design. Hours part display indicator, using led display, and minutes and seconds part are shown by 7-segmen display indicator. Seconds part always change continuously. Option for AM/PM display sign now is available also. First the design only to display time as a clock, but as the idea roll on then I add the calendar function too. Because the field is a little beat the same. For this calendar function, I add the sign indicator too. Both AM/PM indicators and calendar indicator, taken from the 4-16 line decoder. 12 already used for hours or months indicators. The rest take it function as purpose. The rests are no need explanation, just looking for the display view.
Square Clock schematic are like this (Square_ClockS.sch, Square_Clock_Schematic.pdf).
C. LAYOUT
I already design the PCB for this square clock. Not very much work, since it can be re-work from PIC Digital Clock project design with a little modification. All the chip loads in one PCB, minus the leds display indicator. All leds display indicator put on the clock body itself. The board already tested and could run well. Connection are made directly from flying wire connections. Some changes where made since my first design, so not all the components were mounted on the PCB. Some components just soldered at the position. As I added the option later and after, the layout maybe a little different from the photos.
D. PART LIST
Here are the part list for this clock circuit :
1. Resistors :
R1 ~ R7, R14 ~ R25, R26 = 220 Ohm, 1/4W, 5% ............... 20 pcs
R8 ~ R11 = 2k2, 1/4W, 5% ................................... 4 pcs
R12, R13 = 10k, 1/4W, 5% ................................... 2 pcs
R27 = 1k, 1/4W, 5% ......................................... 1 pcs
2. Capasitors : C1, C2 = 22 pF (for oscillator) ............................ 2 pcs C3, C4 = 100 nF (for IC decoupling, used as necessary)...... 2 pcs C4 = 100 uF/16 V ........................................... 1 pcs C5 = 1000 uF/ 16 V ......................................... 1 pcs
3. Semiconductors : IC1 = PIC16F628/A (PIC microcontroller) ................... 1 pcs IC1 = PIC16F84/A (optional PIC microcontroller) ........... 1 pcs IC2 = 74LS247 (BCD to 7-segmen decoder driver) ............ 1 pcs IC3 = 7805 (Voltage regulator) ............................ 1 pcs IC4 = 74HCT154 (4 to 16 decoder driver) ................... 1 pcs Q1 ~ Q6 = BC558B (universal PNP transistor) ................ 6 pcs D1, D2 = 1N914 (Silicon diode) ............................. 2 pcs BD = 1N4007 (Silicon diode) ................................ 4 pcs LED1 ~ LED12 = 5mm, Blue (Clear type) (for hours ind) ..... 12 pcs LED13 = 12mm, Red/Grn (Clear type) (for AM/PM ind) ......... 1 pcs 7-segmen display common anode red (big type = 1.8 inchi) ... 4 pcs
4. Others : X1 = 4 MHz (Clock Crystal oscillator) ...................... 1 pcs Optional IC socket for 18-pins (use 20-pins) ............... 1 pcs Optional IC socket for 16-pins ............................. 1 pcs Optional IC socket for 24-pins ............................. 1 pcs Optional terminal connector CON1, CON2 = 2 pin (power) ..... 2 pcs Optional terminal connector CON3 = 12 pin (sip) ............ 1 pcs Optional terminal connector CON4 = 4 pin (sip) ............. 1 pcs Optional terminal connector CON5 = 7 pin (sip) ............. 1 pcs S1 = Miniature push button (Push on) ....................... 1 pcs PCB = 5 x 10 cm, 5 x 16 (single layer) ..................... 2 pcs T1 = Miniature transformer P=220V/S=9V, 100mA, 1W .......... 1 pcs
E. FIRMWARE
The firmware not too much different from my PIC Digital Clock design. Only the hours part and buttons function need to re-work. Hours displayed using leds indicator, while minutes and seconds displayed using 7-segmen display. All 7-segmen display are multiplexed. As already mention before, for this PIC type, I programmed it with my_rcd_programmer, I got it from RCD programmer site. Using a free software from DL4YHF's WinPic - A PIC Programmer for Windows, the chip could be programmed well. The firmware write in ASM type, compiled with the free MPLAB assembler compiler also.
Expandable the function of this clock, I plan to add a calendar too. I think that it could be done. For the months, it related to hours indicators; for the days, it related to minutes display; and for the years, it related to seconds display. Clock and calendar will be displayed at interval time each other (say it about 10 seconds for example). For a moment time it displayed a clock time, and for another moment it displayed a calendar. I still working on it!
At last, the firmware for both option; clock and calendar could be done. Setting the time and calendar still using the existing button, just one. The firmware become a little complex, because it must handle both function for the same variables. I always have the principle that everything I make later must have some added value from the original design. If it doesn't then it's no worth. So better to describe the algorithm a little :
- As usual the interrupt occur every 1024 msec.
- Refresh rate rotate between every variables here, 6- positions : 2-digit minutes indicator, 2-digit seconds indicator, hours indicator and AM/PM indicator. For calendar option, it match the purpose : 2-digit days indicator, 2-digit years indicator, months indicator and calendar sign indicator (dot).
- Every 1 sec. count then update the RTC. Check the button pressed.
- If button pressed, save the state, time mode or calendar mode, increment the setting. For time setting; minutes first and then follow by hours. For calendar setting; days first and the months. Every one round then increment the years. So it may be a little difficult to set the calendar if the correct setting already elapsed. Better to power down first and remove the back up battery, so the default calendar setting back to 20 Oct 2009 - 12:00 AM (time stamp when this clock were created).
- When the function in run mode, time and calendar will change one after another as the time interval. I set it about 13 seconds, so the numbers display will be more variety.
- How to read the time or calendar? You will learn it!!!
Here is the firmware : Square_Clock (Square_Clock.asm, Square_Clock.hex, Square_Clock2.asm, Square_Clock2.hex).
F. PROTOTYPE
Here is my prototype clock looks like. The size about 25 x 15 x 4 cm. I made the box from multiplex. As a tips, maybe a photo frame is another good choice. But its a little difficult to find a perfect size for the displays. I can't find a perfect one, so I made it by myself. Not quiet good, but its ok for me!
G. IMPLEMENTATION
Here are a few pictures of my prototype implementation. I plan to put it besides the other weird clocks. So I can enjoy the visual performance of each clock
- Development phase view (video_1.3gp), see the changer from 12:00-AM to PM time. New time changer set to 13 seconds.
- Running phase view (video_2.3gp), the time changer still in 12 seconds, see the changer between time and calendar display.
H. HOW TO READ
Someone always ask, how to read the clock?See, the blue leds around the square represent hours or month count form 1 to 12, depends on location from usual clock position. 2 digits 7-segmen left side represent minutes count from 1 to 59 or days count from 1 to 28, 29, 30, 31 depends on the month, and 2 digits 7-segmen right side represent seconds count from 1 to 59 or year count from 2000 till 2099 year. Bi-color led below 12 o'clock number represent AM/PM time, depends with the color light, first color represent AM time and second color represent PM time. Clock and calendar will be displayed about 13 seconds in turns. eg: the left picture above show calendar mode, the date is : Oct 18, 2009, and the right picture above show clock mode, the time is : 11:55:28 - AM. Time or date adjustment depends on this range turn. It took a little time to learn the adjustment feeling. Button response time about 1 sec for a slow increasing count.
No comments:
Post a Comment