Arduino One - Schematic Design Pin Current limitations

Hi all, I'm new to this forum.

I've searched this topic extensively thorough the web, but I can't find out a proper how-to guide that explains the nitty gritty details.

It is written that on Arduino One each pin should have a max current of 40mA (30mA better) and that the overall current flowing through the chip at any time should be less than 200mA.

Most websites make an example of a simple circuit with a red led connected to a pin out. A red led consumes 2.0V, using a Resistance of 330Ohm the current flowing through the pin is 10mA. [ = (5.0 - 2.0)/ 330]

Now, what happens for more complex scenarios?

I have some ideas on the matter, but no clue whether I'm doing it right or not.

  • 3 leds on 3 different pins each with its own resistance => each consumes 10mA, the total current through the chip is 30mA.
  • 2 leds in sequence + 330 ohm resistance => I should compute (5.0 - 2.0 - 2.0) / 330 = 3 mA of current ...is this right? i smell an error here, but dunno. Do I really have to use the remaining voltage or rather the voltage drop to compute the amount of current flowing through the pin?

Now let's go harder.

Leds are rather "easy" to think of once settled up the doubts above. But what happens with with more complex devices?

An IR sensor with 3 connectors, 1 for vin, 1 for gnd and 1 for the sensed data, how many resistor does it need? Should I put one only in front of the vin? should I put one on the sensed data pin too? how do I compute the amount of current/load it imposes on the microchip?

And to make things harder.. how does this story work at all in respect to LCD display? these have something like 8 cables to be connected to the arduino board, some as outputs and other as inputs.. I have an HD44780U, onto its datasheet it's written that it can support from 2.7V to 5.5V of supply and nothing more.. so what resistance should I put and where? and more importantly, how do I compute the amount of current it flows around due to this device being connected to arduino?

I would like to learn how to design these circuits properly with some mathematical background in mind, I am not scared of learning some equation, but I can't find out on my own a proper source for this stuff.

Any so kind to explain me the basic stuff or point me some good reference? Thank you so much.

Any module that wants power wants constant voltage supply, usually either 5V or 3.3V,
no resistors are involved. The module or circuit is expressly designed to work from a
given voltage. Your LCD module would be connected to 5V. Or perhaps 3.3V if
using a 3.3V Arduino like the Due. No resistor in the power connection, that would
lead to problems in fact.

An LED isn’t a whole module or circuit, its just a semiconductor diode.

Consider your 2V red LEDs (actually they are usually 1.7 to 1.9V, but lets keep the
maths simple).

Roughly speaking the voltage across the LED when its lit up is 2V, that’s the
forward voltage spec. (More accurately the voltage will be a bit higher for
larger currents, but is definitely not proportional to the current like in a resistor).

So we use this “fact” to calculate the remaining voltage:

One LED from 5V leaves 3V across R, so current = 3 / R.

Two LEDs from 5V leaves 1V across R, so current = 1 / R.

In the first case a 300 ohm resistor would give 10mA, in the latter a 100 ohm
resistor would give 10mA.

MarkT: Any module that wants power wants constant voltage supply, usually either 5V or 3.3V, no resistors are involved. The module or circuit is expressly designed to work from a given voltage. Your LCD module would be connected to 5V. Or perhaps 3.3V if using a 3.3V Arduino like the Due. No resistor in the power connection, that would lead to problems in fact.

Thank you very much, that is compliant with what I've seen on many tutorials around. Then I stepped onto this document http://pgdev.pighixxx.com/ABC/SET/s4.pdf that on page 3 added some resistances and it made think about it. The one on pin 15 is clearly for the embedded LED, the other one on VIN/GND is for..?

By the way, do you know how do I compute the current cost this component puts on the microchip in respect to the overall 200mA available?

MarkT: An LED isn't a whole module or circuit, its just a semiconductor diode.

Consider your 2V red LEDs (actually they are usually 1.7 to 1.9V, but lets keep the maths simple).

Roughly speaking the voltage across the LED when its lit up is 2V, that's the forward voltage spec. (More accurately the voltage will be a bit higher for larger currents, but is definitely not proportional to the current like in a resistor).

So we use this "fact" to calculate the remaining voltage:

One LED from 5V leaves 3V across R, so current = 3 / R.

Two LEDs from 5V leaves 1V across R, so current = 1 / R.

In the first case a 300 ohm resistor would give 10mA, in the latter a 100 ohm resistor would give 10mA.

That's fine, thank you for clarifying this. Do you happen to know how do I compute the mA weight of an IR sensor? :)

Bump! ...sorry to do this, but my post got 3-4 pages away and I still don't have a proper explanation and the issue is open. :roll_eyes:

The 270R resistor is for the LCD's backlight LED and so needs a resistor. the other is Not a resistor but a pot for supplying a varying voltage to the contrast pin.

Anything connected to the 5V line takes no current out of the chip, it takes it direct from the USB or from the voltage regulator.

If the IR sensor is connected to power and ground that takes no current from the chip. The ammount of current it will take from the supply is given in the data sheet.

When an output pin is connected to something it can be powering it, like an LED or it can be controlling it like an LCD. When it is controlling then the current drawn is very small normally less than 1mA, it will tell you the exact figure in the data sheet. It is only powering things that you have to worry about the pin current.

Grumpy_Mike: When an output pin is connected to something it can be powering it, like an LED or it can be controlling it like an LCD. When it is controlling then the current drawn is very small normally less than 1mA, it will tell you the exact figure in the data sheet. It is only powering things that you have to worry about the pin current.

Ok, thank you that explains a lot indeed. I think now I can proceed with my circuit with a fair less fear of damaging my components.