SK6812 LEDs lighting up randomly with high-current PSU

Hello,

I am using an arduino 33 IoT to control SK6812 LEDs (6 at the moment, but will expand to 96 later), using the FastLED library and pin 2 as datapin. I am using a BC337 transistor to do level shifting from 3.3 to 5 V (3.3v to 5v inverter by bc547 - Storage - Arduino Forum). I have it working when using the USB to power the LEDs and arduino, or when using a phone charger (5V 1A) that powers the board through the Vin. However, to use the 96 LEDs, I will require a more powerful power supply. For this purpose, I have a 5V 5A powersupply: Power supply adapter from 220 VAC to 5 VDC and 5 A - Cablematic

Using this power supply, however, the LEDs light up irratically (i.e., random colors, etc, indicating a timing issue? or possibly noise on the data line?). The high current supply outputs 5.25 V, while the phone charger outputs 4.98 V. I'm currently not in possession of an oscilloscope, but I think the power supply might be very noisy which in turn causes random data to be transmitted to the LEDs.

Is there any way I could resolve this problem by perhaps filtering the power line, or is there a better power supply I could use? I have already tried adding a 100 nF capacitor on the power line close to the arduino, and every SK6812 has a 100 nF capacitor next to it.

Or, is there a different explanation for what I'm experiencing?

Many thanks,

Bart

I have already tried adding a 100 nF capacitor on the power line close to the arduino,

Try fitting a 1000uF capacitor on the input to the strip.

I am using a BC337 transistor to do level shifting from 3.3 to 5 V

That is also a source of possible trouble. It is likely that the speed is too fast for a simple arrangement like this. It looks like the higher voltage from your power supply might be to blame, this makes the voltage you need to drive the strip with goes up.

Thanks for your reply!

I just tried a 1000 uF cap, but it sadly did not solve the problem. It did do something interesting, though: when switched off, briefly all the LEDs blinked white (I set only the white channel in the strip), and when turned on shortly afterwards again, the LEDs all turned white immediately. But again, there was no control besides them switching on. It is likely that upon discharging, it gives a lower voltage that then allows the circuit to function.

This indeed leads me to believe that the additional voltage is to blame. But I don't really understand why this would be a problem? I am doing the level swifting with the same 'higher' voltage... I agree that the level shift with a transistor is not ideal, but I don't have any mosfets or ICs for it at hand at the moment. It does work with the lower voltage, though. Would there be a reason for it to be slower with a slightly higher voltage?

No, if you are using a single transistor, you are not doing level shifting.

The circuit you cite just might work for an SD card -though it is probably not necessary there.
Transistor Level shift.png
But it is simply too slow (using a resistor pull-up, especially 10k!) to drive the SK6812s.

You need a 74HCT14 (or 74HCT04 or 74HC04 will probably do) with two gates cascaded (invert and invert again) to drive the strip with the necessary speed.

This indeed leads me to believe that the additional voltage is to blame. But I don't really understand why this would be a problem?

Because the voltage level required by the strip or indeed most other logic devices is defined as a fraction of the supply voltage. So if you have a data signal that is only just triggering the device, and you increase the supply voltage then you need a higher voltage on the input to make it trigger. In your case you have a marginal signal so any slight increase in voltage will make it more marginal.

It did do something interesting, though: .....

Sorry but this is not very interesting nor adds any extra information. Many beginners point out stuff like this and it is just not relevant in indicating what is wrong.

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