Building 2 digit up/down counter LED display

Thread Starter

izon

Joined Mar 17, 2013
217
Well finally got the latest revision hooked up but have a problem. When trying to turn the display on with the remote, all steps in the circuitry for the toggle seem to work but the display doesn't light up.

At the FET, the gate voltage toggles between zero and 12 volts as it should when alternately pressing the remote key, but I'm finding only about 9.5 VDC on the "source" pin (the one connnected directly to the LED anodes. The "drain" is tied directly to the 18vdc source.

I first had the drain and source leads reversed and then corrected that. Thinking I may have damaged the first FET, I plugged in a spare I had purchased at the same time but still no change... just 9.5vdc on the source pin. I can jumper source and drain and, of course have my full 18vdc on the LEDs and normal display with the up, down and reset functions via remote behaving fine.

Not sure what to expect on an FET but should it normally turn fully on so that drain and source voltages are nearly equal? Thanks for your advise !
 

elec_mech

Joined Nov 12, 2008
1,500
Ugh, I'm sorry, I goofed. :( I've set up the N-Ch as a common drain instead of the intended common source. I was trying to make it easy to add to your existing circuit, but this won't work.

I've attached (and successfully tested with 10V on the gate and 15V on the load side) a correction. Unfortunately, this will require some modification to your PCB in order to separate the PCB ground from U6 and U7 so you can place the MOSFET between them.

Alternately, you could replace the MOSFET on the anode side with a 12VDC relay such as this.
 

Attachments

Thread Starter

izon

Joined Mar 17, 2013
217
Ok. ...tried rewiring with MOSFET in the ICs ground after isolating pin 9 on both. Well similar problem .... when turned "on" the FET doesn't saturate so have a less than half briteness of the LEDs. There is about 4 volts on the FET where it should read zero if it were fully "on".

Then tried putting a relay from salvage into the same place as the FET as just wired. Relay won't operate... Don't know if the flip flop can handle the needed coil current?? ....I have to recheck everything. Shouldn't the relay work in the ICs ground ckt just as well as the LED anode ckt. Still going to depend on the flip flop being able to operate the relay. Will check back later...thanks.
 

elec_mech

Joined Nov 12, 2008
1,500
Ugh, I'm ready to bang my head into the wall. I thought I'd really understood switching with transistors using low voltages to control larger ones. Apparently not.

Alright, on hindsight, the flip flop is a CMOS IC, so won't be able to provide enough current to drive the relay coil. What MOSFETs and transistors do you have handy? I'll do some tests tomorrow. I've already banged a nice dent the wall, so I know where to resume tomorrow. Ugh.

In the meantime, take a look here. Look a little shy of halfway down the page to the schematic under the heading "protection diode". You could feed the output of the flip flop to the base of the NPN transistor shown. Something like a 2N2222 or 2N3904 should work nicely. Note the need for a diode such as a 1N4001.

Maybe I'll post a thread to see if I can get some insight to using FETs as switches. This is really bothering me. As you can see, I still have a lot to learn myself.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Hi....don't beat yourself up on this. I'm learning too and you've been working hard on this for a long time....on that link..would it be an expensive transistor that would be needed if it were placed in the ground side of the driver ICs or the LED supply side if it alone were to handle the current? Or... Would there be an advantage in using a transistor to operate a relay....just trying to keep parts at a minimum and least amount of re-wiring.
Thanks for the comments.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Some notes from experimenting.....

In regard to the change where the FET was in series with the drivers ground connection:

I thought I would just try a plain ole NPN transistor rated to handle about
1 amp collerctor current. It behaved about the same as with the FET in the ckt. Then at some point I had the transistor out and with a totally open ground connection for those driver ICs, I powered it on to find there was still a half brite LED display!

So even ungrounded, there was some sort of leakage path allowing the drivers to provide a ground path for the source supplying the LEDs !!

Instead of trying to figure that one out, I again connected the ICs to ground by wire and went to try the same type of experiment on the LED supply side.

I connected the NPN pretty much as you had originally shown for the FET in the LED supply side. Now I noticed that with the remote setting the display to be "ON", it was still only half brite. I checked and found nearly
12 volts at the NPN base (coming from the flip flop pin 1) and about the same 12 volts right at the common anodes of the LEDS.... on the collector of the NPN I had my full 18volts as expected.

Sooo when the transistor should be fully "on", there is still about a 6 volt drop across it thus giving the half brite display. Suppose it could be the specs of the NPN are not allowing this method to work... I just grabbed the trasistor on the basis of it's current capacity. I don't know or am not
able to follow all the "math" of what should be what when picking a transistor to behave as a switch in this application... so that may be where the problem is.... just to be sure, I jumped the NPN emitter to collector and, of course.... full briteness.
Also noted that when set to "off" the LEDs did indeed go dark and the voltage on the base of the NPN went to zero as expected.

Don't know if this helps or confuses but stiil rather mysterious why the drivers still allowed half brite LEDs when their grounds were open circuited.

Thats it for the moment.
 

elec_mech

Joined Nov 12, 2008
1,500
Okay, goodness help me, I think I got it.

We need to use a P-Ch MOSFET or even a PNP transistor with an NPN transistor. The P-Ch/PNP will work to act as a switch on the anode side of the display. The NPN transistor is used to allow 12V to turn on the P-Ch/PNP. I've tested this with 15V and 10V with an LED and smaller P-Channel.

Just make sure the P-Ch/PNP is rated above 1A to be safe.

I've also posted this elsewhere, so if someone points out a flaw, I'll let you know.
 

Attachments

Thread Starter

izon

Joined Mar 17, 2013
217
I will try that but why can you expect Q5 to turn fully on with the same base voltage when it wouldn't turn fully on when I put it where the FET
was in the anode ckt of the LEDs? If I'm thinking right, a forward bias
(over 11 volts on the base) of the NPN I tried, ended up with only about 9 volts at the anodes of the LEDs. (obviously wasn't saturated)

So I'm wondering if I find a possible PNP (in place of the P-channel MOSFET you are suggesting) will it saturate to allow nearly 18 volts
at the LED anodes? That would be also assuming the NPN (Q5) will
turn on enough to bring the base of the PNP low enough to turn on.

Can I keep the same resistor values for R45 and R46 if I use a PNP transistor there?
 

elec_mech

Joined Nov 12, 2008
1,500
I can say with reasonable confidence it will work but I cannot say I fully understand transistor operation enough to explain why.

When using a transistor as a switch, you want to use them in a common emitter configuration (for BJTs) or common source configuration (for MOSFETs). There are other configurations such as common collector/drain and common base/gate, but these serve other purposes. Originally, I used an N-Ch MOSFET in a common drain which won't work - at least not without applying well over 18V to the gate.

This app note may help some.

Simply put, we need a high-side switch which will source current to the load. A P-Ch or PNP transistor in a common source/emitter configuration will accomplish this. When we apply GND to the gate/base, the PNP will turn on. However, to fully turn off, we need to apply Vcc to the gate/base. Since we're supplying 18VDC, a 12VDC signal to the gate/base won't fully turn off the transistor. To do so, we use an NPN transistor, also in a common emitter configuration. When the output from the flip flop is low, the base is at the same potential as the emitter and the transistor is off. This, in turn, allows 18VDC to reach the gate of the P-Ch MOSFET through R46 which fully shuts the MOSFET off. When 12VDC is applied to the NPN base, the NPN conducts and pulls the gate of the MOSFET to GND, fully turning it on.

So I'm wondering if I find a possible PNP (in place of the P-channel MOSFET you are suggesting) will it saturate to allow nearly 18 volts
at the LED anodes? That would be also assuming the NPN (Q5) will
turn on enough to bring the base of the PNP low enough to turn on.
It should.

Can I keep the same resistor values for R45 and R46 if I use a PNP transistor there?
If you use a PNP transistor, you may want to use 1kΩ for R45 just to limit the current to the base. R46 is fine as is.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Well I have an NPN in place and temp PNP instead of a MOSFET. It is a "Power Switching" PNP transistor rated at 4 amps
(happened to have a new one).
http://www.nteinc.com/specs/100to199/pdf/nte152.pdf

I used a 1K for R45 as suggested and then connected with emitter of the PNP on the voltage supply wire and the collector on the LED anodes. When powered on, the LEDs are lighted fully but when trying to switch them off, with the remote, has no effect. The collector of the NPN goes to near zero when switching "on" and rises when when remote is set for off.

I thought the polarity of the PNP should be connected with the emitter at the most positive (supply) and the collector to the load side as stated above.

Just to be stupid, I exchanged the connections of the emitter and collector and now found there is a small change when selecting on or off with the remote. The collector of the NPN still is brought down to near zero but there is about 14 volts on the anodes of the LEDs when "on". When you use the remote to turn it "off", the voltage on the LEDs goes to around 12 volts?!...... and R45 runs quite warm. The display goes from a half brite to a very dim briteness as you make the on/off selection. !

So... don't know yet what I'm doing wrong... maybe you should show me the schematic with this PNP transistor as it should be wired.... There must be a situation of bias on the PNP not right... R45 is pulled very low where it connects to the NPN collector but too much current must be getting diverted through it and not enough remains to operate the LEDs... If you show me again with the PNP transistor in use, I will recheck my "rigged up" wiring as I may well have messed it up.

Thanks....
 

elec_mech

Joined Nov 12, 2008
1,500
It sounds like you hooked it up correctly the first time. The emitter gets connected to +18VDC. The collector gets connected to the anode side of the LEDs.

This transistor is bigger than anything I've used before, so maybe I'm missing something, but let's take a step back.

  1. With R46 (10kΩ) connected between the base of the PNP and +18VDC (and nothing else connected to the base), what happens? Are the LEDs on or off or somewhere in between?
  2. Now, keeping R46 connected, connect a 1kΩ resistor between the base of the PNP and GND. What happens? Are the LEDs on or off or somewhere in between?
  3. Is the 1KΩ resistor getting warm? If so, replace it with a 100Ω. Does the 100Ω get warm?
We may need to verify the NPN is working as expected later, but we need to verify the PNP is working as expected by itself.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Good News !

First I will respond "by the numbers" to your suggested steps:

1.Under these conditions, the LEDs are OFF entirely and I find about
8 volts on the common anodes.

2. & 3. With a 1K resistor to ground, the LEDs are fully on... about 17.5 volts on the anodes. The resistor is not warm and I measure 17ma of current flowing through the resistor. I tried the 100 ohm briefly and found it to get blistering hot (using 1/4 resistors) and the current flow is 160ma!

Note: with such success thus far, I decided to now connect the 1K to the
collector of the NPN and power up. GREAT ! now with the remote
key selecting it to be off, it is indeed totally off with no illumination
at all of the LEDs. Then turning it on, the LEDs light fully with about
17+ volts on the LED anodes and incidently in the off mode LEDs
are totally off with no voltage being found on the anode leads !!

Also wired like this (using 1K in line from NPN collector to PNP base) and powered on, there is about 17 ma flowing trough the Ik
and the CB portion of the NPN.

Sooooo bottom line, it is working correctly. So do you think I should use the parts as mentioned ? I may like to look for a smaller but acceptable
alternative for the PNP to conserve some size for putting on my "little"
board. That PNP I had is normally used for audio power output amp and some other applications.

So I must of had things goofed up when wiring before because now it works with things as described...only added part is the 1K in the base to NPN collector circuit.

Your thoughts?
 

Thread Starter

izon

Joined Mar 17, 2013
217
I guess the 1K does get rather warm now that it's been on for several minutes.. maybe I should just go up to a 1/2 watt version... interestingly the NPN doesn't
feel warm with the same current or am I not thinking straight again?
 

elec_mech

Joined Nov 12, 2008
1,500
The thing to remember is the PNP and NPN transistors allow current to flow through them based on the current flowing to/from their bases.

If 17mA is flowing to the base of the PNP, then the NPN is passing 17mA from the GND to the PNP base. A 2N3904 can handle 600mA or so (going from memory, I could be off), so 17mA is nothing.

Now, as a very general rule of thumb, when using a BJT as a switch, you plan to put 1/10th of the current required to pass through the emitter-collector to the base to fully turn it on (enough). Now, I'm not familiar with the specific PNP you're using, but if we assume this rule of thumb is applicable, then the PNP can source 170mA to the load. However, remember your current requirements will change based on the number shown. In the worst case scenario, your maximum current requirement is when all segments are lit ("88" is displayed). I don't recall if we sized the resistors to allow 20, 25, or 30mA. For the moment, I'll assume 25mA. Hence, 25mA per string x two strings per segment x 14 segments = 700mA. Again, if the 1/10th rule applies for this PNP (and I'm not sure), then you'll need about 70mA to pass through R45. At 18VDC, this works out to about 260Ω. Power = V*I = 18 x 70mA = 1.26W! You'd want a 3W resistor at least. Ewww. It's late for me, so I could be missing something critical here. In any event, change the display and watch the display and currents across R45 and the anode side to the display.

I'd suggest using a P-Ch MOSFET. Does not require any (significant) current to the gate. The one I've shown is rated for 1.6A if memory serves. This is why I really like MOSFETs.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Thanks for the input...don't have quite enough time to "digest" this right now so will follow up later. I wanted to use what I have on hand since I don't have any local supply sources and every time you have to order... the shipping costs can be more than a small parts order... all adds to the total cost but glad it is nearing the end.. I do have it on "88" and the 1/2 watt Ik is not exactly warm..
Anyway will check in another time.
 

Thread Starter

izon

Joined Mar 17, 2013
217
OK... I put the ampmeter in series with the lead going to the LED common anodes and set the display to show "88". The current draw is 470 ma. So maybe a little less than calculations... a good thing. That is with a 1K in the line from the NPN to the PNP base at 1/2 watt. This ran all nite like this and I'd have to say the resistor does not seem "warm"... you could hold it between fingers all day and not be bothered.

I will go ahead and get a 2N3904 (been using random number NPN) and the P-channel MOSFET you suggest and get back when I've received and tried them. As is, seems to be working just fine but the PNP is a bit bulky to find a way to mount it on my little ckt board now that I'm adding another few components. Thanks for now!
 

elec_mech

Joined Nov 12, 2008
1,500
Ah, sounds good. Glad to hear the resistor isn't getting hot after a long run.

If your NPN transistor is working and isn't hot, no need to change it. The P-Ch I selected has the same footprint as the N-Ch I originally called out - only a 4 pin DIP. Not sure if the pin orientation is the same though.

I wanted to use what I have on hand since I don't have any local supply sources and every time you have to order... the shipping costs can be more than a small parts order... all adds to the total cost but glad it is nearing the end..
This is why I always push to get a working design based on all the wants and needs before allowing someone to go and buy parts. We were careful and did that at the start of this, but later ran into "feature creep". Ah well. :)
 

Thread Starter

izon

Joined Mar 17, 2013
217
I think this project is jinxed ! Even messed up trying to send this.. it all disappeared when I tried to use an "emoticon" !

Well parts arrived today so worked all evening to get everything permanently wired onto the little board.

Prior to beginning this evening, the project was running beautifully.. all funtions behaved without a hitch but now it was time to put in the final parts and start fastening everything down and securing all the wires... up to this point I had the new board and all the "experimental" parts solder tacked or clip leaded together to make changes easier.

When all done getting the last parts installed and powering the unit on... I was shocked to see an "88" displayed and none of the remote buttons would change this to a different number. The buttons would cause a little change in britenes of some segments and none of the segments were more than about half brite at best. Buttons would make a different set of segments become dimmer or briter but, again, no change from an 88.

I double checked wiring... no problems. I removed the output stage of the toggling ckt (the MOSFET P-Channel) to be sure that had no bearing on the strange display. At least the preceeding portion of the toggle ckt is fine... the NPN gets it's high or low from the new chip and it's collector then correspondingly goes high or low with button press.

Also found that on U3, the 4 pins that change state with the button presses DO, in fact, change as they should so up to this point all things behave as they should.... so gotta be one or more of U4,U5 U6 U7. How do I determine which one or ones are bad? Could you suggest a solution or tell me what voltages to look for on varous IC pins to isolate the faulty ones? DANG... gonna have make another parts order and shipping !!! ugh.

I confirmed my 12volts on the board and the 3 volts that goes through the relay contacts to the corresponding transistors.... 18 volts on main supply to the LED anodes.

I've had it for tonite... gotta "hit the hay" as we would say on the farm,ha.
 

elec_mech

Joined Nov 12, 2008
1,500
Hmm, initially I'd suspect the 40110s (U4 & U5), but if you're seeing some segments dim when the buttons are pressed, it sounds like they are working which points us to the ULN2804s (U6 & U7).

Did you use IC sockets so you can easily remove the ICs? This will make things immensely easier.

Let's start with removing U6 and U7. Now power up the circuit. Use your volt meter to check the voltage between GND and each of the outputs on U4 and U5. Press the reset button. Pins 1, 3, 12-15 should all be high (+12VCD). Pin 2 should be low.

Also verify pins 4 and 6 on U4 and U5 are low (0V).

Press the increment button once. Pins 14 and 15 should be high, 1-3, 12, and 13 should be low.

You can continue to check all digits to be sure.

If this is good for both U4 and U5, then your problem likely lies with U6 and U7. You can pull them off your PCB and put them onto a breadboard to test. Connect pin 9 to GND. Apply +12VDC to pins 1-7, one at a time, and check the voltage of pins 18-12 as you do. Put the positive lead of the volt meter on +12VDC and connect the negative lead to pin 18. Connect GND to pin 1 - you should see 0V or so on your meter. Now connect 12V to pin 1 - you should see about 12V (probably a little less) on your meter. Repeat for input pins 2-7, output pins 17-12, respectively.
 

Thread Starter

izon

Joined Mar 17, 2013
217
Thanks for the quick reply... I won't have a chance to spend time on this till later today as other work takes me away from the shop.
YES, I did use sockets for all ICs except the regulators and single transistors !!! othewise it would be a nightmare getting the board out in the open with all those lines going to the LEDs. etc.

Ok I will try your troubleshooting steps. I recall some time ago when things were all
"hanging out" while working on the project and having a lot of "tacked" together wiring that something happened also. I guess I determined from only one of the
(either ones or tens) display digits being dead that it was a driver IC which I replaced to solve that problem.

I'm wondering if with still having a few "loose ends" of intereconnecting wires hanging about, that I may have gotten something touching something else resulting in a short and killing one or more ICs.. I try to be so careful but with three different "boards" and lots of interconnecting wires, it's not hard to see how something can go wrong.
(Main board , mini board, remote receiver board with relays ..... )

Well I will get back to you when I get time... hopefully late afternoon or evening.
 
Top