Questions with powering an ATmega328 circuit and long ws2812b LED strip with the same power supply

Hi guys, I come from a software background and am new electronics.
I'm working on the following project and need some advice:

  • I've got a 20x20 matrix of ws8212b RGB LEDs being driven by an isolated (Not attached to Arduino) ATmega328.
  • I currently have the following circuit set up from a Youtube tutorial, where I've isolated the ATmega328 on a breadboard (Imgur: The magic of the Internet).
  • This "matrix" is actually more of just a long strip of 400 LED's daisy chained together to represent a 20x20 matrix.
  • In the image, the resistor is 10k, the two ceramic capacitors are 22pf and the electrolytic one is 10uf.
  • Both the ATmega328 and ws8212b LEDs operate at 5 volts. For this reason I would like for them to share a power supply.
  • I don't want to use an Arduino directly as I'm at the stage in the project where I'm looking to move it to its own PCB.

The questions I have are:

  1. Due to the very long chain of LEDs, I understand that I should use some power injection. Would there be any issue with power injecting on every row, or should I power inject only a few times where necessary (Such as where the LEDs get dimmer)? Will I wear out the LED's quicker if I used power injection on all 20 rows?

  2. As each of the LEDs can potentially draw 60mA (20+20+20) each when at full brightness and I have 400 LEDs, the max current draw of the strip would be 24 amps or 120 watts.
    If I were to use a power supply of 5v 24a to power the circuit in the imgur image, with the LED strip connected to one of the IO pins and the 5v in and ground connected to the same power supply as the ATmega328 would there be any issues here? Would the ATmega328, capacitors, resistor or crystal be at risk if the LED strip actually did pull 24 amps? Is the 10uf capacitor still acceptable with a current that high?

  3. For this project, I don't ever intend to have every LED white at full brightness. In fact, I only want the LED's to be at 50% brightness at most and at any one time and I'll only be using between 25%-30% of them at any given time. With this considered, would you recommend to go for a lower amp power supply? If I did accidentally go with a PSU too low (say, 2 amps), could I end up damaging my components by drawing the maximum rated current of the PSU? Or would the LED's just simply be less bright?

Thankyou very much. :slight_smile:

>Will I wear out the LED’s quicker if I used power injection on all 20 rows?<
You won't hurt anything. You are just putting shorter and/or fatter wires in parallel with the conductors built-into the power strip.

>Would the ATmega328, capacitors, resistor or crystal be at risk if the LED strip actually did pull 24 amps? Is the 10uf capacitor still acceptable with a current that high?<
That should be OK but I THINK Adafruit recommends a 1000uF capacitor with ws8212's. The power supply supplies the current. And you should have a 0.1uf "bypass" capacitor "close" the ATmega chip. That's pretty standard for chips of any kind.

> If I did accidentally go with a PSU too low (say, 2 amps), could I end up damaging my components by drawing the maximum rated current of the PSU? Or would the LED’s just simply be less bright?<
If you exceed the current rating on the power supply the voltage will drop and "bad" or "undefined" things can happen to the power supply (but not to the connected components). A well designed power supply will usually just shut down but a fuse could blow or something worse could happen. When the voltage drops the microprocessor program might glitch or crash and addressable LEDs also each have a chip that could "glitch" and behave unpredictably.

The dimming is also based on PWM so at 10% brightness the average current is 10% but the peak current is 100% for 10% of the time. Most power supplies will work OK as long as you keep the average below the power supply's maximum current rating but it's not guaranteed.

Where do things connect to the power supply your frizzy picture is just that a picture. A schematic would be a whole lot better and would show all the interconnections etc. Only a fool would deliberately undersize a power supply. It is the core of your system, and if anything goes flakey it can manifest itself in a lot of different ways in your project. I have seen engineers spending weeks trying to solve an underpowered power supply. Depending on the design of the power supply and failure mode it can damage parts. Yes you can power everything from the same 5V power supply, just run seperate lines for power and ground to the arduino and to the LEDs etc. You might want to reconsider the 22pf capacitors, your assembly is adding a fair amount of capacitance. You also need to use reasonable size wire to connect everything.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.