how to build 24(12*2)led array

Hi, I am new to arduino and I have got arduino uno now. I connect it to the mac by usb cable. But when I want to remove it from Mac, I can't find any buttons on mac to remove it. Is it ok to pull it off my mac immediately or what should I do?

By the way, I just have a project to need arduino. I want to know what is the max current for the GND? I now each pin is 40mA. But what is GND? I want to connect 24 led (max: forward current 20mA, forward voltage 3.2v), I want to parallel each two together to make it (2.5V(if supplied by usb, it's 5V total I think), ). So I will need 12 pin, I think it's enough. But I have to use 12 GND at the same time. So I want to know whether it's ok to connect all the 12 pair led to the same GND? Because the board doesn't have enough GND to use.

Thanks

Hi, fanlovefriends

Make sure that no communication is active (serial monitor or upload function) with the arduino board and Just pull the usb plug out. Safety remove hardware only stops data communication and not the power on arduino. The device removal option also is missing on windows unless a 3rd party software is installed (ex USB safety remove).

As for the 24 led project I don't think that artuino can drive them all. You have to use something like a ULN8023 chip. Usually those projects require a prototyping “breadboard” to make all the connections and experiment.

I want to know what is the max current for the GND?

It is 200mA of current going through the ground of the Arduino processor. That is only an issue if you are sourcing current.
If it is not going through the processor then don't worry about it.

I now each pin is 40mA.

What you know is wrong, 40mA is the point where damage starts to occur, run pins at less than that say 30 or 20mA.

However there is also a limit on the current an arduino can source through the pins, that is 200mA, so depending on how you are wiring them up ( current sourcing or sinking ) you are way over the top of 200mA

What you are describing is this.

You have to pay attention to the output current per port per Section 29 of the data sheet:

  1. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
    2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
    If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
    greater than the listed test condition.

D2-3-4-5-6-7 are Port D2 thru D7, D8-9-10-11-12-13 are Port B0 thru B5.

Additionally there is only 1 VCC pin, so total current the part can Source is 200mA:
DC Current VCC and GND Pins… 200.0mA

However, there are 2 GND pins, so total current the part can Sink is 400mA:

  1. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100mA.
    2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100mA.
    3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100mA.
    If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
    than the listed test condition.

Turn the LEDs around, connect the Anodes to +5 and use the Arduino IO to pull the cathodes low.

So, do some arranging, spread the LEDs across all 3 ports, and calculate resistors as needed:
(5V - Vf)/current = resistor.
Example:
(5V - 3.2)/12.5mA = 144 ohm >> use 150 ohm resisitor.

Hi, I am new to arduino and I just have a project to turn on/off the 24 leds (Forward current 20ma, Forward Voltage 3.2V)at the same time. I use usb to power it so it supplies 5V. I make each two led together to make 12 pair parallel total as the picture shows, which omits the last 11 pair. But I just know the arduino UNO board has current limit, so is that ok ? Or what should I do.Thank you.

phOvos:
Hi, fanlovefriends

Make sure that no communication is active (serial monitor or upload function) with the arduino board and Just pull the usb plug out. Safety remove hardware only stops data communication and not the power on arduino. The device removal option also is missing on windows unless a 3rd party software is installed (ex USB safety remove).

As for the 24 led project I don’t think that artuino can drive them all. You have to use something like a ULN8023 chip. Usually those projects require a prototyping “breadboard” to make all the connections and experiment.
[/quote

Hi, thank you. But how do I know whether communication is active? Can I just quit Arduino software , then pull off the usb cable?

Grumpy_Mike:

I want to know what is the max current for the GND?

It is 200mA of current going through the ground of the Arduino processor. That is only an issue if you are sourcing current.
If it is not going through the processor then don't worry about it.

I now each pin is 40mA.

What you know is wrong, 40mA is the point where damage starts to occur, run pins at less than that say 30 or 20mA.

However there is also a limit on the current an arduino can source through the pins, that is 200mA, so depending on how you are wiring them up ( current sourcing or sinking ) you are way over the top of 200mA

Thank you. You mean the gnd pin is different from the other 13 pin? It's max is 200mA? What is the total for the arduino board? For example, I want to use 12 pin and 1 gnd pin. Each 12 pin contains current is 16mA, but they are connect to the same gnd pin, is that OK?

No, sorry, that is not okay.

A led can not be connected to a voltage. In most cases the led is blown, because the current is too high.
You managed to make two leds work on 5V, but it could change with other temperatures or a slight change in voltage or the leds getting older. It is not safe to do.

24 led of 20mA = 480mA
The USB bus can supply that barely.

Could you use a regulated 12V power supply ? with 3 leds in series plus resistor. Controlled by a mosfet.

CrossRoads:
What you are describing is this.

You have to pay attention to the output current per port per Section 29 of the data sheet:

  1. Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
    2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
    If IIOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
    greater than the listed test condition.

D2-3-4-5-6-7 are Port D2 thru D7, D8-9-10-11-12-13 are Port B0 thru B5.

Additionally there is only 1 VCC pin, so total current the part can Source is 200mA:
DC Current VCC and GND Pins................................. 200.0mA

However, there are 2 GND pins, so total current the part can Sink is 400mA:

  1. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
    conditions (non-transient), the following must be observed:
    ATmega48A/PA/88A/PA/168A/PA/328/P:
    1] The sum of all IOL, for ports C0 - C5, ADC7, ADC6 should not exceed 100mA.
    2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100mA.
    3] The sum of all IOL, for ports D0 - D4, RESET should not exceed 100mA.
    If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
    than the listed test condition.

Turn the LEDs around, connect the Anodes to +5 and use the Arduino IO to pull the cathodes low.

So, do some arranging, spread the LEDs across all 3 ports, and calculate resistors as needed:
(5V - Vf)/current = resistor.
Example:
(5V - 3.2)/12.5mA = 144 ohm >> use 150 ohm resisitor.

Thank you. Please see this link.
http://forum.arduino.cc/index.php?topic=215472.msg1576565#msg1576565
I just want to use one arduino board, so is that possible? By the way, I don't think potential transformer is useful because I have to maintain the total 24 led light, and the total max output power(U*I) is constant.

Caltoa:
No, sorry, that is not okay.

A led can not be connected to a voltage. In most cases the led is blown, because the current is too high.
You managed to make two leds work on 5V, but it could change with other temperatures or a slight change in voltage or the leds getting older. It is not safe to do.

24 led of 20mA = 480mA
The USB bus can supply that barely.

Could you use a regulated 12V power supply ? with 3 leds in series plus resistor. Controlled by a mosfet.

Thank you. But I don't mind much about the led life, I think I will use these leds' total working time sum up less than 5days for experiment. The most concern now is the max current for the pin on arduino board. For example, I let each led work at 2.5V, then the current each pair is 16mA, the total may be 16mA*12 pair, so can the pin and arduino board withstand so much current?

Each 12 pin contains current is 16mA, but they are connect to the same gnd pin, is that OK?

Yes. You are sourcing current from Atmega328P pins, but Gnd is connecting back to the power supply, not going thru the Atmega328 pin.

CrossRoads:

Each 12 pin contains current is 16mA, but they are connect to the same gnd pin, is that OK?

Yes. You are sourcing current from Atmega328P pins, but Gnd is connecting back to the power supply, not going thru the Atmega328 pin.

So my project can work without damaging the arduino board? I calculate, and if each pair is 16mA, then total 12 pairs will be 192mA. One side of these 12 parallel pairs is connect to different 12 pins (I think total we have is 14 in the board). The other side is connect to the one gnd. So the the gnd's current is 192mA. So is that ok? Can the gnd pin and the board withstand so much current?
Thank you

So the the gnd's current is 192mA. So is that ok?

Try and understand what you have been told. The ground connection to the board IS NOT the same thing as the chip.
Running 192 mA total source current is too much for the supply pin of the chip. The maximum is 200mA and there is about 32mA just to run the workings of the chip. Running the pin close to 200mA is not a good idea anyway as that is the point where damage starts to occur, not a safe working limit.

phOvos:
Hi, fanlovefriends

Make sure that no communication is active (serial monitor or upload function) with the arduino board and Just pull the usb plug out. Safety remove hardware only stops data communication and not the power on arduino. The device removal option also is missing on windows unless a 3rd party software is installed (ex USB safety remove).

As for the 24 led project I don't think that artuino can drive them all. You have to use something like a ULN8023 chip. Usually those projects require a prototyping “breadboard” to make all the connections and experiment.

I think I may need a ULN 8023chip, so what's this? Is it a kind of transformer ? But the total output power is constant, let's say 5V* 200mA. So how to us ULN 8023 chip? Thank you

Hi, I come across a problem about the max current for the arduino uno board.
It's said total max current for arduino board is 200mA, but I have to run 24 blue leds (forward current 20ma, forward voltage 3.2V). I use usb to power it. I plan to make each two together and parallel 12 pairs. So each two divides 5V, then each one can get 2.5V and each circuit current is about 16mA. Total current is 16mA*12=192mA. And it's said the arduino itself has to maintain its own circuit by about 30mA, so at last it sums up to 220mA, bigger than 200mA.
Since it's blue led, I think 2.5V for each is relative low.(But still can be accepted). I have done tests before, when I divide 5V to 3 blue leds, they don't shine. So how can I use this arduino board to supply 24 leds?
Thank you.
By the way, someone tells me to use ULN8023 chip. Is it a kind of transformer?

Hi fanlovefriends,
First: stop creating new topics for the same question.
2nd: You can not have 2 LEDs in series from one arduino pin except for Red. Almost every other color has too much voltage drop and the LEDs need to be in parallel as I showed earlier.
If you want full 20mA going thru each LED, then yes, a seperate driver chip is needed. You will still need to connect them in parallel.

ULN2803 are just transistors conveniently packaged for easy use to drive things like LEDs:
http://www.digikey.com/product-detail/en/ULN2803APG(O,N,HZA/ULN2803APG(ONHZA-ND/856431

CrossRoads:
Hi fanlovefriends,
First: stop creating new topics for the same question.
2nd: You can not have 2 LEDs in series from one arduino pin except for Red. Almost every other color has too much voltage drop and the LEDs need to be in parallel as I showed earlier.
If you want full 20mA going thru each LED, then yes, a seperate driver chip is needed. You will still need to connect them in parallel.

ULN2803 are just transistors conveniently packaged for easy use to drive things like LEDs:
http://www.digikey.com/product-detail/en/ULN2803APG(O,N,HZA/ULN2803APG(ONHZA-ND/856431

Thank you, I am sorry for the repeat question. I just need it soon. Actually I want to use computer to control leds, let's say, 5 sec on and 10 sec off. And I don't know whether this easy example http://arduino.cc/en/Tutorial/Blink can still work or I should change something. And I don't know how the ULN2803 works, as you said, each circuit is 20mA, then each is 40mA. It's the right side, I see. But how do I calculate the current on the left side in you picture? How do I calculate the current for each pin? Also in your picture, on two ULN2803 left bottom, it should connect to gnd, how do I do this?

ULN2803 pin 9 connects to a GND pin on the Arduino.
The ULN2803 has internal resistors, the Arduino just connects as shown. You don't have to do anything more. See page 2 of the datasheet.
http://www.toshiba.com/taec/components2/Datasheet_Sync/201212/DST_ULN2803APG-TDE_EN_22738.pdf

CrossRoads:
ULN2803 pin 9 connects to a GND pin on the Arduino.
The ULN2803 has internal resistors, the Arduino just connects as shown. You don't have to do anything more. See page 2 of the datasheet.
http://www.toshiba.com/taec/components2/Datasheet_Sync/201212/DST_ULN2803APG-TDE_EN_22738.pdf

Hi, thank you. I have one question. Do 5V pin overload too much, I see all the leds one side connect to the 5V pin on the board.

CrossRoads:
ULN2803 pin 9 connects to a GND pin on the Arduino.
The ULN2803 has internal resistors, the Arduino just connects as shown. You don't have to do anything more. See page 2 of the datasheet.
http://www.toshiba.com/taec/components2/Datasheet_Sync/201212/DST_ULN2803APG-TDE_EN_22738.pdf

I am sorry, but I couldn't see clearly how you calculate the resistor each led need in the picture? Thank you