Amperage too high? (solved)

Hey,
currently I'm working with my arduino uno on an 6x7 LED table for school. I use I2C port expanders(mcp23017) to control these RGB LEDs. (You can find a draft of my circuit diagram at the attachments or here: http://i.imgur.com/PgKxKyM.png) As you can see the circuit is parallel, so the amperage increases. My question would be how high would the amperage go and what can I do prevent my arduino from getting destroyed?
Some additional information:
Arduino Uno output U:5V I:20mA
RGB LED: Red: max. U:2V at 20mA
Blue, Green max. U:3V at 20mA

Thanks for your answers in advance.
Jakub

As you can see the circuit is .....

Complete wrong.

You need one resistor with each LED colour. That is like you have in the red only on the blue and green as well. Also loose the resistor the other side ( common connection ) of the LED. If you have 42 RGB LEDs then you will need 42 * 3 = 126 resistors.

So with a proper circuit you would draw 20mA per LED colour to give you 43 * 3 * 20 = 2520mA or 2.52 Amps. This is way way more that an Arduino 5V line can supply.

Thanks for your answer.

Grumpy_Mike:
This is way way more that an Arduino 5V line can supply.

Is there a solution to this problem?

Is there a solution to this problem?

Yes use an external power supply.

By the way what is the Arduino doing here, just acting as a power supply?

I use the Arduino to toggle the LEDs off and on. Is something wrong with it?
Moreover my teacher told me to inform about transistors, are they a possible solution as well?

I use the Arduino to toggle the LEDs off and on.

That was not shown on the schematic you just had the LEDs going to a battery. Can you draw a schematic of what you actually have or want.

An Arduino output pin should not be asked to drive more than 40mA, and there is a total chip limit as well of 200mA for all the outputs added together. Further more there are group limits on ports.

Once we find out what you actually want to do we can talk about soloutions but at the moment this is a X-Y Problem

jakub014:
transistors, are they a possible solution as well?

Like this?

Grumpy_Mike:
That was not shown on the schematic you just had the LEDs going to a battery. Can you draw a schematic of what you actually have or want.

Im apologizing for my vague question. You can find a more detailed version of the circuit at the attachments. This schematic shows only 1 port expander, in reality it should have 8.

JimboZA:
Like this?

So in my case I would need an external power supply and 126 transistors(to toggle each color of the leds), or am I thinking wrong?
I also was thinking about what kind of power supply do I need and how do I connect the LEDs with it?

Besides, thank you for helping me.

If you are using port expanders and only driving one colour LED from each of the port expanders that would be fine. The 5V would be supplied from an external power supply with the ground connected to the Arduino ground.

These days I would advise using Neopixel LEDs either as a strip or as individual 5mm LEDs. It is way the simplest solution.

Im sorry if this is a dumb question but do I need something like this: https://www.antratek.de/usb-adapter-5v-2a?gclid=COjfvKbIvcsCFQhuGwod7r0DLw
And if I need this one, how do I connect it to my circuit?
Im wondering also why RGB LEDs and common LEDs make a difference in this circuit?

There is no difference; in principle each LED needs a resistor. In an RGB LED you have three LEDs so you need three resistors.

With a single LED, it does not matter if the resistor is connected to the anode or the cathode (although there might be design considerations to use one over the other).
Because a RGB LED has one common pin, you can not connect the three resistors to that pin (as they will be shared between all LEDS) so you have to connect the resistors to the other three pins.

Each LED either needs a constant current drive, or a resistor. Some LED driver chips do constant
current drive and resistors would not be needed.

but do I need something like this: https://www.antratek.de/usb-adapter-5v-2a?gclid=COjfvKbIvcsCFQhuGwod7r0DLw

Yes.

And if I need this one, how do I connect it to my circuit?

Connect the ground to the Arduino ground and the +5V to the +5V power supply of your port expanders.

Thanks for your answers

Im sorry to bother you even more, but now I got 3 (hopefully final) questions:

Grumpy_Mike:
Connect the ground to the Arduino ground and the +5V to the +5V power supply of your port expanders.

  1. If I do so, I don't need transistors, right?

  2. What kind of port do I need for this power supply and with what kind of port can i connect it to my circuit.

  3. Is it possible to supply my arduino with it as well?

  4. Would the external supply deliver 2.5A to each expander(Im not sure if the expander can handle this) and would this circuit be parallel as well?(else, how would it look like?)

  1. If I do so, I don't need transistors, right?

If you go with that last schematic with 8 port expander chips then no need for extra transistors.

  1. What kind of port do I need for this power supply

I have no idea what you mean by this.

  1. Is it possible to supply my arduino with it as well?

Yes.

Would the external supply deliver 2.5A to each expander

No, the total current it can supply would be 2.5A and that includes your Arduino.

and would this circuit be parallel as well?

I am not sure what you mean but I guess no.

You do know you will only be able to get 7 colours from those RGB LEDs with that circuit don't you?

How much current dose the MCP23017 supply? I don't think is will source or sink 20 mA. You need an additional buffer like ULN2803A connected to MCP23017.

There's also common anode and common cathode rbg leds. I would go with common anode.

@Grumpy_Mike

Grumpy_Mike:
I have no idea what you mean by this.

I have literally no idea which parts I need to connect an appropriate adapter with my circuit. (I mean what kind of cables, ports if possible with links)
Also Im kinda confused of the circuit of the external power supply, I made a raw version of what Im thinking about :

Grumpy_Mike:
You do know you will only be able to get 7 colours from those RGB LEDs with that circuit don't you?

Yup, I do.
@Gerry48

Gerry48:
How much current dose the MCP23017 supply?

all combined outputs of one MCP23017 cannot exceed 150mA sink current and
one port can sorce or sink a max of 25ma
the MCP23017 has 16 Ports

btw I can't thank you all enough for helping me.

You need to either cutoff the end of the USB connector and wire up the + and -, or you need to get a USB socket to plug it into and wire it up that way.

Or get an external 5V supply with wire ends as the output.

Vdd = 150 ma, that absolute maximum. I'm assuming you want to connect 5 rgb leds to the port extender. That means each port must get less than:

I_port = 150 mA / 15 = 9.4 mA (this assumes all leds can be on at the same time)

If only one of the 3 leds per package is on at a time then:

I_port = 150 mA / 5 = 30 mA

The leds need about 20 mA each. That means the MCP23017 will work without an additional driver if you limit active leds to 5 per port extender. You also need common anode grb leds. Do not get common cathode leds.

Connect the anode lead of all 5 led packages together. That connection goes to +5V of your external power supply. Each red cathode lead connects to a 150 ohm resistor. Each blue and green cathode lead connects to a 91 ohm resistor. The other end of the resistors goes to a separate expander port. The ground of the external power supply goes to MCP23017 ground. The resistor is sized to provide 20 mA to each led.

Just to be clear, each MCP23017 should not have more than 5 leds on at a time. You don't want to get close to the absolute max rating of 150 mA.

jakub014:
@Gerry48all combined outputs of one MCP23017 cannot exceed 150mA sink current and
one port can sorce or sink a max of 25ma
the MCP23017 has 16 Ports

Gerry48:
How much current dose the MCP23017 supply? I don't think is will source or sink 20 mA. You need an additional buffer like ULN2803A connected to MCP23017.

There is no need for this. If you look at the schematic the OP posted you will see he is running the LEDs at nothing like 20mA. With a 330R current limiting resistor the the red LED is drawing 9mA and the green and blue 6mA each. So that is 15mA per RGB LED. So for 5 RGB LEDs on one port it is only supplying 75mA. No need for any extra buffering.

There's also common anode and common cathode rbg leds. I would go with common anode.

Totally irrelevant, you can source or sink current with the MCP23017. In fact a mixture of sourcing and sinking would allow the LEDs to be driven at a higher current without exceeding the absolute limits on the chip.

Just to be clear, each MCP23017 should not have more than 5 leds on at a time.

Rubbish, you haven't looked at the OP's actual circuit, all the LEDs can be on at once if he uses the resistors in his own schematic.

The leds need about 20 mA each.

No they don't. The 20mA current is the maximum they should be allowed to take not what they need.