Author Topic: 74F08N current issue for ARDUINO  (Read 1379 times)

0 Members and 1 Guest are viewing this topic.

Offline vis5254Topic starter

  • Contributor
  • Posts: 12
  • Country: in
74F08N current issue for ARDUINO
« on: April 18, 2019, 07:58:07 am »
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 ?
 

Offline Moriambar

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: 74F08N current issue for ARDUINO
« Reply #1 on: April 18, 2019, 09:32:39 am »
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.
The datasheet I 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...
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: 74F08N current issue for ARDUINO
« Reply #2 on: April 18, 2019, 10:01:11 am »
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.
 

Offline vis5254Topic starter

  • Contributor
  • Posts: 12
  • Country: in
Re: 74F08N current issue for ARDUINO
« Reply #3 on: April 18, 2019, 10:06:45 am »
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 .
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: 74F08N current issue for ARDUINO
« Reply #4 on: April 18, 2019, 10:17:31 am »
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'. 
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 4780
  • Country: pm
  • It's important to try new things..
Re: 74F08N current issue for ARDUINO
« Reply #5 on: April 18, 2019, 10:25:26 am »
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.

 

Offline vis5254Topic starter

  • Contributor
  • Posts: 12
  • Country: in
Re: 74F08N current issue for ARDUINO
« Reply #6 on: April 18, 2019, 11:40:19 am »
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 .
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: 74F08N current issue for ARDUINO
« Reply #7 on: April 18, 2019, 11:50:37 am »
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.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: 74F08N current issue for ARDUINO
« Reply #8 on: April 18, 2019, 02:21:19 pm »
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 .
As 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... :blah:
« Last Edit: April 18, 2019, 03:29:10 pm by newbrain »
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: 74F08N current issue for ARDUINO
« Reply #9 on: April 18, 2019, 06:24:23 pm »
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 ?

I 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 IOL as 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 IOH and realize it can only source 0.8 mA.  No problem!  The input current for an ATmega328 pin is just 1 uA = page 313

https://www.sparkfun.com/datasheets/Components/SMD/ATMega328.pdf

It 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.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf