As title.
I'm using a WS2812b led strip on my arduino, should I connect 5V before than the digital pin?
5V is connected to an external power supply and digital pin to the arduino with the ground shared between power supply and arduino.
Now the question is, should I connect power supply before the arduino digital pin, or the opposite?
Thanks
Grumpy_Mike:
Yes.
I'm using this simple sketch
#include <FastLED.h>
#define LED_PIN 5
#define NUM_LEDS 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
for (int i = 0; i <= 19; i++) {
leds[i] = CRGB ( 0, 0, 255);
FastLED.show();
delay(40);
}
for (int i = 19; i >= 0; i--) {
leds[i] = CRGB ( 255, 0, 0);
FastLED.show();
delay(40);
}
}
but only one led light up of green. the fifth led of six.
what can it be? thanks
The first for loop addresses LEDs numbers 0 to 19 out of 6.
The second for loop addresses LED number 19 out of 6, see anything wrong in that?
sblantipodi:
As title.
I'm using a WS2812b led strip on my arduino, should I connect 5V before than the digital pin?
5V is connected to an external power supply and digital pin to the arduino with the ground shared between power supply and arduino.
Now the question is, should I connect power supply before the arduino digital pin, or the opposite?
Thanks
Do you agree that it's not the problem which first LEDs does not light up?
I corrected the loop and LEDs still not light up.
Do you agree that it's not the problem which first LEDs does not light up?
I might agree if I could understand those words.
I corrected the loop and LEDs still not light up
Can you post the "corrected" code so we can see it and check it is correct please.
If you have applied the 5V strip power after the Arduino powers up and you have not fitted a resistor between the data pin of the Arduino and the strip then it is probable that you burnt out the first LED and that could stop the rest of the strip from working.
Grumpy_Mike:
I might agree if I could understand those words.
Can you post the "corrected" code so we can see it and check it is correct please.
If you have applied the 5V strip power after the Arduino powers up and you have not fitted a resistor between the data pin of the Arduino and the strip then it is probable that you burnt out the first LED and that could stop the rest of the strip from working.
thanks for the answer.
I get another piece of led strip.
A new one. 11 leds.
it does not work. I tried removing the first led and it does not work, I tried removing the third led and it does not work.
never attached arduino before the 5V power supply.
#include <FastLED.h>
#define LED_PIN 5
#define NUM_LEDS 11
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
for (int i = 0; i <= 10; i++) {
leds[i] = CRGB ( 0, 0, 255);
FastLED.show();
delay(40);
}
for (int i = 10; i >= 0; i--) {
leds[i] = CRGB ( 255, 0, 0);
FastLED.show();
delay(40);
}
}
the strange things is that the 11 leds became really hot.
some leds light up but it seems that the digital pin isn't able to control the leds.
I tried connecting a DHT22 temp sensor to that digital pin just to know if my arduino it's working and the dht22 sensor works ok.
what can it be?
Try increasing the delay in each for loop to about 200. Then add a 500 delay before each for loop.
Does it look better?
Grumpy_Mike:
Try increasing the delay in each for loop to about 200. Then add a 500 delay before each for loop.
Does it look better?
some leds lit up but they don't moves.
I would not expect them to appear to move from that code.
the strange things is that the 11 leds became really hot.
That would suggest that you have got a bad strip.
Do you have a capacitor across the supply and a resistor in the data line.
Grumpy_Mike:
I would not expect them to appear to move from that code.
That would suggest that you have got a bad strip.
Do you have a capacitor across the supply and a resistor in the data line.
I explain you the full story.
Before this problems I was using a DIY ambilight for my monitor...
unfortunantly I haven't finded a working resistor for my ESP8266 and my strip,
if I used a resistor I was not able to control the strip.
so I decided to remove the resistor. after two months it stopped working and now I am trying to lit up some leds just to see if my ESP is broken.
I tried even with a "new piece of led strip never used" and with this simple sketch but it does not work.
I can't find what is the broken part
how can I know if I broken the ESP8266 PIN?
DHT22 sensor works on +5V, GND and D5 pin, so should I suppose that ESP is ok?
is it possible that my solder is not enough "conductive" for the very very weak digital pin signal of my ESP?
No, testing a pin as an input is not going to tell you if it functions as an output. Just put an LED and resistor on the output.
By not fitting a resistor you are inviting problems, and just because you couldn’t find one to drive a display is no excuse.
However now I know you are using a 3V3 processor the problem is more clear. The output signal is not enough to drive a strip reliably, yes it might work for a time as you found, but it is under the guaranteed to work voltage. You need a buffer to boost your signal then you can fit a 240 to 500R resistor for protection.
Grumpy_Mike:
No, testing a pin as an input is not going to tell you if it functions as an output. Just put an LED and resistor on the output.
By not fitting a resistor you are inviting problems, and just because you couldn’t find one to drive a display is no excuse.
However now I know you are using a 3V3 processor the problem is more clear. The output signal is not enough to drive a strip reliably, yes it might work for a time as you found, but it is under the guaranteed to work voltage. You need a buffer to boost your signal then you can fit a 240 to 500R resistor for protection.
so what controller should I use? should I abandon ESP8266 in favour of a more reliable chip?
what do you suggest?
EDIT:
I connected a simple led on my ESP8266 d1 mini lite and it works so the output is ok...
is the power too low for the ws2812b digital pin led strip?
PS: My led for pc ambilight has 95 leds (just to give you an idea of how many led I need to drive)
sblantipodi:
As title.
I'm using a WS2812b led strip on my arduino, should I connect 5V before than the digital pin?
5V is connected to an external power supply and digital pin to the arduino with the ground shared between power supply and arduino.
Now the question is, should I connect power supply before the arduino digital pin, or the opposite?
Thanks
Never connect pins with power on. Make ALL connections before applying power.
You can connect pins in any order while power is off, it makes no difference.
I connected a simple led on my ESP8266 d1 mini lite and it works so the output is ok.
No it is not. Are you actually paying attention?
We are trying to educate you not reinforce a slipshod approach to electronics.
I advise you read the last sentence of reply #12 again, or maybe for the first time.
boolrules:
Never connect pins with power on. Make ALL connections before applying power.
You can connect pins in any order while power is off, it makes no difference.
who is right?
mike says to give 5V before powering arduino, you say the opposite. a bit confused.
but what controller should I use to safely control the LEDs?
I have the esp8266 d1 mini controller and it works awesome with wifi and mqtt,
what else can I use?
Grumpy_Mike:
No, testing a pin as an input is not going to tell you if it functions as an output. Just put an LED and resistor on the output.
By not fitting a resistor you are inviting problems, and just because you couldn’t find one to drive a display is no excuse.
However now I know you are using a 3V3 processor the problem is more clear. The output signal is not enough to drive a strip reliably, yes it might work for a time as you found, but it is under the guaranteed to work voltage. You need a buffer to boost your signal then you can fit a 240 to 500R resistor for protection.
what is a buffer to boost signal? how can I create it?
will this buffer be fast? I need to use leds for monitor ambilight so they should be fast.
sblantipodi:
who is right?
mike says to give 5V before powering arduino, you say the opposite. a bit confused.
The two posts are not disagreeing with each other.
Read what boolrules says:-
Never connect pins with power on. Make ALL connections before applying power.
You can connect pins in any order while power is off, it makes no difference.
He is saying do not wire up the circuit with the power on, and I would 100% agree with that. You asked me what order should you apply the two power supplies, the Arduino and the 5V power for the LEDs. There is no disagreement that the 5V should be applied before powering up the Arduino. This is because if you power up the Arduino first the data signal will attempt to parasitically power the LED strip. Which the series resistor will protect against to a certain degree but it is best for this not to happen in the first place.
what is a buffer to boost signal?
A circuit that converts the 3V3 volt signal to a 5V one.
how can I create it?
Lots of ways, I use two buffers out of the six in a hex inverter like the 74HCT14 or similar. Like this one for the Raspberry, you can use exactly the same thing for your Arduino.
I need to use leds for monitor ambilight so they should be fast.
No your application is irrelevant, the buffer needs to be fast enough to pass the data stream to the LEDs which is logic levels at 800KHz. This will not affect the speed of refresh of the LEDs, there is no way to affect this speed either faster or slower.