Pages: [1]   Go Down
Author Topic: Using a simple AND gate ic  (Read 1313 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im using the 74LS08 quad AND gate, in a simple circuit connecting it to a dip switches, but it doesnt seem to work, do i need pull up or pull down resistors and why?
Logged

Germany
Offline Offline
Faraday Member
**
Karma: 59
Posts: 3089
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

do i need pull up or pull down resistors and why?
The dip switch is just an open/close switch, but the signal needs to be HIGH/LOW, not HIGH/undefined
So yes, you need a pulldown, if the swich supplies HIGH when on.

Any unused input pin of an AND gate has to be high, too.
Alternatively, you can supply a signal to more than one pin.

Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thankyou, but what i dont understand is that if i dont connect my inputs to anything the gate takes that as a HIGH. so i have just connected the dip switch to ground without any resister and it is working fine.
Logged

Germany
Offline Offline
Faraday Member
**
Karma: 59
Posts: 3089
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

from http://www.kpsec.freeuk.com/components/74series.htm regarding 74LS...

Quote
Inputs 'float' high to logic 1 if unconnected, but do not rely on this in a permanent (soldered) circuit because the inputs may pick up electrical noise. 1mA must be drawn out to hold inputs at logic 0. In a permanent circuit it is wise to connect any unused inputs to +Vs to ensure good immunity to noise.


For the 74HC.. series ( less power requirements in amount and regulation, slower ) pulling inputs is more important, I agree.
« Last Edit: May 15, 2012, 11:58:15 am by michael_x » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can someone please help me to connect a 74LS08 quad and gate to a dip switch? I cant seem to understand how the pull up or pull down resistors work. i want the inputs to go to low when the switch is off and high when the switch is on.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of switch? Momentary On push button that is normally open?
3-pin toggle switch with normally open, common, normally closed pins?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its a dip switch like this one:

Logged

Chester, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This: http://en.wikipedia.org/wiki/AND_gate and this: http://en.wikipedia.org/wiki/Pull-up_resistor are good articles and should answer your question.
Logged

“Everything should be made as simple as possible, but no simpler.”

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27418
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Lets assume that "Switch on" = switch is in the closed position (pins connected to each other).

In that case, you need a pulldown resistor from the pin to ground, one side of the switch connected to a pin, and the other side connected to +5V.
When the switch is on, the pin is connected to +5, and when the switch is off the pin is pulled low.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Shannon Member
****
Karma: 220
Posts: 12702
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 74LS series are TTL - they need pullups of around 1k or so on inputs to guarantee reading high and you MUST NOT connect inputs directly to 5V...
To pull down you need a hard pull-down (ie use a 1k pull-up to 5V and the switch to ground, not the other way round).

Also you have to use pull-ups on a TTL output when its driving a CMOS chip like the ATmega to guarantee that an output HIGH will be seen as HIGH (it will probably work most of the time without, but it is not guaranteed I believe).  TTL levels are not symmetric.

74HC series are the modern CMOS pin-for-pin equivalent, and pullups and pulldowns of 10k to 100k will work fine - avoid TTL if you can, its more expensive as well as slower, power-hungry and difficult to interface to.
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Melbourne, Australia
Online Online
Brattain Member
*****
Karma: 511
Posts: 19308
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please don't start two threads within a few hours of each other about AND gates. Just let the answers flow in from the helpful people here. smiley

Threads merged.
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

0
Offline Offline
Shannon Member
****
Karma: 220
Posts: 12702
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can someone please help me to connect a 74LS08 quad and gate to a dip switch? I cant seem to understand how the pull up or pull down resistors work. i want the inputs to go to low when the switch is off and high when the switch is on.



That's not easily doable with TTL as I've mentioned - ideally use push-to-break rather than push-to-make switches, or else feed the switches through inverters.

The problem is that TTL inputs are not really rated for connecting to +5V except through a resistor - the breakdown voltage of the input transistor is only 5.5V (bit close for comfort).   The good news is that I've done a bit more research and the LS series of TTL is more robust in this respect, so you should be able to get away with it - the input transistors can handle upto 7V

You will need a pull-down resistor as low as about 680 ohms though, to pull the inputs properly low, 1k might be a bit too large.

[ and the standard caveat - 0.1uF ceramic decoupling capacitor for every logic chip ]

Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: