LEDs stop when connected to 5v but not when connected to 3v

Hey guys!
I thought it would be really cool to have a LED-Strip under my bed and I've stumbled across one oft the many Arduino-Individual-Controllable-LED-Strip-Projects out there and decided to give it a go myself. I ordered an Arduino Uno as well as a WS2812b LED-Strip as well as some jumper cables. I decided to use CLion instead of the Arduino IDE as I am very familiar with IntelliJ. I then used the PlatformIO IntelliJ plugin to get the FastLED working. Up to this point everything went smooth and my Hello-World-Programs worked like charm.

Problem:
I'm on MacOS so when I plug the Arduino to my USB-Hub (where 2 other Monitors as well as Mouse and Keyboard are hooked up as well) it won't work as then the Hub draws to much power from the PC and the PC just shuts down the USB-Port. So instead of plugging the LED-Strip into 5V (as intended) I plug the LED-Strip in 3.3V on the Arduino so it doesn't draw that much power.
As I decided to test the program with an external power source (instead of the USB-Hub on my MacBook) I noticed something very strange:
The program is behaving as expected as long as the strip is connected to 3.3V. But once I use 5V instead of 3.3V the program runs for a few seconds, then the LEDs won't update anymore. When I unplug the 5V connection from the Arduino to the LED-Strip it's working again, but only for a few seconds, then it will freeze again. This bothers me as, well, I'd like to run the RGB-Strip using 5V as this is brighter.

Any idea how to fix this?

I've tried different power bricks, but I only have one Arduino, one LED-Strip and 3 jumper cables.

tl, dr: Program works when Strip is plugged into 3.3V but stops after a few seconds when plugged into 5V (Strip is rated for 5V)


platformio.ini

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:uno]
platform = atmelavr
board = uno
framework = arduino


lib_deps_external =
    FastLED

platform_packages =
; use GCC AVR 7.3.0+
    toolchain-atmelavr@>=1.70300.0

main.cpp

#include <Arduino.h>
#include <FastLED.h>

#define DATA_PIN        3   // ID of the PIN the LED-Strip is connected to
#define LED_COUNT       90  // Amount of LEDs on the LED-Strip

#define BRIGHTNESS      255 // Brightness from 0 to 255
#define DELAY           100 // Delay between LED updates in ms


CRGB led_strip[LED_COUNT];  // Initializing the LED-Strip

int currentStart = 0;

bool isInRange(int number, int lowerBound, int upperBound);

void setup() {
    pinMode(LED_BUILTIN, OUTPUT);

    CFastLED::addLeds<NEOPIXEL, DATA_PIN>(led_strip, LED_COUNT); // Adding the LEDs
    FastLED.setBrightness(BRIGHTNESS); // Setting the brightness
}


/*
 * Loops: GREEN BLUE RED
 * As we have 90 LEDs we will have 30 GREEN, 30 BLUE and 30 RED
 */
void loop() {

    for (int currentLEDID = 0; currentLEDID < LED_COUNT; currentLEDID++) {

        int currentOffset = (currentStart + currentLEDID) % LED_COUNT;

        // Setting the color of the current LED
        if (isInRange(currentOffset, 0, 9)
            || isInRange(currentOffset, 20, 29)
            || isInRange(currentOffset, 50, 59)) {
            led_strip[currentLEDID] = CRGB::Green;
        } else if (isInRange(currentOffset, 10, 19)
            || isInRange(currentOffset, 30, 39)
            || isInRange(currentOffset, 60, 69)) {
            led_strip[currentLEDID] = CRGB::Blue;
        } else {
            led_strip[currentLEDID] = CRGB::Red;
        }

    }

    if(++currentStart >=LED_COUNT - 1) currentStart = 0;

    FastLED.show();

    delay(DELAY);
}

bool isInRange(int number, int lowerBound, int upperBound) {
    return number >= lowerBound && number <= upperBound;
}

main.cpp (1.61 KB)

We need to see a schematic of your circuit to make sense of what you say and the code you have.

The 3V3 output of a Uno does not provide enough current to work, but maybe that is what is saving you. It is preventing you drawing too much current from the USB. Where as a 5V connection allows you to overload it.

You need about 60mA per LED so you can’t power too many of them from USB power.

Grumpy_Mike:
We need to see a schematic of your circuit to make sense of what you say and the code you have.

The 3V3 output of a Uno does not provide enough current to work, but maybe that is what is saving you. It is preventing you drawing too much current from the USB. Where as a 5V connection allows you to overload it.

You need about 60mA per LED so you can’t power too many of them from USB power.

Schematic:
LED-Strip: GND -> GND Arduino
LED-STRIP: Data -> PIN 3 Arduino
LED-STRIP: POWER -> 3.3V / 5.0V Arduino

I think this may be the issue. I have 90LEDs and if every one of those draws 60mA I need a total of 5.4A. My Power. My chargers output 2.1A and 1.0A which means I simply don't have enough power, right?

If I'm correct this can be solved if I buy a 2.1mm DC Plug with enough amps. I found one on amazon that has 10A and goes for like 20€. Is this a reasonable price? It seems a bit much just for a power cable (lol).

I think this may be the issue. I have 90LEDs and if every one of those draws 60mA I need a total of 5.4A

Correct, but that is at maximum brightness, try turning just one LED on with the rest off when powering with 5V.

If that works then many libraries offer the option to adjust the maximum brightness so lowering this to match what power you have would be an option. Often full brightness on a lot of LEDs is too bright anyway.

found one on amazon that has 10A and goes for like 20€. Is this a reasonable price? It seems a bit much just for a power cable

For just a cable yes too much. For a power supply that gives you 10A it is not bad but is at the top end of what you would be expected to pay. Remember Jeff is not worth billions without ripping off a lot of people, the end user is no exception.