Completely new to arduino, please help

all ive had are headaches since i got this stuff, im seriously at the point of just throwing it all away and counting it as a loss.

ive cut down a ws2812b strip to 59 leds and plugged the 5v and ground to the 5v and ground on the arduino, ive connected the data line to pin 5. it was working for a second, i was able to light up all the leds(well the first 10 or so, im assuming i didnt have enough amperage from usb to power the rest)

and well, it was working fine, i decided to unplug it from the pc and plug it into my psu (5v/10a) through the barrel jack, i did and i got nothing, and now plugging it back into usb on the pc i also get nothing.

ive tried reuploading the sketch, plugging data into different pins, hitting the reset button, unplugging and plugging it back in, and i get nothing at all.

this is like hour five or so that ive been tinkering with this thing, and every time i get it working sort of right i get excited and then im let down as it completely stops working again and again.

my goal is to get 59 led's of one color, then the next 59 another, so on and so forth until i have five different colors (red, blue, green, white, purple)

please help also, i forgot to mention this is an uno board.

EDIT: sorry for wasting board space, one of my wires is bad.

#include <FastLED.h>

#define LED_PIN 5
#define NUM_LEDS 20

CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
  
}

void loop() {
  leds[0] = CRGB(0,0,255);
  leds[1] = CRGB(0,255,0);
  leds[2] = CRGB(255,0,0);
  leds[3] = CRGB(0,0,255);
  leds[4] = CRGB(0,255,0);
  leds[5] = CRGB(255,0,0);
  leds[6] = CRGB(0,0,255);
  leds[7] = CRGB(0,255,0);
  leds[8] = CRGB(255,0,0);
  leds[9] = CRGB(0,0,255);
  leds[10] = CRGB(0,255,0);
  leds[11] = CRGB(255,0,0);
  FastLED.show();
  delay(500);
  
}

  
 

you can't power 59 leds from the 5V pin of your Arduino. There is likely not enough current available and may be drawing too much current can damage the board

(the jack expects more than 6V - 7 t o12 recommended)

and why did you think it was an introductory tutorial... moved to a better place âžś do yourself a favour and please read How to get the best out of this forum (and change the title to something meaningful)

Probably because the barrel jack is not specified for that voltage. Read the documentation. Arduino publishes complete specs on all products. They are on this site.

Well that is a typical result of random tinkering. This is electronics and software. You have to research and look things up, to make things work.

I've never actually used SW2812's...

But yes, And the LED strip should have its own separate connection to the power supply. But, the Arduino and LED strip must share a common ground.

As a quick-check of the Arduino, if you have a regular LED connect it (with the usual current-limiting resistor) to the output-pin that you're using for the LED strip. Then run the Blink Example, modified to blink that pin.

You can try that with, and without the LED strip connected. The LED strip won't do anything but if that messes-up the blinking of the regular LED, the 1st chip is the LED strip is blown and shorted.

If the Arduino is OK... It's "unlikely" that you fried the whole LED strip (but that could happen if your power supply goes over-voltage or if you get the power connections reversed.)

But as you may know, the WS2812's are daisy-chained and the data signal passes-through, and is buffered by, each device in series. If the 1st one is bad and the data isn't getting-through, nothing will work!

Adafruit has more information about "NeoPixels" (WS2812) than anyone else.

fill_solid( leds, 59, CRGB::Red);
fill_solid( leds, 59, CRGB::Green);
...

thank you for being helpful, like i said im completely new to this. one of the jumper wires i was using was bad and replacing it fixed the problem.

i know im not going to be able to power all 59 leds from the usb, im actually just trying to familiarize myself with arduino for this project im working on.

im confused on something though, how would i power both the arduino, and the led strip from the same power supply with no computer involved at all?
having it wired like this works fine when plugged into usb on the pc, but when unplugging it from the pc and pluggin it into my psu i get nothing.
thank you for any help, its really appreciated.

I think you have tried to connect the 5 V to the "Vin" pin. "Vin" and the "barrel jack" are basically useless for serious projects as you now see. You connect the 5 V to the "5V" pin.

This is a common confusion engendered by the Arduino website proper. The only concern is that you do not connect the 5 V to the "5V" pin when the UNO (and you have a genuine UNO) is connected to a PC via USB. Just disconnect the "5V" pin if you are going to connect to a PC. Of course the ground will always be connected. :+1:

The 5v pin can be connected to the external 5v supply.

Don’t power the UNO externally when you have it connected to the USB cable/computer.

1 Like

yeah, i knew not to run 5V into it from usb and from the pin.

i got it to work from just the psu, my jumper wires are garbage, swapping them with different ones fixed the issue.

now i just gotta learn more about writing sketches, when asking for advice on that do i just ask in this post, or can i make a seperate post?

Interesting point.

"Cross posting" where you are asking questions about the same project in different posts and possibly in different fora, is prohibited as it wastes people's time when all the relevant information is not provided and because people may provide the same answer to the separate topic threads.

Since this topic turned out to be only about basic wiring, discussing the code might arguably be a different matter - but you have already provided your code, so it might be as well just to continue here. Especially given your original title in no way specifies a problem! :roll_eyes:

Perhaps you should edit your title (in the first post) to broadly describe the code problem and place an addendum to note that the first problem is solved but you have more to say in #13 or whatever follows mine now. :+1:

am i posting this in the right place this time??

here is the code

#include <FastLED.h>
#define NUM_LEDS 59
#define DATA_PIN 11
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define BRIGHTNESS 60
#define VOLTS 5
#define MAX_AMPS 500

CRGB leds[NUM_LEDS];

void setup(){

FastLED.addLeds<CHIPSET,DATA_PIN,COLOR_ORDER>(leds,NUM_LEDS);
FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS,MAX_AMPS);
FastLED.setBrightness(BRIGHTNESS);
FastLED.clear();
FastLED.show();

}

void loop(){
  leds[0] = CRGB(0,255,0);
  leds[1] = CRGB(255,0,0);
  leds[2] = CRGB(0,255,0);
  leds[3] = CRGB(255,0,0);
  leds[4] = CRGB(0,255,0);
  leds[5] = CRGB(255,0,0);
  FastLED.show();
  delay(100);
}

i would expect this to light up my led strip green, red, green, red, etc for the first six led's.

instead this gets me blue, blank, blue, blank, green

is my arduino dead possibly? what am i doing wrong with my code? ive been pulling my hair out all day over this thing and im quite ready to throw it in the closet with my other failed attempts at doing things.

Nothing appears to be wrong, show us your wiring in a good image.


NUM_LEDS should be set to 6 if you have 6 pixels.

Is your color order (#define COLOR_ORDER GRB) correct?
Do you indeed use WS2812B strips?

There should not be a problem with specifiying 59. FastLED.show() will happily shift all 177 bytes out and at the end of a 6 LED strip the remaining bits will hapily go to bit heaven :wink:

Correct.

Just pointing it out, it just wastes memory and adds noise to the system :nerd_face:

ok, i changed the NUM_LEDS to 6

i did notice something though, plugging into my pc's front usb port i get the strange color's, but if i unplug it from the pc and plug it into my 5v10a power supply through the barrel jack all the leds light up as they should although flickering very quickly.

this lead me to beleive their was a problem with the usb port on the arduino itself, so i plugged it into a 5v2a usb wall transformer thing for phones and it acted the same as when plugged into pc, it also did this when plugged into my power bank(also 5v/2a).

EDIT:ok, i spoke to soon, all the leds light up the same color when powered from the wall, but when i change the code to what i have posted above i do get g,r,g,r,g,r. but the greens are flickering really fast, and the first two reds are blinking randomly or turning yellow.

oh, and a pick of the wiring.

Hi,
Have you tried the 470R resistor in series with the signal wire?

Tom... :smiley: :+1: :coffee: :australia:

No, I tried using a 330ohm resistor though, and that just made the first led a very faint blue green and everything was unresponsive to code changes.

@Putnamto

Your two topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

I've also moved it to programming questions as that seems to be mostly what has been discussed.

Thank you.

I may get roasted for this, but in fact you can, and I do. But there is a catch. You have to strictly limit the LED brightness in your software, so that the total current consumption is manageable for a USB.