Author Topic: Floating inputs cause AND circuit to produce High? Why? 60 second video.  (Read 997 times)

0 Members and 1 Guest are viewing this topic.

Offline renzomsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • I post everywhere lol
    • YouTube Channel
https://youtu.be/XRKPNVEovEM

I tied two NAND gates to make an AND gate. The inputs of the first NAND are tied together too.

When left alone, the LED seems to react to movement SOMETIMES. Sometimes it just stays off too. Video shows the phenomenon  :wtf: :scared:
« Last Edit: December 16, 2021, 04:16:02 pm by renzoms »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #1 on: December 16, 2021, 05:13:17 pm »
The output of a logic gate is not defined for floating inputs.  You need to be below the logic 0 threshold or above the logic 1 threshold.  Get the values from the datasheet.
 
The following users thanked this post: tooki

Offline Picuino

  • Frequent Contributor
  • **
  • Posts: 730
  • Country: 00
    • Picuino web
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #2 on: December 16, 2021, 05:52:07 pm »
 
The following users thanked this post: renzoms

Online IanB

  • Super Contributor
  • ***
  • Posts: 11898
  • Country: us
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #3 on: December 16, 2021, 06:05:32 pm »
https://youtu.be/XRKPNVEovEM

I tied two NAND gates to make an AND gate. The inputs of the first NAND are tied together too.

When left alone, the LED seems to react to movement SOMETIMES. Sometimes it just stays off too. Video shows the phenomenon  :wtf: :scared:

You should be careful. When I was young (many years ago) and learning about digital logic, the industry was making the transition from TTL logic to CMOS logic. TTL was very robust and safe, but CMOS was sensitive to static. It was a golden rule never to leave inputs floating because of the danger of damaging the chip.

Maybe today the chips have clamp diodes for input protection, but there still may be a danger. It is a pretty good rule of thumb to avoid floating potentials in any circuit. Always make sure your voltages are well defined. If you know where your voltage is, you can avoid it going where it shouldn't be.
 
The following users thanked this post: renzoms

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #4 on: December 16, 2021, 06:37:15 pm »
.
« Last Edit: August 19, 2022, 04:53:20 pm by emece67 »
 

Offline renzomsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • I post everywhere lol
    • YouTube Channel
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #5 on: December 16, 2021, 07:39:39 pm »
Picuino, Thanks. I think that solves it.

rstofer, Thanks. Good to know. I checked the data sheet and think it's 2V (threshold High). I think my body was produced the signal. (I am not grounded 😈).

IanB, Thanks. I will keep those clamping diodes for input protection in mind, I'm working towards experimenting/building something with those.

emece67, 7400. The circuit: Both inputs of a NAND tied to an input (floating/5V/ground). Then the output of that NAND becomes the input to both inputs of another NAND. Effectively an AND gate (with it's inputs tied together). 664 ohm resistor. 3V LED. 5V source.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #6 on: December 16, 2021, 09:18:32 pm »
The answers are in the datasheet!

For a standard 7400, the logic 1 threshold is 2.4V, we need to be above that.  So, we tie a 10k resistor between the input and +5.  There's actually a reason for pulling high rather than low.  The input high current is 40 uA and the input low current is -1.6 mA.  It's negative because the current is flowing out of the pin.  That's 40 times more current!

But look at the logic 1 output current!  It's just -0.4 mA, sourcing so it couldn't pull the pin high against the resistor to ground.  OTOH, the gate can sink (pull down) 16 mA so the pullup current is no problem.  That's the reason that we ALWAYS used pull-up resistors and almost never pull-down resistors.

It all comes down to numbers and datasheets:

https://web.mit.edu/6.131/www/document/7400.pdf

This is less of an issue with CMOS but it still better to define a logic level.  Floating CMOS inputs tend to create oscillation and heating.
 
The following users thanked this post: renzoms

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #7 on: December 16, 2021, 09:46:59 pm »
.
« Last Edit: August 19, 2022, 04:53:27 pm by emece67 »
 
The following users thanked this post: renzoms

Offline renzomsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • I post everywhere lol
    • YouTube Channel
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #8 on: December 17, 2021, 04:46:08 am »
rstofer, Thanks for that - helping me out. Learned a lot and understood clearly.

emece67, Interesting I will keep that in mind as I cross that (TTL) in the text. Thanks.
 

Offline gcewing

  • Regular Contributor
  • *
  • Posts: 197
  • Country: nz
Re: Floating inputs cause AND circuit to produce High? Why? 60 second video.
« Reply #9 on: December 17, 2021, 06:21:56 am »
Modern CMOS inputs are usually fairly well protected against ESD, but it's still a really bad idea to leave them floating. They have very high impedance and will happily respond to any stray electric fields in the vicinity. Not only does this lead to unpredictable behaviour, if the input hangs around between the high and low thresholds for very long, the top and bottom transistors both turn on, which can pass excessive current and overheat the chip.

TTL inputs will float high very predictably, but it's still recommended to use a pullup resistor of 1k-10k or so for noise immunity.
 
The following users thanked this post: renzoms


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf