Go Down

Topic: Amperage too high? (solved) (Read 8297 times) previous topic - next topic

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's also common anode and common cathode rbg leds.  I would go with common anode.


jakub014

#16
Mar 13, 2016, 10:35 pm Last Edit: Mar 13, 2016, 10:55 pm by jakub014
@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 :


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


Grumpy_Mike

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.

Gerry48

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.







@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



Grumpy_Mike

#19
Mar 14, 2016, 04:39 pm Last Edit: Mar 14, 2016, 04:41 pm by Grumpy_Mike
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.

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

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

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

Gerry48

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

jakub014

#21
Mar 14, 2016, 07:35 pm Last Edit: Mar 14, 2016, 08:35 pm by jakub014
@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:
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.
3. 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

Grumpy_Mike

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

Grumpy_Mike

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.

jakub014

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?

Grumpy_Mike

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.

jakub014

#26
Mar 14, 2016, 10:28 pm Last Edit: Mar 15, 2016, 08:00 pm by jakub014
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?
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?



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.

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

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

jakub014

#28
Mar 15, 2016, 09:34 pm Last Edit: Mar 15, 2016, 09:44 pm by jakub014
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:
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?


Grumpy_Mike

Quote
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

Quote
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

Go Up