Help with the Simple Combination Lock

elec_mech

Joined Nov 12, 2008
1,500
Post 32 was supposed to allay your fears. Elec_mech had raised the issue of damage. He doesn't understand TTL very well. I started designing digital logic circuits before the first TTL IC family (SUHL, Sylvania Universal High-level Logic) was introduced in 1963. I'm not tooting my horn, I'm just trying to establish my credibility.:D
I'll be the first to admit my lack of knowledge. I was just trying to explain to the OP in more detail as best I understood it. I appreciate your knowledge and advice (I'm learning a lot here too) and, as I stated before, the OP should default to you.

So going beyond the rated current limit does not guarantee damage, just that the output logic may not "appear" correct to other digital inputs and heat dissipation could be an issue? Is it therefore safe to do this within certain instances?

So what are the current limits if a TTL output is strictly used to power something like an LED and not connected to another input? At least to point where one needs to worry about damage either by overcurrent through the pins or heat dissipation throughout the IC?

derderppolo, as Ron stated, if you could post a schmatic of the circuit you are using, we (or at least Ron) can shed light on why the LEDs are dim when they are supposed to be off.

I still suggest following the schematic Ron posted in #24. That should solve your problem.
 

Ron H

Joined Apr 14, 2005
7,014
I'll be the first to admit my lack of knowledge. I was just trying to explain to the OP in more detail as best I understood it. I appreciate your knowledge and advice (I'm learning a lot here too) and, as I stated before, the OP should default to you.
Yeah, I hoped you knew that I wasn't taking a shot at you, but just repeating what you had already admitted.

So going beyond the rated current limit does not guarantee damage, just that the output logic may not "appear" correct to other digital inputs and heat dissipation could be an issue? Is it therefore safe to do this within certain instances?

So what are the current limits if a TTL output is strictly used to power something like an LED and not connected to another input? At least to point where one needs to worry about damage either by overcurrent through the pins or heat dissipation throughout the IC?

derderppolo, as Ron stated, if you could post a schmatic of the circuit you are using, we (or at least Ron) can shed light on why the LEDs are dim when they are supposed to be off.

I still suggest following the schematic Ron posted in #24. That should solve your problem.
I just now took a 74LS04 hex inverter, left all inputs floating (outputs are low), and shorted one output to +5V. The current was 180mA. This means the device was dissipating (5V*180mA)=900mW. The θja is 80°C/W, meaning the junction temperature would eventually rise to 72°C above ambient, or around 100°C if ambient is normal room temperature. The operating temperature range is 0-70C, so this part would very shortly be operating outside its temperature range. This doesn't necessarily mean it would be destroyed (probably not), but it wouldn't be guaranteed to work properly immediately after the short was removed.
I then grounded an input, so that the output was high, and shorted that inverter's output to ground. The current was 67mA, meaning the power dissipation was 335mW. If you do the math, you should conclude that shorting a single output to ground (on the device I tested) while the output was trying to be continuously high will not raise the temperature above the 70°C max operating temperature, again assuming "normal" ambient temperature.
If you short multiple outputs on the same device, the total chip current will go up accordingly.

Keep in mind that these measurements were on a single device. Your results would almost certainly be different.

I can't tell you what the "reasonable" limits are. I am an engineer, and I design to worst-case specs. If you want more than the spec'ed output current, you can parallel gates. My personal choice is a small logic-level MOSFET. 2N7000's are ubiquitous and cheap. Their Rds(on) is only spec'ed down to 4.5V, which is above the minimum VOH of 74LS parts, but you can pull it up to +5V with a resistor. There are other logic-level MOSFETs with lower Vgs requirements, but I don't have their part numbers at my fingertips.
 

Thread Starter

derderppolo

Joined Nov 19, 2012
17
Hey,

This is a bit odd, but as I was testing my circuit this morning, the green LED, as usual, was rather dim. However, after about 5 minutes of playing around, the LEDs got considerably brighter. Before, it was difficult seeing the green LED even when you covered all of it with your hands. But, now it is much brighter, and can be easily seen in any lighting conditions (ok, maybe not every lighting condition).

I have attached the current, accurate schematic of how my circuit is built. But, for now at least, the LEDs are operating at optimal brightness levels. Perhaps there is something I am doing causing this inconsistency.

Thanks!
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
Yeah, I hoped you knew that I wasn't taking a shot at you, but just repeating what you had already admitted.
No, not at all. It's important to know your limitations - I've seen too many people pretend to know more than they do and that doesn't help anyone. I'm an engineer too, but more a jack of all trades with a special interest in electronics. So I like to help when I can, but I don't want to overstep my bounds and just wanted the OP to know you are the expert. While I try not to talk about something I don't know about, occasionally I stick my foot in my mouth without realizing it, such as damaging TTL ICs. I was strictly going by the datasheet as best I understood it.

I just now took a 74LS04 hex inverter, left all inputs floating (outputs are low), and shorted one output to +5V. The current was 180mA. This means the device was dissipating (5V*180mA)=900mW. The θja is 80°C/W, meaning the junction temperature would eventually rise to 72°C above ambient, or around 100°C if ambient is normal room temperature. The operating temperature range is 0-70C, so this part would very shortly be operating outside its temperature range. This doesn't necessarily mean it would be destroyed (probably not), but it wouldn't be guaranteed to work properly immediately after the short was removed.
I then grounded an input, so that the output was high, and shorted that inverter's output to ground. The current was 67mA, meaning the power dissipation was 335mW. If you do the math, you should conclude that shorting a single output to ground (on the device I tested) while the output was trying to be continuously high will not raise the temperature above the 70°C max operating temperature, again assuming "normal" ambient temperature.
If you short multiple outputs on the same device, the total chip current will go up accordingly.
Ah, thank you. So obviously the IC can sink more current (and thus heat up more) than it can source. Looking at the TI datasheet, IOH is given as -100mA max. Does this mean one output can safely sink 100mA? If I'm following your math from above correctly, that yields about a 40°C, totaling about 68°C when ambient is factored correct? So if a 100mA was sunk on one output pin, we'd be close to the 70°C limit. Design-wise, this would be a no-no, but if absolutely needed, this could work, correct? If you sunk, say, 50mA each on two pins, I assume the temperature adds up? Specificially: 2x (50mA * 5V) = 500mW -> 500mW * 80°C/W = 40°C -> 40+28°C ambient = 68°C? Is this how to calculate total heat dissipation for multiple pins?

Keep in mind that these measurements were on a single device. Your results would almost certainly be different.
Quite understandably.

My personal choice is a small logic-level MOSFET.
Ah yes, these as well as transistors crossed my mind for the OP's application here, but I figured the OP was learning digital logic and didn't want to muddy the waters by going into transisitors and MOSFETs. I assume the MOSFET would be preferred as they only require a change in voltage and don't consume, much, if any, current?

Their Rds(on) is only spec'ed down to 4.5V, which is above the minimum VOH of 74LS parts, but you can pull it up to +5V with a resistor.
Forgive my ignorance here, but could you elaborate on how you'd use a resistor to pull the voltage up to +5V? If I'm following the datasheet of the 74LS04 correctly, it outputs ~3.4V when it is a logic high, correct? Would you simply use a pull-up to +5V on the gate of the MOSFET?
 

elec_mech

Joined Nov 12, 2008
1,500
I have attached the current, accurate schematic of how my circuit is built. But, for now at least, the LEDs are operating at optimal brightness levels. Perhaps there is something I am doing causing this inconsistency.
It could be the breadboard, the ICs warming up over time, etc.



Doh! I should have seen this sooner - try the following:
  1. Connect the cathodes of the LEDs through resistors and back to the gate outputs as I originally posted.
  2. Remove the switch and just connect the last OR output directly to the NOT input and cathode green LED.
  3. Tie the LED anodes together.
  4. Put the switch between the anodes and +5V.
Now logic paths are left undisturbed and the LEDs should light correctly when you press the switch. I'll post a corrected schematic tomorrow.
 

Thread Starter

derderppolo

Joined Nov 19, 2012
17
It could be the breadboard, the ICs warming up over time, etc.



Doh! I should have seen this sooner - try the following:
  1. Connect the cathodes of the LEDs through resistors and back to the gate outputs as I originally posted.
  2. Remove the switch and just connect the last OR output directly to the NOT input and cathode green LED.
  3. Tie the LED anodes together.
  4. Put the switch between the anodes and +5V.
Now logic paths are left undisturbed and the LEDs should light correctly when you press the switch. I'll post a corrected schematic tomorrow.
Sounds very promising and exciting! Haha! I'll build it later on when I have the time, I am swamped in work right now, however.

Take your time on the schematic, and thanks again for your help! :D
 

Ron H

Joined Apr 14, 2005
7,014
Looking at the TI datasheet, IOH is given as -100mA max. Does this mean one output can safely sink 100mA? If I'm following your math from above correctly, that yields about a 40°C, totaling about 68°C when ambient is factored correct? So if a 100mA was sunk on one output pin, we'd be close to the 70°C limit. Design-wise, this would be a no-no, but if absolutely needed, this could work, correct? If you sunk, say, 50mA each on two pins, I assume the temperature adds up? Specificially: 2x (50mA * 5V) = 500mW -> 500mW * 80°C/W = 40°C -> 40+28°C ambient = 68°C? Is this how to calculate total heat dissipation for multiple pins?
I had trouble finding this spec, because it's called IOS, not IOH. If you look at the qualifying note, it says this:
§ Not more than one output should be shorted at a time, and the duration of the short-circuit should not exceed one second.
Your temperature calcs look good.



Ah yes, these as well as transistors crossed my mind for the OP's application here, but I figured the OP was learning digital logic and didn't want to muddy the waters by going into transisitors and MOSFETs. I assume the MOSFET would be preferred as they only require a change in voltage and don't consume, much, if any, current?
MOSFETs require essentially zero gate current, except to charge and discharge the gate capacitance (which can be substantial on large MOSFETs) during transitions.



Forgive my ignorance here, but could you elaborate on how you'd use a resistor to pull the voltage up to +5V? If I'm following the datasheet of the 74LS04 correctly, it outputs ~3.4V when it is a logic high, correct? Would you simply use a pull-up to +5V on the gate of the MOSFET?
An internal emitter follower pulls the output up rapidly to ~3.4V. A resistor from the output to +5V will pull it the rest of the way to +5V.
 

elec_mech

Joined Nov 12, 2008
1,500
I had trouble finding this spec, because it's called IOS, not IOH. If you look at the qualifying note, it says this:
Quote: § Not more than one output should be shorted at a time, and the duration of the short-circuit should not exceed one second.
Doh again. I should have seen the note as well - thank you.

MOSFETs require essentially zero gate current, except to charge and discharge the gate capacitance (which can be substantial on large MOSFETs) during transitions.
Good to know.

An internal emitter follower pulls the output up rapidly to ~3.4V. A resistor from the output to +5V will pull it the rest of the way to +5V.
Thank you again.

And for the OP:
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
Thank you both for your kudos and I'm happy to hear it works well now. In hindsight the solution looks so obvious and simple I don't know how I missed it to begin with. :rolleyes: Always learning I suppose.​

The big question remaining for the OP is . . . do you feel you understand how the circuit works and why some of the circuit variations worked the way they did? Okay, technically two questions.​
 
Top