• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

K8LH Novelty Single Chip Clock

Status
Not open for further replies.

Mike - K8LH

Well-Known Member
Thread starter #1
Hi Guys,

After designing this single chip Charlieplexed 24 hour Clock/Calendar/Timer well over a year ago, I finally found some time to prototype it and it seems to work pretty well.



The Charlieplexed display uses direct I/O drive on the segment lines and this limits 'peak' and 'average' current and display brightness. I'm using relatively efficient displays but the display is by no means "full brightness".

Software was written using the free/Lite version of Sourceboost BoostC.

I'm using a four push button "diamond" configuration to control everything. The buttons are fully debounced (both press and release cycles) and there's a short switch press beep through the piezo speaker for positive feedback. The Left button is used to toggle between "display" mode and "set" mode. The <up arrow>, <down arrow>, and <right arrow> buttons perform different tasks depending on whether you're in "display" mode or "set" mode.

In "display" mode, pressing the <up arrow> or <down arrow> buttons cycles the display between the 'Clock', 'Timer', 'Calendar, or 'Display Off'. Use the <right arrow> button to toggle a function associated with the current display on or off. For example, pushing the <right arrow> button while displaying the 'Clock' will toggle the display between local time and UTC. Pushing the <right arrow> while displaying the 'Timer' will toggle the Timer on and off (the red timer LED indicates Timer on/off status). Currently there is no <right arrow> function for the Calendar display.

Press the "set" button to enter "set" mode to edit the current display data (Clock, Timer, or Calendar). The left most display group (Hours/Months) will flash at a 2 Hz rate. Use the <up arrow> and <down arrow> buttons to increment or decrement the display group. The group values will roll over from upper limit to lower limit, or vice versa. Use the <right arrow> button to move to the next display group to the right. When you're at the right most display group, pressing <right arrow> again will move you back to the left most hours/months display group. When finished editing press the "set" button to copy the edited data back to the source (Clock, Timer, or Calendar).

Check for source code updates here; LED_Clock.c

The displays are non-multiplexed common anode type. The NPN transistors are 2N3904. The NPN base resistors are missing on this prototype but should be between 500 and 1000 ohms.

Regards, Mike
 

Attachments

Last edited:
#2
Do you really need the base resistors? At nominal voltages MCU pins drive LEDs pretty well.
 

BeeBop

Active Member
#4
Mike, this sets the standard for what a project should look like. Nicely done, nicely documented, with all of the parts in place.

Well done! :D :D :D
 

Mike - K8LH

Well-Known Member
Thread starter #5
I'm pleased with how well the project turned out but I can't say that I presented it or documented it very well (not a proper schematic, no BOM, etc.).

If I had time I would try to do a more professional presentation like Bill (Blueroom) does in his manuals.

Mike
 
Last edited:
#6
Good looking Clock

Hi all.

Digital clock looking good, I would like to build one just for fun. Could someone look at my drawing and tell me if anything is missing. Also please tell me how to connect timer relay, I'm not sure how to connect it. Disregard arrow keypad I forgot to put in my drawing.

Below are parts that I'm planning on using. If someone has part# for seven-seg display please share. Thanks

Quantity Description
1 16F88
7 BJT_NPN, 2N3904
6 SEVEN_SEG_DECIMAL_COM_A_GREEN
5 LED_green
1 CRYSTAL, 16MHz
1 Small speaker
1 RELAY, 9001-05
2 22pf caps
1 680 omhs resistor
 

Attachments

Mike - K8LH

Well-Known Member
Thread starter #7
Hi sananh,

Your schematic is incorrect. Charlieplexed or N(N-1) type multiplexing is very different from standard multiplexing. Please see attached drawing below. Yes I know it looks like a wiring nightmare (grin)...

As for RA2 relay control output, that is up to you. RA2 is an active high output which can drive an NPN or N-channel MOSFET transistor as a sinking driver to activate a 5v or 12v relay. You wire relay output pins in series with AC or DC voltage source and the load. !!! Please be careful !!!

Best wishes. Mike
 

Attachments

Last edited:

3v0

Coop Build Coordinator
Forum Supporter
#9
I am a little confused. The schematic shows base current limiting resistors on the 2N2222A transistors that power CA (common annode) digit pins. The wired board does not.

My 7 seg displays are too dim with base current limiting resistor of 100R. The base current is 3.6mA without a resistor. Do you think it is OK to run without the resistors or should I start looking at even smaller values? They are so dim you have to view them in a room with the lights off with a 1K base resistor.

I am thinking the since the pic can easily handle the 3.6mA there is no downside to not using resistors here.

EDIT: The value of 3.6 mA was taken with the display muxtiplexing. That means the current while it is flowing is about 3.6*6 or 21.6mA which is much closer to the 25mA max. I need to do an actual measurement but will wait till morning. But I am less comfortable about not using a resistor. Back to bed :)

These are displays are surplus units from electronic goldmine and I can not find a real datasheet on them. I have found this
This is a yellow two digit seven segment LED display with two decimal points. It is marked at one side as QDSPK347. The voltage drop at 20 mA is 2 Volt (per segment).
 
Last edited:

Mike - K8LH

Well-Known Member
Thread starter #10
Hi 3v0,

I'm not using base resistors on the 2N3904 transistors or current limiting resistors on the LED segments on this prototype.

The 0.4 inch Fairchild displays I'm using provide decent brightness in a well lighted room but you can tell they're not full brightness. Some 0.56 inch Fairchild displays that I tried were noticeably dimmer. So, getting good results with this novelty one chip design depends a lot on your choice of displays.

I would be happy to post a much better 2 chip Clock design, if anyone is interested. It uses standard multiplexed display wiring and provides full brightness with PWM brightness control using an 8 bit serial-to-parallel sinking driver IC like the TPIC6C595, MIC5821, or A6821 (or an 8 bit serial-to-parallel constant current sinking driver like the A6275).

Mike
 

Attachments

#14
Personally I'm one of those types who tries to match the crystal frequency to the task at hand. Using the generic 4MHz or multiples thereof for everything always baffled me, after all crystals are about the same price and there are many common frequencies available. 19.6608MHz is a handy for both RTC & UART stuff.
 

wy6k

New Member
#15
Just use current limiting resistors on the segment lines and connect the transistor collectors to 12 volts and you can have whatever brightness you want.

If you want to keep it a one power supply project, use 12 volts as the power supply and generate the 5v with a voltage regulator (7805).

Mike
 

Mike - K8LH

Well-Known Member
Thread starter #16
Just use current limiting resistors on the segment lines and connect the transistor collectors to 12 volts and you can have whatever brightness you want.

If you want to keep it a one power supply project, use 12 volts as the power supply and generate the 5v with a voltage regulator (7805).

Mike
Hi Mike, WY6K,

Keeping in mind the 5v PIC pins, an NPN/PNP pair or N-FET/P-FET pair for the high side drivers does indeed work well with traditional multiplexed displays but it's a bit problematic for Charlieplexed displays.

Regards, Mike, K8LH
 

Mike - K8LH

Well-Known Member
Thread starter #17
Personally I'm one of those types who tries to match the crystal frequency to the task at hand. Using the generic 4MHz or multiples thereof for everything always baffled me, after all crystals are about the same price and there are many common frequencies available. 19.6608MHz is a handy for both RTC & UART stuff.
Unfortunately, that's about all that crystal frequency is good for (grin).

Using wierd crystal frequencies always baffled me but if you can show me how to accomplish any operation in exact 1 usec increments using one of those crystal frequencies then you'll have a convert (grin)...
 

Pommie

Well-Known Member
Most Helpful Member
#18
I can see how a 19.6608MHz crystal is good for serial communications but how is it any better for a real time clock? :confused:

Mike.
 
Last edited:
#20
Hi Mike, WY6K,

Keeping in mind the 5v PIC pins, an NPN/PNP pair or N-FET/P-FET pair for the high side drivers does indeed work well with traditional multiplexed displays but it's a bit problematic for Charlieplexed displays.

Regards, Mike, K8LH
Ahhh. I see that now. In that case, you need another set of column transistors and invert the logic on the n-1 line? (I'm not really familiar with Charlieplexing, but I think I get it). MPU output drives base of NPN which pulls down the base of the PNP with it's emitter connected to 12 volts. Right?
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading

 
Top