Count down timer for my soccer club

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi.
I'm trying to make a count down timer for my soccer club. I've got the count down happening with 2 x 7-segment led display, 4510s and 4511s (including a 32Khz crystal).

I'm having difficulty working out how to get the count from 00 to 59. I've put in a preset switch that sets to 59, then it counts down from there. However to automate it when it sees 99 I don't know how to tackle. Please can someone help.
 

Wendy

Joined Mar 24, 2008
23,408
I breadboarded a simple counter that was the heart of a 2 or 3 minute countdown timer. Maybe it can give you a few ideas.

It was on Sheet 3 I believe, been a few years since I worked on it.
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
Hi Chrischrischris, welcome to AAC.

So you press the preset button, the count goes to 59 and immediately starts counting down, correct?

When it reaches 00, it then goes to 99 and begins counting down again, correct?

You want it to go from 00 to 59 automatically?

May I ask why?

I am unsure why you want the clock to count down to 00 then automatically reset to 59 and count down repeatedly.

I designed a similar counter and fed the BCD outputs to an 8-input NOR gate whose output was connected to the reset pin of my clock IC. In that way, the counter stopped at 00 until the preset button was pressed. You could do the same thing but feed the output of the NOR gate to the preset pin. If you use a CD4078, you can select either a high or low output signal depending on the needs of the preset pin. This should force the counter to "reset" to 59 once 00 is reached.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Thanks Bill for the quick reply and the details to your count down timer.
I'm a bit of a novice on my breadboard and self taught. On the weekend I read up on NOR, AND, NAND gates etc to see how the signals were processed in the ICs. Your circuit scares me!

It seems to be on sheet 3 as you said, and "6 counter" I'm trying to figure out. There's an OR gate (I think you've made up out of 2 diodes and a resis, however I think you're using that to reset that digit. Correct? Pin 6, 11 and 14 are they going to multiplexers to obviously combine signals, however I haven't progressed to multiplexers. YO, X1, Mux Qa, Mplx A - bit foreign to me. Could you look at the link http://members.shaw.ca/roma/up-down.html and see if this can be adapted (as this is where I'm at).
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Elec_Mech.
Thanks for your reply also.
Yes, when I press my reset button on the breadboard circuit I've made, it resets to 59 and counts down from there (through 2 preset dip switches fed to pins 3,4,12&13 of the 4510s).

Currently I only have 2 digits I'm experimenting with - units and 10s. I've used 2 x 4510s and 2 x 4511s. It's the 4510s I'm fiddling with to try to "repeat count" from 00, 59, 59...01, 00, 59, etc (i.e. the forcing the "tens" to count between 0 and 5). Next I was going to attempt 2 more digits (the minutes - where I need to preset to 45 minutes).

There must be a "conventional way" of forcing one of the 4510s to essentially count from 0 to 5, 4, 3, 2, 1, 0, etc, but I don't know how - I'm trying to re-invent the wheel, and for a novice like me I'm struggling with my ANDs NANDs and NORs! Can you help. I've spend "days" with combinations and googling! I need it simple.
 

elec_mech

Joined Nov 12, 2008
1,500
Hmm, this is something I'll have to think about and research myself. I've seen clock circuits here that use logic ICs to reset 59 to 00 in the seconds and minutes and 12 to 1 in the hours, so I'm relatively sure something is possible in the reverse.

Allow me to pontificate a bit . . .
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Success!!! (I think).

I ended up using a 4025 tripple input. From the 4510 that displays the 10s, I was looking for a 9 in hex - (1,0,0,1) - from pins 6, 11, 14 and 2 respectively. I could use AB&D or AC&D through my 4025 to get a "high" which I would reset the 4510 with the preset (via 2 dip switches).

I used 1 of the 3 gates of the 4025, 3 pins linked together and stuck pin 6 to it (looking for a high to give an output low). I did the same on the 2nd gate with pin 2. I then fed both these to gate 3 as well as pin pin 11 (looking for low). 3 lows make a high! in the NOR gate. Signal sent to my preset on the 10s "load input" which grabs the combination 59 (0101 & 1001) via the 2 connected dip switches. Is this correct?

Can I assume that I can do the same "idea" with the minutes?
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi elec_mech (and Bill).

Here is a schematic I've just drawn up for the circuit I've done to date.

Down the track, I'd like to delv further into:
* Changing the 7 segment LEDs to multi leds (maybe 100 per letter)
* How to provide power to the leds (voltage regulators - I'm guessing here)
* How to create a selection switch to pick various preset times - maybe 2 for the minutes
* Resetting the timer and stop start with the timer
* Wireless operation (remote).

Hopefully I can wrack your brain down the track, then provide others with schematics for this project.

Chris circuit.pdf

Thanks in advance.
Chris.
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
Hey Chris,


Thank you for the schematic. A few recommendations:
  • Either use dots and no arcs or arcs and no dots, preferably the former. Arcs say "these crossing lines are not joined", dots say "these crossing lines are joined". You only need one or the other. It is much easier to read a schematic with dots.
  • You do not need to connect every Vcc and GND connection together. It is much simpler to use a GND symbol and a Vcc symbol of your choice for a few of those connections nearby. For instance, you drew the ground and Vcc connections together for the 4060 and 4027 and related components, but did not draw another line going to the 4510/4511 grounds and Vccs. This is good because it keeps the schematic clean and easier to understand. I recommend you do this again for the rest of the schematic, e.g., separate the Vccs and GNDs for the displays, 4511s and 4510s. Also, you don't need to put more than one GND or Vcc symbol on the same connection.
  • Try to stick with horizontal and vertical lines and avoid angled lines, especially across components. I understand you probably did this to get the schematic posted quickly and that's fine, but clean it up when you prepare your next updated schematic.
Overall I'm impressed with the looks of it, this is just some constructive criticism from lessons I've learned over the years.

Okay, now onto the circuit. You show the clock signal going to pin 1 of the 4510, but the datasheet shows pin 1 is the preset input, while the clock input is pin 15. You have pin 15 of both 4510s joined together and connected to a filtering cap, but connected to nothing else. Same case for pin 10 which is your up/down pin. Pins 10 should be connected to GND to count down. Your clock signal should go to pins 15.

I'm not real familiar with JK flip flops, so I'll let someone else look at your clock circuit. If it is working properly, then just double-check your schematic matches your circuit.

Good job with the pull-down resistors.

Add a 0.1uF capacitor across the nearest Vcc and GND connections for EVERY IC. This will help filter out noise generated by each CMOS IC.

The way you currently have your 4025 connected, a high signal will be sent on pin 6 whenever Q1, Q3, and Q4 are all low. This is good when the tens digit is 0, but it will also do this when the tens digit is 2. I'd still suggest using the CD4078 and connect it to Q1-Q4 of both 4510s. If you only connect to the tens 4510, then you'll end up resetting the count at 10 instead of 00.

* Changing the 7 segment LEDs to multi leds (maybe 100 per letter)
* How to provide power to the leds (voltage regulators - I'm guessing here)
Not hard to do, but we need to know:
1) Forward voltage and current of the LEDs you plan to use
2) Power supply you are thinking about using

Also note that if these will be seen with ambient light present, e.g., partial sunlight, indoor lighting, etc. then you'll want to add a filter to the front of the LEDs, such as a transparent tinted plastic sheet the same color as the LEDs. Look at an LED alarm clock. Most have red digits and if you look closely, there is a dark red tinted plastic cover over the LEDs to help filter light so you can see it when other lights are present.

* How to create a selection switch to pick various preset times - maybe 2 for the minutes
If you'd prefer to make it easier for the average user to select the digits, then you want a BCD switch made for 0-9. Like this: http://www.mpja.com/prodinfo.asp?number=18252+SW. This is a really cheap one, but it gives you an idea. They make these bigger and easier to use, but cost much more. They make one style that has a mechanical display of the digit being selected and a push button at the top and bottom to increment or decrement, respectively. Be careful to get one with 0-9 (decimal values) and not 0-F (Hex values).

* Resetting the timer and stop start with the timer
Add a momentary switch to the preset input of the 4510s to reset. Add a toggle switch to the clock input to pause and resume or use a momentary switch with a CD4013 configured as a T-flipflop to do the same thing. May need a transistor or MOSFET for the latter.

* Wireless operation (remote).
Easily doable by hacking a remote-controlled car toy. I did this about a year ago with a $10 toy and some components, namely a CD4093 and some transistors to account for the different operating voltage of the toy (vs. the circuit) and to remove debounce from the switches. Got four inputs, so you could use this similarly to reset, start and stop the counter and still have a fourth input for something else, perhaps to blank the display and save power without resetting the counter? You can also hack the remote itself and make your own remote enclosure and buttons if you want to add a level of sophistication or just not have it appear it as a cheap toy remote to your users. :)
 

russ_hensel

Joined Jan 11, 2009
825
For real flexibility consider a microcontroller solution, software is often easier to modify than hardware. The advantage of hardware is often found in speed. Here, compared to hardware speeds, your circuit can be very slow.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
For real flexibility consider a microcontroller solution, software is often easier to modify than hardware. The advantage of hardware is often found in speed. Here, compared to hardware speeds, your circuit can be very slow.
Hi Russ.
Your probably right and that was the first tact I was looking at taking. However I don't have the elec / programming background to go that way. When I found out about 32kHz crystals giving 1Hz timing, I though - to heck with it, this would be easier for me.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Elec-mech.
Firstly thanks tonnes for spending the time to answer my queries. I "really" appreciate it.

In answer to your reply, my background is Architect - so I have no elec background - I just like to have a "challenge" and to "fiddle" (and in this case help out our soccer club). The wiring diagram, yes I deleted the arcs - I think I saw them in a wiring diagram somewhere once (I think it was a machine 3 phase wiring diagram!). I've made the changes you suggested - dots only.

GND and Vcc circuit diagram simplified. Yes, I'm glad you pointed it out. I wasn't sure. I've made the changes and it looks much simpler.

Angled lines - I only did that to "highlight" the part of the circuit where I found out how to do the 59 reset. I've now straightened them.

As for the wiring, I can't believe how easily and well you read the circuit! Your right in all counts. I made mistakes in the diagram. Clock signal is not pin 1 but 15 as you said. GND to pin 10 is there but I forgot to draw it. The 4025 - I drew the wiring incorrectly. Just fixed it. As for the 0.1uF filters to each IC, thanks for the advice. I've just done that on the breadboard and diagram. (see attached):

Count down timer V2.pdf

As for the other info on LEDs, voltage, reset, pause, wireless, etc, I'll be looking at that a little later. I'm waiting for some 200mm high digits from ebay as well as various strength of LED. I want to do some full scale testing with these displays to see what suits, then I continue. You've now made me think that I also have to consider brightness day/night. We have night games, so I should put in a light sensor to "dim" the brightness. I hope you don't mind if I throw more questions to you down the track. Thanks in advance. Chris.
 

Attachments

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Guys.
Tw quick question here is I can...

I've created a digit now with 187 LEDs (next stage of my scoreboard). I'm about to test it by driving it from the output pins of one of the 4511 ICs on my count down clock. I'm wanting to use seven BC547 (NPN) transistors by using the "high" output fed to the "base" of each transistor which in turn connects up 12V to each of the 7 banks of serially LED segments I made.

Question:
Can I connect these directly to the bases of the 547s or do I need to put in a diode, filter, or something?

Second question:
On a web site I saw someone put a 4.7uF electrolytic capacitor to pin 1 of the 4511's. Is the 0.1uF monolithic I've used ok instead? What is better and why?
 

elec_mech

Joined Nov 12, 2008
1,500
Hi Chris,

Sorry I haven't had much in the way of time to respond to your last post. The schematic looks much cleaner, good job! I haven't had a chance to review it, but I'll try to soon.

Can I connect these directly to the bases of the 547s or do I need to put in a diode, filter, or something?
Simply put, you need a base resistor to set the gain. Read below first though, I don't think this transistor will cut the mustard.

Regarding the BC547, could you post a schematic of how you're planning to wire the LEDs to the transistor? If I understand you correctly, 187 LEDs make up one 7-segment. Therefore, roughly 27 LEDs per segment? Are these 27 LEDs all hooked up in series (serial I think you called it) or do you have a combination, e.g., 9 LEDs hooked in series, 3 sets of 9 in parallel?

Even if you are using simple red LEDs with a forward voltage of about 2V, 12V will only allow you to power about 5 LEDs in series safely. In this case, you'd need 5 sets of 5 (LEDs in series) in parallel -for 25 LEDs per segment total to keep this example simple. With a current draw of 20mA, this works out to 100mA required per segment.

The BC547 can handle 100mA max so you'll probably want to figure half of that is realistically available. I'd recommend a different transistor with a higher current rating (200mA minimum, 500mA to 1A ideal). A MOSFET would work really well and avoid having to figure out a base resistor which is needed to tell the transistor how much current gain to allow across the collector-emitter or the current allowed to feed your LEDs. You want to use the transistor as a switch in this case and set the gain to its maximum. I'm still learning transistors, so I'll stop here. A MOSFET will do the job nicely and you won't have to worry about putting something between 4511 and the MOSFET.

Alternately, you could use a ULN2803 or UDN2981/2 depending on how you want to feed the LEDs. This is important if you're using a common cathode (CC) or common anode (CA) 7-segment display, not so important if you're building the display yourself since you can decide on CA or CC.

Before diving further here, please provide the following:
1) Schematic showing exactly how you plan to wire the LEDs (series, parallel, combo).
2) The forward voltage and current of the LEDs you are using. If you're unsure, tell us the part number and we can look it up.
3) The rating of your power supply: output voltage, output current, and type, e.g., unregulated wall wart, computer power supply, etc.

On a web site I saw someone put a 4.7uF electrolytic capacitor to pin 1 of the 4511's. Is the 0.1uF monolithic I've used ok instead? What is better and why?
There are people here who can and have explained this well, but here is my layman's understanding.

You are fine with the 0.1uF ceramic capacitor. CMOS ICs generate noise that can interfere with other ICs. The 0.1uF cap takes care of this as long as it is placed as close to the Vcc and GND pins of the ICs as possible.

Electrolytic capacitors are typically larger in value, 1uF or greater, and help filter power fluctuations, typically coming from the power supply but they also serve to help compensate for sudden changes in the power due to the load. These are placed on the input and output of a voltage regulator IC/circuit and/or on the power input of a circuit.

So in a nutshell,
a) you need a 0.1uF cap on every IC in your circuit as they are all CMOS and
b) you'll want an electrolytic capacitor (1, 4.7uF, or 10uF would be good) on wherever the power supply is entering your circuit.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Elec_mech.
No problems not getting back earlier. Thanks for your reply today.

My school laptop just died today, so no chance for a drawing (I'm using my wife's and she doesn't have the software to draw).

I understand what you're saying about the 100mA transistor. Makes perfect sense - thankyou. I did test it and found my display going a bit crazy. I originally thought of using MOSFETs, but I was trying to "experiement" with stuff I had on hand. I will buy some and use them instead.

FYI
Currently I have 7 segments built up of a range of 33 to 24 LEDs. Each LED draws 3.15v (I measured it). Supply voltage is around 12.2V. Each LED has forward current of up to 30mA. I'm aiming at around 20mA instead.

For the 33 led segment, I created 11 parrallel rows of 3 leds in series with a 150 ohm resistor each (11 resistors in total). This ends up 18mA x 11, which is a total of about 200mA. Your right. My transistor won't work here. I'll use Mosfets. I'll get back if I need more help.

PS. 4.7uF capacitor across where power is entering - yes, that's what I say. It happened to be on pin 1 of an IC so I just assumed it was instead of the 0.1uF. My wrong assumption.
 

elec_mech

Joined Nov 12, 2008
1,500
Hi Chris,

I've used a BC170 NPN MOSFET successfully in similar circuits. It's rated for up to 500mA, so it will be more than enough to handle the current draw for the 33 LEDs hooked up as you described. I haven't tested this specific circuit, but it should work. You can certainly use any NPN MOSFET you have access to as long as it is rated well above the 200mA.

R12 is a pull down resistor used to turn the MOSFET off whenever the output pin of the 4511 is low (off). This just ensures you don't see segments randomly coming on.

Hope this helps.
 

Attachments

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Chris,

I've used a BC170 NPN MOSFET successfully in similar circuits. It's rated for up to 500mA, so it will be more than enough to handle the current draw for the 33 LEDs hooked up as you described. I haven't tested this specific circuit, but it should work. You can certainly use any NPN MOSFET you have access to as long as it is rated well above the 200mA.

R12 is a pull down resistor used to turn the MOSFET off whenever the output pin of the 4511 is low (off). This just ensures you don't see segments randomly coming on.

Hope this helps.
Thanks for that (and the illustration with the 10k. Good idea - I'll adopt that in my circuit.

Last night I found I had some 2n2222 transistors and they're rated to 500mA. I tried them - worked well. Now I'm re-building my circuit to included 4 characters (i.e. minutes as well). Having great fun and being "extra neat"!

One problem I'm now finding is the correct LEDs to use. I've sent quite a few emails to overseas suppliers for information, but to no avail so far. I do need LEDs that have a wide view angle. Alot of our petrol (gas) stations here in Aus display fuel cost using 200mm to 300mm high LED digits (made up of around 200 LEDs each). I looked more closely yesterday and could see the "glow" of the filament of the LED from any angle - same strength. These are the one's I'd like, but can't work out yet which they are. They're not actual that bright. Any ideas?

Should I start a new thread somewhere asking others for help here?
 

elec_mech

Joined Nov 12, 2008
1,500
Glad to hear the 2N2222 are working well. I assume you've added a resistor in series to the base of the transistor? As a quick and dirty value, 10Ω should be good enough.

Hmm, outdoor displays. I've investigated this a little for a project a while back. There is a tradeoff between viewing angle and brightness. Typically a wide viewing angle means less brightness and vice versa given the same input voltage and current. Now, you could go out and find some nice expensive, power-hungry LEDs with a high brightness and a wide viewing angle, but I'd suggest Googling outdoor LED viewing angle and brightness. I pulled up a handful of U.S. manufacturers who openly discuss the subject and can help you narrow in on what you want.

The simplest approach would be to buy a handful of LEDs with a few different mcd ratings and viewing angles and test them in the spot and during the time of day you want to use your display. Just be sure to get a cluster of 5 or more together when you test. Don't expect to see just one outdoors. I'd focus on a viewing angle in the range of 30° to 70°, possibly 90°. Much beyond that, I don't think you'll get the brightness you need. The mcd rating should be in the thousands. I assume you're looking at 5mm LEDs. 3mm LEDs will be brighter given the same ratings and angles, 10mm will be dimmer.

Oh, yes, it would be a good idea to start another post regarding outdoor LED selection. A subject line like "How to select LEDs for outdoor display". Mention the conditions (daylight, dusk, night), size of the digits and how far away you need the display to be seen. This will help people give you suggestions or at least what you want to look for.
 
Top