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 I
IH (input current at logic '1') as 40 uA and I
IL (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 I
OL 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 I
OH 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.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.