74LS04 (Logical NOT) Problems

Why doesn't the following work?

Also, you should be aware that 74LS-series have inputs that "float high."
So in the picture above (assuming the switch connects to an input), when the switch is pushed the input is forced high by the current through the switch, but when the switch ISN'T pushed, the input floats high. The output will always be low...

And the LEDs are backward - you moved the power-side lead from +V to GND, but that's the anode so it needs to be at the higher voltage.

And there should be current-limiting resistors...

a 74LS04 will light up an LED in both states, just fine.

A modern equivalent chip is a 74HC04 or 74HCT04.

larryd:
74HC04 AND 74HCT04

https://assets.nexperia.com/documents/data-sheet/74HC_HCT04.pdf

Thanks, Those look exactly like what I need.

westfw:
Also, you should be aware that 74LS-series have inputs that "float high."
So in the picture above (assuming the switch connects to an input), when the switch is pushed the input is forced high by the current through the switch, but when the switch ISN'T pushed, the input floats high. The output will always be low...

Adding a pulldown resistor to the switch-input does not work. I am going to believe that it is simply not possible because either the current is not enough or the inputs are "open emitters", maybe both.
The 74HC04 seems to offer 50mA Current compared to the 74LS04 which offers -0.4mA.

King_bob:
The 74HC04 seems to offer 50mA Current compared to the 74LS04 which offers -0.4mA.

I cannot see in the datasheet anywhere where you can interpret "to offer 50mA Current".

Perhaps more to the point, how about you explain exactly what it is you want to do with such a circuit and why a logic IC has anything to do with it, before we spend further effort advising? :astonished:

It is not an unreasonable question. :roll_eyes:

I have never read an Arduino forum thread with so much bad information in it.

  1. the 74LS04 has not got an open collector output.
  2. like all LS logic if nothing is connected to an input it “floats” high, so connecting an input through a switch to 5V will do sod all.

The 74HC04 seems to offer 50mA Current compared to the 74LS04 which offers -0.4mA.

Is a total nonsense.

Adding a pulldown resistor to the switch-input does not work.

Yes it does, only if you actually read the spec of what constitutes a logic zero you can calculate that you need a resistor smaller than about 220R to effect a pull down.

Grumpy_Mike:
4) Yes it does, only if you actually read the spec of what constitutes a logic zero you can calculate that you need a resistor smaller than about 220R to effect a pull down.

You are correct, a 220 pull down works. Could you please tell me how you calculated/got to this conclusion?

Ohm's law.

But really, I would rather you answered #22. :grinning:

King_bob:
You are correct, a 220 pull down works. Could you please tell me how you calculated/got to this conclusion?

Can you post your new "circuit" please?
Thanks.. Tom... :slight_smile:

To calculate the pull-down value for LS logic, you divide the maximum permissible "LOW" voltage VIL (0.8 V) by the maximum pull-down current IIL (1.6 mA) to give a value of 500 Ohms. 470 Ohms is commonly used.

However Mike is using an "anti-fudge" (safety) factor of 2¼.

Or actually, now that I check, he is actually using the VIL value of 0.4 V instead, which corresponds to the older 7400 series logic. :grinning:

Unfortunately I need it for one of my projects.

We don't know the details of your project, but if you have several unused inverters and you need logic 1 to illuminate the LED, logic 0 to turn it off, then yeah, this is possible.

For each LED:

  1. Connect 2 inverters in series
  2. Connect the led so its always on: 5V > R > +LED- > GND
  3. Connect the LED anode to the output of the second inverter

Of course, if using only one inverter, logic 1 turns off the LED, logic 0 illuminates it.

TomGeorge:
Can you post your new "circuit" please?
Thanks.. Tom... :slight_smile:

The working circut:

Paul__B:
Ohm's law.

But really, I would rather you answered #22. :grinning:

I am using it to modify a GRBL Shield, in order to manually Disable/enable the steppers one at a time. The inverse logic is to enable the stepper driver (LOW) while turning on an LED (HIGH) and vice versa.

The working circut:

So you have taken no of the advice given here. Why do you bother asking a question if you are going to ignore the answer?

No resistors in the LEDs.
And a pull down resistor where one is not needed if you wire the switch correctly and use one of the five unused inverters.

We would be abrogating our responsibility if we did not point out how error ridden and temporary the is functionality is.

Grumpy_Mike:
So you have taken no of the advice given here. Why do you bother asking a question if you are going to ignore the answer?

Your advice was to place 220 the pull down resistor. I did it and it solved the issue.

Grumpy_Mike:
And a pull down resistor where one is not needed if you wire the switch correctly and use one of the five unused inverters.

You said nothing about this. Please explain if you are going to bring up a different solution.

King_bob:
The working circut:
I am using it to modify a GRBL Shield, in order to manually Disable/enable the steppers one at a time. The inverse logic is to enable the stepper driver (LOW) while turning on an LED (HIGH) and vice versa.

I'm late to the thread. But in many circumstances you would not need any IC at all to do that. Usually you can add an indicator LED directly to an enable line, if the LED current is not excessive. If your enable line is active low, you can wire the LED cathode to the enable line, and the anode to a resistor connected to Vcc. Some boards have that circuit on the onboard LED. The pin that is connected to it is still usable for output.

King_bob:
You said nothing about this. Please explain if you are going to bring up a different solution.

Not me but others, I had assumed you were taking notice.

From reply #2

You MUST put resistors in series with your LEDs, about 220 Ohms or so. You have probably popped the LED connected to the button.

From reply #28

We don't know the details of your project, but if you have several unused inverters and you need logic 1 to illuminate the LED, logic 0 to turn it off, then yeah, this is possible.

For each LED:

  1. Connect 2 inverters in series
  2. Connect the led so its always on: 5V > R > +LED- > GND
  3. Connect the LED anode to the output of the second inverte

Hi,
This might be clearer as to what you need, the two 150R or you can try 220R resistor in each of the LED circuits to limit the LED current.

One of the rules of TTL is never connect an input to Vcc directly, always use a series resistor.

This is because the inputs will fry at just over 5V, which is far too close to Vcc for safety.

TTL is dead in the water as a technology, though you can still buy 74xx and 74LSxx chips
for legacy repairs.

Much much better to use CMOS, like 75HC04

However as we are talking TTL, specifically LS TTL:

Inputs that are not from another gate should either connect to ground or to a ~10k resistor to Vcc.
Typically a switch would be wired to ground with a 10k pull-up resistor to meet this constraint.

LS TTL can only sink useful amounts of current, so LEDs/resistors are wired between an output
and Vcc, not between the output and ground....

I think if I remember that far back the sourcing current is limited to a few 100µA, basically nothing!

TTL outputs do not rise much above 3.5V... Not enough voltage to drive a white LED to ground
anyway, even if it could provide enough current.

TTL totem pole outputs are not symmetric like CMOS ones. You can view a TTL output as open
collector plus a pull-up resistor built in, and you'd not be far wrong.

[ Here's how to do it:

Don't forget supply decoupling as required by any logic chip ]

Over the years I.C. manufactures recommended to not connect TTL inputs to 5.5 volts (VCC).

From a huge amount of field experience, I have observed that old TTL equipment designers did not adhere to this advice.

I have never (never) come across I.C. damage from tying inputs to VCC.

In fact, the LS family inputs have a Schottky diode on the input which precludes any problem of reverse bias damage.

Refer to the attached equivalent circuit of the TTL family.

It appears VCC on the input cannot reverse bias/damage an input as the gate has VCC as its power supply.

Although in my old designs, I tie (tied) unused inputs to a unused output, tying them to VCC can be done as well.

Case in point, as I have mentioned equipment manufactures 'have done this' and (in my experience) 'gotten away' with doing so.