1
\$\begingroup\$

I want to design a ring with LED lights and be able to create some visual effects with it. My main idea is as follows:

enter image description here

The problem with this project is that there are many LED lights, between 60 and 80 LEDs, and I want to control each LED independently as well as its brightness. I was thinking of placing a microcontroller locally on the lighting PCB, but I'm not sure if it's the best option. Then, I considered using a MAX7219, but I'm not sure if the SPI bus will work correctly at 1.2m, and it's also a relatively expensive chip. I would like the manufacturing cost to be reasonable.

What method would you recommend for controlling the brightness and turning on each LED individually using only one MCU?

\$\endgroup\$
4
  • 3
    \$\begingroup\$ If you use addressable LEDs you only need a single pin. \$\endgroup\$ Commented Nov 24, 2023 at 15:30
  • 8
    \$\begingroup\$ Seach for WS2812B. They use a serial bit stream and hundreds of LEDs can be driven by one GPIO. Many software drivers use SPI interfaces on the MCU, data line only, clock not needed. \$\endgroup\$
    – Mattman944
    Commented Nov 24, 2023 at 15:37
  • \$\begingroup\$ Maybe a charlieplexing controled with software pwm. \$\endgroup\$ Commented Nov 24, 2023 at 15:37
  • \$\begingroup\$ Can I ask what sort of power LED are you thinking of? How fast do the patterns change? \$\endgroup\$
    – jonathanjo
    Commented Nov 25, 2023 at 9:45

3 Answers 3

4
\$\begingroup\$

If you have the ability to order addressable LEDs like the WS2812B, it usually only takes 1 or 2 pins for data, and two for power (+/GND). This means any number of LEDs, only 4 pins needed.

If you have standalone regular LEDs, the best method is to use IO expansion modules or shift registers. NXP has some decent IO expansion ICs here. Digikey has plenty of shift registers you can buy here.

Remember to buffer the outputs of the shift register/IO expander so the LEDs dont draw current directly from the chip (check the datasheets to see max output current).

Edit: Additional thought, to control brightness, you can try and multiplex the PWM signal through a MUX to each individual LED.

\$\endgroup\$
1
\$\begingroup\$

Picture came Google search for LED strip. Some strips are programmed by SPI and each LED is individual programmed.
enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ I would like to design the LED ring myself; I need to customize it a bit, and using LED strips is not the solution for now \$\endgroup\$
    – WalterPH
    Commented Nov 24, 2023 at 16:20
  • 2
    \$\begingroup\$ @WalterPH Then add that piece of limitation to your question. Because obviously, without that info, you would simply buy a length of addressable LED string and cut it to required length to attach it to something to form a ring. If you want to build it yourself, still, buy addressable LEDs and put them on your PCB. \$\endgroup\$
    – Justme
    Commented Nov 24, 2023 at 17:14
1
\$\begingroup\$

If you wanna build it yourself, essentially, you use serial-to-parallel registers like the 595. You can daisy chain an arbitrary number of them. That way, you can control many LEDs using a single data pin. You can put several data strings in parallel for more throughput.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ 595 is great, but not really suitable to do the brightness of the individual LEDs. \$\endgroup\$
    – jonathanjo
    Commented Nov 24, 2023 at 17:04
  • 1
    \$\begingroup\$ @jonathanjo If you clock data at a conservative 5 Mbit/s , you can achieve 10000 fps with 500 LEDs, which gives you plenty of headroom for PWM based brightness tuning..If there are registers with individual brightness control, the OP is certainly interested I suppose..But they would be much more expensive, too. \$\endgroup\$
    – tobalt
    Commented Nov 24, 2023 at 17:07
  • \$\begingroup\$ You need two pins, one for clock and one for data. If you want to use RCLK for a simultaneous transfer from the serial shift register to the parallel output register a third pin is needed. \$\endgroup\$
    – Uwe
    Commented Nov 24, 2023 at 18:43
  • \$\begingroup\$ @Uwe true, But the SCLK and RCLK can be shared across all parallel chains, so in the limit of many chains n (perhaps not applicable here), you end up with only n+2 pins \$\endgroup\$
    – tobalt
    Commented Nov 24, 2023 at 18:58
  • \$\begingroup\$ If you share the same SCLK for several chains, you can not control them independent changing one only is not possible. You have to repeat the same serial data again. But it is possible to use the same data pin and several SCLK for some chains. \$\endgroup\$
    – Uwe
    Commented Nov 24, 2023 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.