multiple RGB SMD 0805 LED & pin management

Hey,

My project will require a lot of 0805 RGB SMD LED but i'm worried about pin management as one of those requires 3 Pins.

each SMD will be soldered to an ethmel wire cable, and the other end of the cable will be soldered into a PCB, where i'll be using an attiny (i haven't decided which one to use yet) to control the LEDS amongst other components (a small speaker, I.R receiver).

Considering I will be using 10 RGB SMD, and 10 regular (one color) SMD led, I will more likely run out of pin very fast. I heard about shift registar, and charliplexing, but considering I will need to control each SMD individually to achieve some very specific effect, i'm afraid those 2 solutions may not be the best.

My goal is to reproduce a whelen Valor lightbar in miniature hence the reason I need RGB SMD, and to be able to control each led individually (one light can either be used as a scene light or a flashing emergency light, or a traffic advisor):

Video of lightbar in action with all the features i'm trying to reproduce

Can anyone help out with the best approach to achieve that ?

thanks !

Thanks !

Use a 5volt addressable LED strip.
Many LEDs can be controlled with a single Arduino pin.
Leo..

So you don't need to fade the LEDs, or mix colours other than red, blue & white?

You could consider tlc5928 chip(s). These are shift registers with 16 outputs which are designed for driving LEDs. You don't need series resistors for the LEDs because the chip has "constant current" outputs.

The thing is, i'm ideally looking for one microcontroler with enough pins to manage all the leds i need.
I did the math and i would need at least 24 PWM pins (for about 8 RGB led smd), and another 15 I/O pins

The thing is, i'm ideally looking for one microcontroler with enough pins to manage all the leds i need.

No you are not. You asked for the best solution and you were given it.

So if you have a good reason for rejecting this advice then say so. Just that you are unconformable or unfamiliar with the ideas suggested is not a good reason. What you are proposing is very sub-optimal.

Have a look at the Adafruit Neopixel projects.

It takes ONE Arduino pin to control hundreds of LEDs.
Leo..

nordi:
The thing is, I'm ideally looking for one microcontroller with enough pins to manage all the LEDs I need.
I did the math and I would need at least 24 PWM pins (for about 8 RGB led SMD), and another 15 I/O pins

Well, it seems you are befuddled about a number of things here. "one microcontroller with enough pins to manage all the LEDs" is wrong for starters, Charlieplexing is not workable for your project but using shift registers or in fact, proper LED drivers is "the best".

Checking out the video you cited (and I did not waste 6 minutes on it but verified the following details), the effects shown do not require fading or colour mixing - it used only the primary colours. Accordingly, you do not need PWM.

You have cited an Alibaba link. While I very much doubt they can actually supply "700000000 Piece/Pieces per Month" :astonished: , you would find they had a minimum order of several thousand, so you certainly would want to "require a lot of" the LEDs.

Unfortunately, that reference fails - unless I am not very observant - to specify whether these RGB LEDs are common-cathode or common anode - which is a somewhat important matter in regard to how you drive them as some driver ICs work with one rather than the other.

Using "Neopixels" may be overkill but would be one solution; you could drive them easily with an Arduino Nano and allow colour mixing and fading. For economy, using MAX7819s would be very practical as you can get PCBs with the chips on eBay.

Paul__B:
Well, it seems you are befuddled about a number of things here. "one microcontroller with enough pins to manage all the LEDs" is wrong for starters, Charlieplexing is not workable for your project but using shift registers or in fact, proper LED drivers is "the best".

Checking out the video you cited (and I did not waste 6 minutes on it but verified the following details), the effects shown do not require fading or colour mixing - it used only the primary colours. Accordingly, you do not need PWM.

You have cited an Alibaba link. While I very much doubt they can actually supply "700000000 Piece/Pieces per Month" :astonished: , you would find they had a minimum order of several thousand, so you certainly would want to "require a lot of" the LEDs.

Unfortunately, that reference fails - unless I am not very observant - to specify whether these RGB LEDs are common-cathode or common anode - which is a somewhat important matter in regard to how you drive them as some driver ICs work with one rather than the other.

Using "Neopixels" may be overkill but would be one solution; you could drive them easily with an Arduino Nano and allow colour mixing and fading. For economy, using MAX7819s would be very practical as you can get PCBs with the chips on eBay.

First of all, thanks for everyone reply and help with ideas.

I spent 3 days doing research regarding the solutions that have been offered to me:

  • Neopixel would have been an awesome solution, but sadly i'd be working with a 1/24 die cast vehicle which requires led smaller than what neopixel offer (smaller one available is 5050). Therefore this isn't an option ;
  • tlc5928 I haven't found many tutorials regarding this one, and being new to arduino i'd rather work with well documented / tutorials so i can have a solid base
  • MAX7219 : I have been searching around for tutorials about this, but I'm afraid it might not be suitable for my project because of the V-shape of the lightbar (i'm still at beginer level with arduino, i'm sure you could make use of the MAX7219 for whatever you want even with a v shape, but it seems to be more appropriate for (rectangular) display / message boards
  • Shift register: 74HC595 This is indeed a good option, provides more I/O pins and PWM, i'm more likely going to use this

Although i do not need fading, I'll still require 18 PWM pins because I need amber light not yellow (which indeed would not have required PWM), the color combination is the following:
red/white
blue/white
red/amber
blue/amber

I did the math and will require about
-36 I/O pins for the left and right LED (6 leds on the left side, 6 leds on the right side)
-18 PWM pins for the rear light (6 led on the rear)
-one pin for a IR receiver
and eventualy an additional 5 pins for a siren module (speaker + the smd card with the audio file).

atmega 2560 would provide enough pins though, but atmega16 with a 74HC595 would also work.

I have attached a blueprint of what the lightbar should looks like with the lights combination.

I'm more than open to hear on feedbacks.

You still do not seem to be "getting it".

The 74HC595 does not "provides more I/O pins" at all and you have indicated no actual requirement for PWM - if you want "amber" you simply use resistors for the green LEDs where you want amber and not white. A 74HC595 could provide eight outputs per chip so you would need 7 or 8 of them plus a resistor for every LED. A RGB LED counts as three of course.

A MAX7219 is marginally larger than a 74HC595 - the shape is irrelevant - and controls 64 LEDs per chip with RGBs again counting as three. It requires only one resistor (except for the amber LEDs!) so you are saving a huge amount of space.