Go Down

Topic: Driving 750 or so leds, independently (of Course....why should this be easy?) (Read 1 time) previous topic - next topic

RazorFly

I am looking to drive approx. 750 leds & monitor some buttons.

I was thinking the MCP23017 would do me right on an uno or mega. But If my Calculations are correct I can only drive 8 x 16 leds (128) per i2c channel. and the Arduino's only have One set of CLK/DAT pins.

I was told (or so I thought) I can run much more than that. Am I missing something or am I right in being limited to only 128 additional i/o pins?

What other options are out there besides charlieplexing?


THANKS!

Paul__B

Depending on the rating of the LEDs, a MAX7219 will drive 64 of them by multiplexing to an average current of 5 mA, requiring only one 10k resistor and two bypass capacitors per chip, which chips can be daisy- chained on three control lines (but may require some buffering).

If you can make do with an average current of 10 mA, you can use twice as many driver chips to drive 32 LEDs each.

Alternately, the Arduino has many sets of SDA and SCL pins - half as many as it has a total of functional digital (including most of the analog) pins.

Grumpy_Mike

Quote
Alternately, the Arduino has many sets of SDA and SCL pins - half as many as it has a total of functional digital (including most of the analog) pins.

That is a bit confusing for a beginner, it requires a software version of the I2C bus.

The best way to control that many LEDs is to use an LED strip of indupividually addressable LEDs. If it is just outputs you want then you can use shift registers to get your control. Alternatively put them in a matrix and multiplex them, that takes less pins.

fungus


I am looking to drive approx. 750 leds & monitor some buttons.


SIngle color? How are they arranged? In a nice grid or just all over the place?


I was thinking the MCP23017 would do me right on an uno or mega. But If my Calculations are correct I can only drive 8 x 16 leds (128) per i2c channel. and the Arduino's only have One set of CLK/DAT pins.


I2C can talk to many different devices on the same pair of wires.  The fourth bullet-point of the MCP23017 datasheet says: "Three hardware address pins to allow up to eight devices on the bus". That means you can use 8 of them.

If you need more, I2C is easy to do in software on any pair of Arduino pins. Each pair of pins give you another eight.


What other options are out there besides charlieplexing?


Charlieplexing isn't really an option for that many LEDs.

Other options are LED strips: http://www.instructables.com/id/MX3-Professional-LED-Panel-1/


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

RazorFly

Ok.

The First bank of LEDS is 200 (10w x 20h row) these must be individual 5mm LEDs.

The next bank is a few rows of numerics (7/16 segment LEDs)

The LED panel (matrices) won't work. I thought the Ar-Ds were capable of much more than just 1 (8x16) i2c.

Anyone have a link to an i2c w/ software?

Thanks!

Grumpy_Mike

Sorry text speech is hard for me to understand, can you say that again in real English please.

Words I don't know:-
Ar-Ds
just 1 (8x16) i2c
an i2c w/ software?

RazorFly

Ar-Ds                                (Arduinos) - thought i was being clever....apparently not... ;)
just 1 (8x16) i2c               (1 i2c channel is capable of 8x16 (128 pins))
an i2c w/ software?       (someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software", how is this possible?)

Grumpy_Mike

A single I2C bus can hold up to 128 devices or chips providing each chip has a different address. If the chips have all the same address or range of addresses you can use analogue multiplexers to switch the two signals of the bus to different chips or groups of chips. So in effect you can have an almost limitless number of chips addressed.
The MCP23017 can have 8 different addresses giving as you say 8 x 16 outputs or 128 LEDs, so for 770 outputs you will need six banks of chips. But just to light LEDs this is a bit of a waste. The control will only be on or off you would be better off with a chain of shift registers.
A better chip is the PCA9685 this has 12 bit PWM dimming, you get 16 channels in a chip and you can have 256 of them on a single I2C bus, you only need 49.

Quote
someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software",

I would not recommend it but:-
http://blog.arduino.cc/2010/10/01/softi2cmaster-library-lets-you-add-i2c-to-any-arduino-pin/
The problem is the program space and speed it will go at for a lot of buses like you want.

fungus


Ar-Ds                                (Arduinos) - thought i was being clever....apparently not... ;)
just 1 (8x16) i2c               (1 i2c channel is capable of 8x16 (128 pins))
an i2c w/ software?       (someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software", how is this possible?)


I mentioned earlier that you can run 8 of those chips on each I2C bus. Two pins, eight chips.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

CrossRoads

A dozen MAX7219s, daisy chained, can control 768 LEDs.
The LEDs are wired up in groups of 8, just make a breakout area to wire the LEDs to.
For example, the digits here are driven by a MAX7219, each digit is wired up common cathode and wired to the breakout board in the  middle of the box.
Each group of 8 LEDs is addressed by 1 register in the MAX7219, so an array of 96 would hold the status of all LEDs, your code would just to send the 96 bytes out whenever there was a change madee.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

RazorFly

Using a 74HC595 shifter in conjunction w/ the i2c should do the trick then right guys?

CrossRoads

How so? Will be slow.
MAX7219 runs at SPI speeds - can handle the 8 MHz Arduino at 16 Mhz will put out.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

RazorFly

sorry posted before I finished reading ....

Thanks for everyone's help!

Headroom

What speaks against using several length of LED strips instead of single LEDs ?

Using a Teensy3 or Teensy3.1 and the OCTOws library http://www.pjrc.com/teensy/td_libs_OctoWS2811.html you can use thousands of LEDs at video refresh rates. The biggest project posted so far on the Teensy forum used in excess of 10000 LEDs in form of WS2811 led strips.
http://trippylighting.com

http://ledshield.wordpress.com/

Go Up