Electronics > Beginners
Want to control 12 LEDs but there is not enough pins on Arduino?
autotel:
Many ways to do it! It depends on the details.
* My favorite for this case is using a 595 shift register because it can be tested easily on a breadboard. It just so happened I had kicad opened with a project that uses one (picture attached). The limitation with this approach is that the LED's can only be on or off.
* If you are trying to use RGB led's or trying to have different levels of brightness, then the WS2812 is the best option.
* You can also go with an analog multiplexor, however, the LED's will remain on only while their register is selected (meaning that they will look dim).
kjr18:
--- Quote from: Dabbot on July 22, 2019, 11:06:10 am ---Go to Banggood and get a WS2812B strip.
Cheap? Yes.
Overkill? Yes.
MCU pins: 1
Interface libs: Written.
--- End quote ---
There are also some variants, like SK6812, they are warm white- cold white-amber type, compatible with WS2812 libs. Fast Led lib supports many types of leds. This might be a good way to start.
max_torque:
--- Quote from: engineheat on July 21, 2019, 07:20:15 pm ---Hi,
Can't use bigger Arduino due to other reasons
--- End quote ---
And those reasons are? Generally these days, the cost of swapping in a micro with a few more pins is less than any other solution, especially if you only need a few more pins! (ie, if yo want to drive 300 leds, then yesm, you're going to have to use some form of serial to parallel conversion external to the micro, but if you just need say 5 more pins, just use a "bigger" micro. In the long terms that's often cheaper and easier!
If you really want to stick with the micro your have (and you need to have a very good reason to do that imo) then you need to tell us how many of the 12 leds need to be lit simultaneously, and how many "free" pins you currently have. Without knowing that info, there are many ways to skin this particular cat.......
Navigation
[0] Message Index
[*] Previous page
Go to full version