Count down timer for my soccer club

Wendy

Joined Mar 24, 2008
23,408
Sounds good. As for adjusting for floodlights, sensor placement is everything.

I help as I may, you are the man on the spot. :D

Reading at night? cover the sensor up where there is no light on it, it doesn't need to be outside.

The circuit I've drawn is most of it, the 3 resistors in front will be replaced by the LDR circuit.
 
Last edited:

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hey Bill.

I've now built 3 out of the 4 circuit boards and debugged them to have them work with my 24V run digits. I'm now just trying the temperature one but have run into a road block.

I bought a small digital temperature unit off ebay that I connected to 1" led digital displays. They worked. However, when I try to use this unit to run the common anode 16" digits (at 24V) via darlington arrays and PNP BC557 transistors, all segments of the digits seem to turn on (full and half strength) , and both numbers change together as if the same input. The chiip gives out a multiplexed signal which I think I'm not handling correctly (see pdf):
View attachment Temperature.pdf

So as a plan b, I've turned to using an LM35 temperature ( http://www.ladyada.net/learn/sensors/tmp36.html ) plus a ICL7107 low voltage 3 1/2 digit display converter (http://www.intersil.com/data/fn/fn3082.pdf.

The LM35 when hooked up to 5V gives out a linear reading in mV that corresponds to temperature in celsius (say 250mA = 25C). It works great. The 7107 is supposed to convert this to run a led displays. The 3 1/2 digit would read max -199.9. I would drop the decimal point and the hundreds and use the rest. I prefer this method to my temperature unit I bought.

Problem - from the spec sheet (page 3) the outputs to the leds are segment sinking and only 3V with a 5V supply. So I need to beef it up for my 24V, 800mA drawper 16" led digits. Can you suggest how I can wire these up. I assume I need to do this via a darlington array and/or transistor?

I've hooked up a single small (1/4"?) led and it seems to display a number but floats to different numbers about every second. I made the circuit in "figure 15" in the link above (see jpg below). Can you make any suggestions.
breadboard_1.jpg
Breadboard_2.jpg
 

Wendy

Joined Mar 24, 2008
23,408
Can you give me a couple of days? Got to work tonight, and short on sleep. I think the problem is fairly easy, but it needs to percolate in the back of my head.

I looked at your schematic, it is the after version. Could you please post the version before you modified it again?

One of the problems will be picking a frequency that doesn't alias with your multiplex frequency. A simple pot will take care of that, and you could measure the value and replace it with a fixed resistor after the fact. Not a good engineering approach, but it is what a tech like me would do.

It is funny, you selected the exact approach I was thinking of if I did it using the LM35. We have had lots of projects from people on this site using that little chippie.

One a separate note, I've been thinking of starting a set of cookbook circuits for my blog based on your project. I'll probably use totally different circuits, but you provided the motivation. Some of the circuits will look awfully familar, I liked your choice in chips.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
The original version was the same except I didn't put in any resistors or transistors. I didn't even try build that as it was preliminary only. I added the transistors due to voltages.

However, I would prefer to go down the 7101 track. It would be easier for someone to build (including myself).

Couple of days - no probs. Thanks in advance.
 

Wendy

Joined Mar 24, 2008
23,408
I see the problem, but not the solution yet. The highest voltage the transistors bases can reach is 6V. This is supposed to be the turn off voltage (before current). The emitters are 24V. They are common emitter, therefore the transistors can never turn off.

I have to work on it, but a second transistor per segment will solve this.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
I think you're on the right track - because when I first connect up one display, it displays as a number (say "2"), then changes to "8" and flickers a bit.

I'll wait on your solution - your the man!
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Bill, I didn't know there were so many links to info on 7107's and LM35's in this forum. With a bit of trial and error, I managed to get the 7107 to display the current temperature to (2 digits). All I need to do next is test it with the large digits. So I think I'll abandon the temperature unit I originally was going to use.

The circuit with the 7107 is quite neat and easy for anyone to build, so I'll go down that track.

I'll need to get back to you soon regarding the dimming - the values via the LDR under lights vs during day sunlight. PS. I just received a 24V, 15A power supply for the LEDs via ebay - $37 - so I'm getting closer now.
 

elec_mech

Joined Nov 12, 2008
1,500
I see the problem, but not the solution yet. The highest voltage the transistors bases can reach is 6V. This is supposed to be the turn off voltage (before current). The emitters are 24V. They are common emitter, therefore the transistors can never turn off.
Okay, I still know little about transistors, but is it possible to force the transistor to fully shut off by adding a resistor between the base and the emitter? According to this site, this resistor would be about 100kΩ based on your base resistor value:

http://www.rason.org/Projects/transwit/transwit.htm

Problem - from the spec sheet (page 3) the outputs to the leds are segment sinking and only 3V with a 5V supply. So I need to beef it up for my 24V, 800mA drawper 16" led digits.
Is it 800mA per segment or per digit (800/7 = ~115mA per segment)? If the latter, you could use a source driver similar to UDN2981/2 assuming your digits are CC. Unfortunately, these are getting harder to find since they're no longer made, but I can find a similar replacement if you'd like. These will work up to 50V and 500mA per segment. Failing that, I'd suggest a MOSFET with logic level input. No need to mess with resistors.

I've hooked up a single small (1/4"?) led and it seems to display a number but floats to different numbers about every second. I made the circuit in "figure 15" in the link above (see jpg below). Can you make any suggestions.
Look at figure 2. This IC appears to need a negative voltage supply, specifically on pin 26. You appear to have pin 26 tied to GND. Do you have a 7905 handy to supply -5VDC to pin 26?

The circuit with the 7107 is quite neat and easy for anyone to build, so I'll go down that track.
That is cool. Thank you for mentioning it. :)

One a separate note, I've been thinking of starting a set of cookbook circuits for my blog based on your project. I'll probably use totally different circuits, but you provided the motivation. Some of the circuits will look awfully familar, I liked your choice in chips.
Bill, this sounds great and I'd love to help if you'd like. I'm currently working on a settable 99 second countdown timer for another member. I'm trying to over-engineer it so that multiple modules can be daisy-chained to allow for hours, minutes, etc. since I need to buy more than I need at the moment to keep cost per board down. Ultimately, I'm thinking about designing and stocking PCB modules: clock and button debouncer, two-digit module with presets via BCD switches, etc. Would this be of interest to the AAC community - offering to sell bare boards to members to make their own through the flea market? Not expecting a big demand of course, but I'm wondering if it would be helpful to members or not.
 

Wendy

Joined Mar 24, 2008
23,408
Nope, the core problem is the differences in voltages. I know of several schemes that will reconcile this. What amperage is going through the LED segments, it matters in the drive to the transistors required.

To elec mech,

You are more than welcome to join in. I'll probably have to retype your entries, but I will give you the credit. This is a subject that will not go away. Have you looked at the Completed Project Entries by MMcLaren, some of them are quite good.
 

elec_mech

Joined Nov 12, 2008
1,500
Nope, the core problem is the differences in voltages. I know of several schemes that will reconcile this. What amperage is going through the LED segments, it matters in the drive to the transistors required.
Ah well, I thought I'd ask. Allow me to ask another transistor question if I may, under what conditions can you use a single transistor with a lower base voltage than the load voltage? I've done this successfully once for a debounce input to a CD4093. I've looked at several transistor sites and even AAC's e-book, but I've never seen a practical working example.

One day, I hope to figure this out and put together a layman's explanation with tested circuits on how to really use transistors.

For this case, is this a no go because of the large difference, i.e., 5V base, 24V load? Or would it be no different if the base was 5V and the load 10V?

Have you looked at the Completed Project Entries by MMcLaren, some of them are quite good.
I have, and they are quite good. I've done several programming projects myself and even have one sitting on shelf that uses a PIC for a countdown timer for things like retirement, birthdays, etc. It counts months, days, hours, and minutes. After I wrap up the 99 second project, I hope to make a PCB and maybe get back into some programming projects. Using a uC is certainly a lot less expensive than all the digital logic ICs for these larger projects, but they are fun and challanging in their own right and allow others to better understand how digital logic, and ultimately electronics, works.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi Bill & elec_mech.

I've built the temperature unit using the 3 & 1/2 A/D converter 7107 along with the LM35 temperature sensor.

With .39" seven segment units, it works great (see attached PDF):
View attachment Temperature with small digits.pdf

However, when I then connected this to the larger 16" digits via 4009s hex converters and 2003 darlingtons, they seemed to have the same problem with constantly staying on and flickering a bit.

See attached schematic as I've wired it.
View attachment Temperature with large digits.pdf

I'll read your replies above in a couple of hours. Just tied up for the next hour or so.

5/6/12 schematic amended - I replaced the 4009s and 2003a's in the 16" digit schematic with 2981s. Still not working however:
View attachment Temperature with large digits_b.pdf
 
Last edited:

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Please read previous note above as well.
As for some additional stuff / info:

The digits are composed of 7 segments, 3 drawing 105mA and 4 drawing 120mA - hence about 800mA per digit, run on 24V. They are common anode, hence needing the ULN2003s.

The 7107 outputs to common cathode digits at low voltage (5V). Hence I need to reverse the polarity of the outputs (4009s or similar) and then run through ULN2003s to my 16" common anode digits.

Mech_elec, I was also going down the track of how the transistors were switching. I referred to http://www.w9xt.com/page_microdesign_pt8_pnp_switching.html which is similar to your link - but I'm just stabbing in the dark. I'm still trying to work out exactly how transistors switch and current flow, etc.

I'm still assuming the 7107 pulses the output (multiplex?), hence all the problem?:confused:

One mistake I just picked up. The 7107 outputs to a common anode digit. Therefore I should connect up a UDN2981. When I do, again all the digits light up. Reading the spec sheet I "think" it says it runs with a minimum of 5V and the output from the 7107 might be less - hence the digits are all on? Does the 2003 have the same minimum voltage problem - or am I way off track?
 
Last edited:

Wendy

Joined Mar 24, 2008
23,408
At the moment I'm focusing on the first schematic. I'm move on when I'm done with it. :D

Flickering is usually the on/off switching between the LEDs is so slow persistence of vision no longer works. I have heard 30 Hz should do it, but I have also had some claim that they can see up to 1Khz. I don't claim to be an expert in the subject, I always thought that based on TVs, 30 Hz was good enough.

Back to the first problem, and some possible solutions.

1st step, define the problem.

  • You are wanting to turn off the LEDs, which are powered with 24VDC, with 6V, and turn them on with 0V.
  • You want to power these LED segments with 0.7A
Those are my working assumptions.



I put this schematic up to show what I think is happening. There is never a situation where current is not flowing through the BE of Q1. The exact values of R2 and D1-3 are not important, all we need to know is that they need about an amp. This is important in when calculating how much base current Q1 needs, and I rounded off for redundancy.

OK, so we need a schematic that will do the initial problem set.



I am not done, this is a first draft to show one approach. The reason the resistor is shown at 5W is you have 23.3VDC and 100ma, which works out to 23 watts. 100ma is required to turn Q1 on completely at 1A.

A good rule of thumb for BJT is 1/10 the base current for the collector current.


I have serious reservations about this approach, since it will try to inject 100ma into the 6V power supply. Not really recommended. Looks great in theory though.



Truth is, I don't like either approach, but it is what I have at the moment. Another thought occurred to me though. I'll get back with another thread.
 

Attachments

Last edited:

elec_mech

Joined Nov 12, 2008
1,500
With .39" seven segment units, it works great (see attached PDF):
Okay, we've got a working circuit. This is very good. The problem then likely lies in the CC to CA digit use and higher voltage and current use.

However, when I then connected this to the larger 16" digits via 4009s hex converters and 2003 darlingtons, they seemed to have the same problem with constantly staying on and flickering a bit.

See attached schematic as I've wired it.
Attachment 44109
Okay, looking at the schematic you provided, I see four CD4009s and no ULN2003's. Did you use 2003's?

Okay, first note that that ULN2003 and UDN2981/2 will accept 5V on their inputs as an ON condition. This means if you have an LED tied to an output pin correctly, it will light when you apply 5V to the respective input pin. For a ULN2003, the LED's cathode is connected to the output pin. For a UDN2981/2, the LED's anode is connected to the output pin.

Therefore, for a common cathode display, use a UDN2981/2. For a common anode display, use a ULN2003. This assumes the input is high to indicate when to light a segment. Reading the rest of your comments, this is probably a moot point though.

Once you figure this out, you will still need current-limiting resistors going to each segment so they doesn't get too much current. What is the voltage rating of each segment again of your 16" display?

I'm still assuming the 7107 pulses the output (multiplex?), hence all the problem?:confused:
No, the 7107 doesn't multiplex. The digital thermometer in your eariler post is multiplexing. The CD4553 is another good example of an IC that multiplexes. Multiplexing involves using the same output pins to power the same segments (a and a, b and b, etc.) at different times by turning on and off the CC or CA of each digit. This saves on wiring, soldering and board space, especially if you buy digits that are already multiplexed (2 or more digits that have each segment wired together internally, a to a, b to b, etc.).

The 7107 has a dedicated output pin for each and every segment, so it does not multiplex.

It may be pulsing the output but unlikely - pulsing is used to brighten or dim the display and is usually done with an external signal, usually PWM, put onto a pin that forces all the segments off.

One mistake I just picked up. The 7107 outputs to a common anode digit. Therefore I should connect up a UDN2981. When I do, again all the digits light up. Reading the spec sheet I "think" it says it runs with a minimum of 5V and the output from the 7107 might be less - hence the digits are all on? Does the 2003 have the same minimum voltage problem - or am I way off track?
Good observation. Your first schematic shows a CC digit, but you have the CC pin tied to -5V. If this worked, then the 7107 is sending a low signal to indicate when to light a segment.

I see what you're trying to do with the 2981. Note the 2981 is designed to source current, therefore when a high signal is sent to an input pin, the corresponding output pin is connected to Vcc (+). I don't think connecting pin 9 to ground will work. I'm not sure if this will do it, but try connecting pin 9 to 24VDC and pin 10 to GND. In this instance, when the 7107 is sending a high signal (off), 24V is applied to the output pin, turning off that segment (since it is a CA display). The question is, when the 7107 sends a low signal (on), will the 2981 connect the output pin to ground and safely pass the current? If it can, pin 9 must be connected to 24VDC and pin 10 to GND.

If not, you'll need logic-level controlled P-channel MOSFETs for each segment. These will connect the segment to GND when a low signal is received on the gate. You can do this with transistors, but again my knowledge is limited here and MOSFETs require less parts.

Also check the 7107's output voltage when a segment should be on. I'd suggest hooking up the .39 segments again, verify the temperature is constant and not changing (keep the sensor dipped in ice water for example), note which segments are on and off, remove the displays, and check the voltage of each segment output with respect to GND and 5V (and if you want to be extra sure, with respect to -5V as well).

I'll take a look at what Bill has posted on transistors when I can (for my own benefit if nothing else). :D
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Yes, my diagram with the 4009 and 2003 was over the top. A UDN2981 I think would do the same thing. A for the 24V to pin 9 - your absolutely correct. It depends where I look up info on how to wire this unit up and the terminology - Vcc, Vss, Vdd, Vee, Vs, Vc, - my heads spinning:confused: Can't positive just say +ve and negative -ve.

However, I hooked up pin 9 to 24V and 10 to ground. Still all digits on.

Success (I think)...
Looking at Bills use of transistors, I took a stab in the dark and tried to connect the following:
- Pin 2 of the 7107 (i.e. output "D") to the base of a BC557 (PNP) - (rated at 100mA)
- Ground of my 24V to the collector
- "d" of my 16" digit to the emitter
- 24V to the common of the 16" digit
- The ground of the 5V supply running the 7107 to the ground of the 24V supply

It seemed to work.

So I connected up the other 6 segments of that single digits with another six BC557s and the digit displayed real numbers. Holding the LM35 in my fingers, the numbers rose from 1 to 4. Not sure if it is rising correctly yet (linear). Need to connect 2 digits - I'll do that tomorrow. Schematic:
View attachment Temperature with large digits_c.pdf
Could you check it and let me know if there is anything that stands out as incorrect. I don't want to fry anything. I've haven't used resistors anywhere between the 7107 and transistors - maybe I should.
 
Last edited:

elec_mech

Joined Nov 12, 2008
1,500
Yes, my diagram with the 4009 and 2003 was over the top. A UDN2981 I think would do the same thing.
I'm not sure myself, I'll need to experiment. :eek: I can better see what you were doing. Could you resend that schematic showing how the 2003's are connected (I didn't see them in your last schematic)? Inverting the low (ON) signal from the 7107 to result in a high signal to the 2003 should work, although I don't know if it is ideal.

It depends where I look up info on how to wire this unit up and the terminology - Vcc, Vss, Vdd, Vee, Vs, Vc, - my heads spinning:confused: Can't positive just say +ve and negative -ve.
So very true. There is a method behind the madness, I just don't know what it is.

Success (I think)...
Looking at Bills use of transistors, I took a stab in the dark and tried to connect the following:
- Pin 2 of the 7107 (i.e. output "D") to the base of a BC557 (PNP) - (rated at 100mA)
- Ground of my 24V to the collector
- "d" of my 16" digit to the emitter
- 24V to the common of the 16" digit
- The ground of the 5V supply running the 7107 to the ground of the 24V supply

It seemed to work.
This is good! A few important notes here:

1) The BC557 is rated at 100mA. You need up to 120mA continuously, so the BC557 is going to get hot and may burn up if left on for a while. I'd suggest finding one with a bigger current capacity, 200mA minimum. Perhaps a BC327 which is rated up to 45VDC and 800mA?

2) You should add a resistor in series to the base of each transistor. This prevents burning up the transistor and trying to pull more current from the 7107 than it can provide which will damage the 7107. In theory it also prevents too much current from going to your segments, but don't hold me to that. As Bill mentioned, a rough rule of thumb is to put 1/10 the current of the load through the base to keep it on. So, you have up 120mA per segment. Therefore you need 120/10 = 12mA going to the base. If I'm doing this correctly, then the base resistor should be about (5V - 1.2) / 12mA = 317Ω, where 5V is the voltage going to the base from the 7107 and 0.7 is the voltage drop across base and emitter. I hope Bill will correct me if I'm wrong here.

3) You must have a current-limiting resistor in series with each segment, otherwise they'll consume too much current and burn up. What is the voltage of each segment? Current limiting resistor = (24V - V_segment) / 0.120A. Might need to take into account voltage drop of transistor, roughly 0.7V most of the time. Once you add this resistor, measure the voltage and current across each segment to verify it is getting enough of each. You may need to tweak the resistor value.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Yes, now that I've got the displays working with the BC557s, I'll try again with the 2003s &4009s. then also the 2981s just on their own - just to "double check" this setup is not working. I'll pass on the schematic. I'll do this today after work.

BC327s - yes, I'll try these out as your correct the others are max 100mA.

1/10 current through base - 330Ω resistor in line - I thought so as well. I'll do this and check it still works and wait for Bill to confirm.

Current limiting resistor with the 16" digits - sorry, I really should draw the in. I've built them into the board, so I've been lazy not drawing them in the schematic. I'll put them in as well in the drawing.

By the way, if the PNPs are the way to go, is there any IC you know of that has 7 or more PNPs built in that can handle this load?
 

Wendy

Joined Mar 24, 2008
23,408
I'd be less than honest if I said I was keeping up. But no matter.

So the decision to go with the 7107 is firm then?

On the original layout you used common emitters, I think we could have gotten the currents and heat way down with the use of common collectors (change the polarity of the transistors to NPN).

The trade off is the transistors would be getting hot. You could also use darlingtons to bring the currents way down. The TIP10X series is very good for this job. They are darlington NPN/PNP transistors that are very inexpensive and have TO220 cases, which lend themselves to easy heat sinking. Not long ago I bought a batch of clip on heat sinks for TO220 cases for something like 39¢ I think would work OK for this.
 

elec_mech

Joined Nov 12, 2008
1,500
Bill,

I think we were both waiting to see if you had a blazing gun solution to using the pre-made digital timer while we charged off in the meantime on the ICL7107 option. I think the OP is leaning toward the 7107 though.

Would you mind taking a look at the last post of mine with regards to hooking up the transistors and sizing the resistors?

Chris,

I've looked, but I can't find ready-made ICs with multiple transistors or MOSFETs. NPN and N-Channel look prolific, but not so many on the PNP and P-Channel side. I did find a SMT part that could be used without too much difficulty: http://www.fairchildsemi.com/ds/MM/MMPQ2907A.pdf.

I originally suggested using a logic level P-Channel MOSFET but a quick look up reveals these cost reasonably more than PNP transistors, so maybe not.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi elec_mech.

Yes, on one hand I would have liked to have used the digital timer, but on the other hand doing the timer from scratch with the 7017 is a bit more rewarding.

Last night I connected up 2 digits with PNP 2N2907 which are rated at 600mA and 60V collector voltage. I didn't realize I had a bunch of these. I bought them early on. I also put in 300Ω resistors in line to the bases (as I didn't have 330s). I measured the current draw without the resistor and it was around 7mA. With the resistor it was about 5mA. Is this OK for the 71017?

I then left it connected for about an hour. The 2907s were heating up a bit. I could hold them between my fingers but they were warm to hot. Is this acceptable, or no good?

No ready made IC to replace them come to mind - no problems. Thought I'd ask in the off chance.

Bill:
Taking your advice, I've searched for some TIPs to replace (in this case) the 2N2907s. However, there are so many types

All the PNP Darlington bipolar transistors range in collector / emitter voltage (100V, 80V & 60V) as well as current (2A, 5A and 8A). Do TIPs with a higher current and voltage allowance run cooler? Should I go for say a TIP127 (100V/100V/5V/5A) as compared to a TIP115 (60V/60V/5V/2A) - if prices are comparable?
 
Top