74F08N current issue for ARDUINO - Page 1
Forum section: electronics / beginners

author: vis5254
author_rank: Contributor
timestamp: April 18, 2019, 07:58:07 am
content: I've a 74F08N AND GATE IC . I checked the datasheet and realised that the output voltage on HIGH condition goes to 5v and when output goes in LOW , current predominates and reach a value of 40mA . ARDUINO UNO digital pin has maximum withstanding capacity of 40mA . So what could be a better way in reducing 40mA to some 20 or 30mA ..??Will a resistor in series will do the job ?

author: Moriambar
author_rank: Unknown
timestamp: April 18, 2019, 09:32:39 am
content: Hi, I actually do not understand how you have connected this to the arduino ie: is it the inputs or the output of the and gate? How is the arduino pin mapped, and how is it physically connected.ThedatasheetI pulled out for a 74F08N specifies an absolute maximum of 40mA when in low state, so my first guess is that something is shorted out or connected wrong...

author: Ian.M
author_rank: Super Contributor
timestamp: April 18, 2019, 10:01:11 am
content: For logic, MCUs etc. as long as the supply voltage is the same and you connect a single output to N inputs*, it typically just works#- the inputs don't draw excessive current from the output. However, you must never directly connect normal outputs%as if they are at different levels, its called contention and excessive current is likely to flow, which will probably damage them if it carries on for long (at a us timescale). If there is a significant risk of contention, a series resistor may help - 330R is a good value for a 5V logic system as it will keep the worst case current under 15mA.* Where N is less than the fanout limit for the logic family you are using.# Provided you make any accommodations required to handle the differing logic levels when interconnecting different logic families e.g a bipolar TTL output will probably need a pullup resistor to drive a 5V standard CMOS input.% The rules for wiring open collector or open drain outputs together are different - its safe, you need a pullup resistor, but the result is only high if *ALL* the outputs are high. If any go low the low level wins.

author: vis5254
author_rank: Contributor
timestamp: April 18, 2019, 10:06:45 am
content: I've a 7805 ic for producing 5v .I was trying to check if my AND would work .. I provided 5v from 7805 as vcc as well as same voltage as 2 input . I'm concerned about the current flow now .

author: Ian.M
author_rank: Super Contributor
timestamp: April 18, 2019, 10:17:31 am
content: When dealing with bipolar TTL chips (basically anything 74nn(n) or 74xxnn(n) where xx doesn't contain the letter C), you need a pullup resistor to take an input to logic '1' as direct connection to +5V risks damaging the chip. 1K is a suitable value. OTOH to take an input to logic '0' you must wire it directly to Gnd, not through a resistor.If you put a separate 1K pullup on each AND input, it should output logic '1'. Add a jumper wire to Gnd to put one of the inputs low, and the output should go to logic '0'.

author: iMo
author_rank: Super Contributor
timestamp: April 18, 2019, 10:25:26 am
content: Wiring the 08's output to an Arduino pin set as output directly is not a good idea.The 08 AND gate has got 2 inputs, wire them to 2 Arduino pins set as output.Do wire the 08 AND gate's output through a 2k-10k resistor to Arduino pin set as input (the resistor will limit the current in case the Arduino pin is set to output as well).Anyhow, 40mA might be deadly for both.

author: vis5254
author_rank: Contributor
timestamp: April 18, 2019, 11:40:19 am
content: I added a pull up resistor 10k . 2 number of 10k for each input and Output went high ! when I grounded , the voltage went low ! But the issue is if I remove both the input, I still receive high voltage across output ! I'm not speaking about grounding ! just removed two input and just gave vcc .

author: Kalvin
author_rank: Super Contributor
timestamp: April 18, 2019, 11:50:37 am
content: Do not leave the inputs floating: Connect all unused inputs either to VCC or to GND with a 1 kohm ... 10 kohm series resistor. One resistor for each input pin.

author: newbrain
author_rank: Super Contributor
timestamp: April 18, 2019, 02:21:19 pm
content: Quote from: vis5254 on April 18, 2019, 11:40:19 amAs said above, do not leave inputs floating.BUT:TTL inputs are at high level when left unconnected, look at the simplified NAND gate below from Wikipedia:With A and B unconnected, current will flow through R1, the directly polarized PN B-C junction of VT1 and similarly through the B-E junction of VT2, so VT2 is conducting and Q is 0 - remember, this is a NAND gate, to get a logic AND another inverting stage is needed.Now, if one of A or B is connected to GND, VT1 will conduct (and saturate), so VT2 will see less than 0.6V across B-E and will switch off, yielding a high output.I still remember when this bit me as a kid...

author: rstofer
author_rank: Super Contributor
timestamp: April 18, 2019, 06:24:23 pm
content: Quote from: vis5254 on April 18, 2019, 07:58:07 amI think you have this all wrong! The 74F08N datasheet on page 3 shows IIH(input current at logic '1') as 40 uA and IIL(input current at logic '0' as -1.6 mA). The minus sign means the current is flowing out of the pin when it is low and the Arduino needs to 'sink' that current. The Arduino can sink as much as 40 mA so there is no mismatch. The Arduino can drive a LOT of gates on one output pin.To get down to the details, if you were driving more than one logic gate from an Arduino output, you would need to see how close to ground the pin could get versus the amount of current it is sinking. There's a chart for that somewhere. Page 313 of the datasheet gives IOLas 20 mA for a 5V device for normal operating conditions.If you are using the 74F08N to provide an input to the Arduino, you would look at IOHand realize it can only source 0.8 mA. No problem! The input current for an ATmega328 pin is just 1 uA = page 313https://www.sparkfun.com/datasheets/Components/SMD/ATMega328.pdfIt is sometimes useful to put a 330 Ohm resistor in series with uC pins to protect against misconfiguration and sometime to slow down the edges (less reflection and EMI). There is a reason that uC pins come out of reset as 'input'. This prevents short circuiting devices that are driving the pin as an input and would be unhappy driving against an output. The resistor is useful in protecting the hardware engineer's beautiful design from the vagaries of a programmer! They can still screw it up but they have to work at it.