# Amperage too high? (solved)

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.

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.

Take it easy there Grumpy. I've seen the circuit. You can't assume anything is correct. This is the datasheet of your typical rgb led.

http://cdn.sparkfun.com/datasheets/Components/LED/YSL-R596AR3G4B5C-C10.pdf

Typical current is 20 mA. Typical voltage drop is 2.0V for red and 3.2V for green and blue.

And if you had looked at the MCP23017 datasheet you would have seen absolute maximum source current is 125 mA while sink current is 150 mA. In general, circuits can sink more current than they can source. That's why it's better to use common anode leds.

No rubbish here. The OP wanted to use a 330 ohm resistor. According to the datasheet 90 ohms is in order. Unless it's a very dark room, the leds won't be visible.

@Grumpy_Mike I'm very grateful for clarifying these issues.

I hope these will be my last questions:

1. Im still not 100% sure about how to connect the power supply with my circuit and wanted to ask wether the following rough draft with only 2 Expanders of what Im thinking is right or wrong:
2. Do I need a 5V 2.5A adapter or less ampere because:

Grumpy_Mike: With a 330R current limiting resistor the the red LED is drawing 9mA and the green and blue 6mA each. So that is 21mA per RGB LED. So for 5 RGB LEDs on one port it is only supplying 105mA.

1. If I connect an adapter via USB with this: https://www.flikto.de/products/usb-type-a-female-breakout (I hope it's a suitable part) Then how do I connect my arduino with it?(what kind of wire/port or component do I need to buy) @Gerry48 I already have RGB LEDs with a common cathode, but they work fine with 330ohm resistors Thanks for helping me once more

Unless it's a very dark room, the leds won't be visible.

Ah I see you specialise in crap then. That is even a bigger load of rubbish than your previous post. We have standards of advice here and your advise drops well below what is expected.

1) very wrong. The negative of the external power supply must be connected to ground. All the reset lines should be connected together and toggled with an output pin.

2) it does no harm having a power supply that is capable of more current than you need. It is often a good idea to to run them at only 80% full capacity.

3) connect the Arduino power via e 5V line on the Arduino.

Thanks again,

just to be sure, is this circuit right?

and im really really sorry for bothering you with such foolish questions but I still did not understand how to supply my arduino. I mean you have these arduino ports:

and as far as I understood I just need a usual wire going to which port? Or am I completely wrong?

You have to draw that schematic better. It looks like A0 is connected to Vcc and that the plus of the battery is connected to the plus of the Arduino. So it needs to me cleare what is connected to what. To supply your Arduino with an external supply connect the gnd to the supply negative and the 5V regulated supply positVe to the 5V pin.

Grumpy_Mike: You have to draw that schematic better.

I hope this is better: The red marked wires are + blue - The expander pins A0,A1,A2 define the I2C adress, otherwise I could give them input with another 5V supply from the arduino (if thats possible) And just to be 100% sure to connect the supply to the right arduino port, you mean this one:

Edit: Im still wondering if 2.5A is ok for my project because: 1 LED 21mA 42*21mA=0.882A 0.882A+Arduino current is still about 1 A I think, so does it matter that I have like 1.5A too much or do I need that much current?

Grumpy_Mike: it does no harm having a power supply that is capable of more current than you need. It is often a good idea to to run them at only 80% full capacity.

in my case it would be like 40% of full capacity is that ok?

The only thing missing from that diagram now is the 0.1uF ceramic capacitor between the Vdd and Vss pins on each expander chip, and the missing 4K7 resistors pulling up the I2C lines.

in my case it would be like 40% of full capacity is that ok?

Even better.

And just to be 100% sure to connect the supply to the right arduino port, you mean this one:

Yes. I would disconnect the external circuit and the external power supply when you are uploading code and then reconnect it when you have removed the USB connection.

Grumpy_Mike: The only thing missing from that diagram now is the 0.1uF ceramic capacitor between the Vdd and Vss pins on each expander chip, and the missing 4K7 resistors pulling up the I2C lines.

Im a bit confused now, can you explain me what these components do? Furthermore:

Grumpy_Mike: 0.1uF ceramic capacitor between the Vdd and Vss pins on each expander chip

what do you mean with between, I was thinking there are 2 different wires, should I connect them with these Capacitors?

what do you mean with between,

One end of the capacitor to the Vdd and the other end of the capacitor to Vss. It is decoupling and is not an option it is essential. See:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

can you explain me what these components do?

I2C works by the chips pulling down the signal wires. The resistors pull up the line when no chips are pulling them down. The Arduino does enable the internal pull up resistors on these two lines but they are no where close to being low enough. Without them the signals are severely degraded. Again this is not an option but a must do. See:- http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors

as far as I understood, I need 2 4k7 ohm resistors at the beginning of the SDA and SCL line and 8 0.1uF ceramic capacitor, right?

Right. The resistors can be fitted anywhere, from the signal line to +5V, the position doesn't matter.

I’ve got 2 questions left:

can I use the capacitors in a breadboard like this (imagine the resistor would be a capacitor):

Do I have to care about the rating of a capacitor, because this one has a rating of 50V

and I would use this to connect my adapter with the circuit. But Im wondering what is + and - there, and can I just put the - straight into the ground of this component?
A little question I have as well is wether I need adjust my arduino for the power supply at the 5V pin.

Yes you can put components directly into the bread board like that. For the capacitor cut the leads short.

Yes you could use that board if you get a lead that delivers power like that. I think normally it is the type B that receives power not the type A

No preparation is needed to drive the Arduino with the +5V line.

@jakub014, Why are you doing this ? Is this a school project ? Based on the schematics you posted and the questions you asked, you have little experience with electronics. Are you a hobbyist or electronics student ?

@raschemmel Unfortunately my IT teachers came up with the idea to make an arduino project over some months. We barely had any experience about electronic and arduino at the beginning. Additionally our teachers just gave us 2 lessons about electronics and 8 about arduino basics in general. So, Im apologizing for beeing such a difficult case, I thought it would be easier to control some LEDs.

@Grumpy_Mike

Grumpy_Mike: I think normally it is the type B that receives power not the type A

Is that a problem? If yes, would you recommend me a board that fits in my project? (perhaps from here, cause Im ordering most of the things there.)

USB-A is the flat one that plugs in a computer.
USB-B is the other end that plugs in a printer (or an arduino).

So I could use for example this one?

That adaptor would have to be the 5V source, because the other end would plug into the arduino and provide 5V to the arduino.

Is that what you are asking ?