Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

WS2812b stopped working - defective GPIO?

Fri Jan 10, 2020 11:28 pm

Hi, I have wired up and got successfully running a WS2912b LED Strip. I used this tutorial: https://tutorials-raspberrypi.com/conne ... ed-strips/

I have hooked the LED-Strip counting 60 LEDs up to an external power supply because obviously the pi cannot supply enough power.

I have played around with it a bit, got some effects and yada yada yada... Now I wanted to come back to it and found out it is not working anymore. Only the very first LED lights up and I cannot control the strip at all anymore.

Now what could have happened that it doesn't work anymore?

At one point I accidentally got stuck in the little cable and removed it from the Strip, so that for a couple of seconds only the data (Pin12) was disconnected. Could that have caused some damage?

I'm really worried that something is broken but without the pi I cannot verify if the LED Strip is even working, and I don't know how to verify if the GPIO Pin is working.

EDIT:
I have tested the pins with

Code: Select all

gpio readall
and for Pin12 (PWM Pin, GPIO18) it says ALT5 wheras for all the others it says IN.

I've taken my other Pi (Model 3b+) and installed the python library, connected the LED Strip and everything works just fine. So it must be that pin on the Pi 4 that is defect.

I really want to understand how this happened, so I can avoid that happening in the future - or is there something else even I could do?
Last edited by Coulomb on Tue Jan 14, 2020 7:11 pm, edited 1 time in total.

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 2:09 pm

Hi.

You should never connect or disconnect anything to a gpio pin while the pi or the device you are connecting to is powered , as it can lead to damage to ether the pi or the device.

all ALT5 means is that that pin is using an alternative mode in your case PWM rather than input or output

https://www.dummies.com/computers/raspb ... functions/
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 2:27 pm

Thanks, so this pin is obviously supposed to be in this mode. OK. So, is it broken? Is there something else I could possibly do?
I have tried every think I could think of, including reinstalling the Raspbian completely and setting up everything again from scratch - nothing. The LEDs don't light up. However they do light up on the other pi. So it must be this pin.

So it is lost, then? Damn

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 2:33 pm

With a fresh install on the SD card and no added WS2812b software installed , you could try connecting a simple LED and 470 ohm resistor in series between the gpio pin in question and a ground pin and see if you can switch it on and off with a simple python program as a final test of the gpio pin.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 3:38 pm

Well, I don't have access to the things required to do that. But it pretty much confirms that the Pin is dead.

I have another Noob-Question: Could a slightly under powered external power supply for the LED strip have caused the Pin to die?

In the tutorial it says that if the LEDs are not bright white all the time, a 3 Amp Power supply might be enough. 60 LEDs like the ones I have are rated for 3.6 Amps. So in theory, if my Power supply did not deliver enough power for the periods where all the LEDs were white, would the LED Strip "try" to draw that power from the Raspberry Pi and cause damage?

Since I wired everything according to the schematic, the 5v Power supply is not at all coming from the Pi, only the Data line and Ground.

I really want to know exactly where I messed up so that the next time it will not happen again.

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 3:51 pm

Coulomb wrote:
Sat Jan 11, 2020 3:38 pm
In the tutorial it says that if the LEDs are not bright white all the time, a 3 Amp Power supply might be enough. 60 LEDs like the ones I have are rated for 3.6 Amps. So in theory, if my Power supply did not deliver enough power for the periods where all the LEDs were white, would the LED Strip "try" to draw that power from the Raspberry Pi and cause damage?

Since I wired everything according to the schematic, the 5v Power supply is not at all coming from the Pi, only the Data line and Ground.
If you only have data and ground wired to the pi no current can be drawn from the pi to make up for your low powered LED power supply.
I really want to know exactly where I messed up so that the next time it will not happen again.
As we/I were not present when you caused the damage there is no way for us to know for sure what you did to cause the damage, we can only make educated guesses , and state the probable or usual cause which is what I did in my first post.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - possible reason?

Sat Jan 11, 2020 5:02 pm

Thank you.

There is one other thing, maybe you know whether or not this could have something to do with the pin not working anymore.

In the instructions it says to comment out the line dtparam=audio=on as the pin needed to send the signal to the LED strip uses PWM, the same as audio. Now I thought this is only pertaining to analogue audio, and I enabled HDMI Audio, so I could have both the PWM signal for the LED strip and Audio for Emulationstation on the Pi. If doing that can't kill the pin, then there's really only the option left, although it seems counter intuitive that pulling a cable by accident and plugging it back in instantly fries the hardware :| - which is not to say I don't believe so, and I already ordered a new one. It was my lesson, hopefully this is the only pin that is broken :oops:

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - possible reason?

Tue Jan 14, 2020 2:35 pm

pcmanbob wrote:
Sat Jan 11, 2020 2:33 pm
With a fresh install on the SD card and no added WS2812b software installed , you could try connecting a simple LED and 470 ohm resistor in series between the gpio pin in question and a ground pin and see if you can switch it on and off with a simple python program as a final test of the gpio pin.
Ok, so I had to learn how to do that and order the parts. Now I have everything and written a little programm that makes the LED blink.

Two things:

1. As soon as I connected everything on the breadboard, the LED started to light up, albeit very faintly.
2. My program makes the LED blink in a 1 second interval.

After the program finishes, I get this message: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.

So I assume the PIN 12/18 (depending on where it is named) is not broken or damaged. But is it supposed to be "active" all the time? It is constantly on when connected.

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - possible reason?

Tue Jan 14, 2020 3:09 pm

Bit confused by your replay .

The LED being partly on when first connected suggests you a have done some damage because testing this on my pi4B the LED is not lit at all.


I would expect to see the warning about gpio in use only if you ran the blink program for a second time.

So does the LED blink when commanded to by your program ?


This is the bit I don't get
But is it supposed to be "active" all the time? It is constantly on when connected
So is the LED on full brightness or just at that low level ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - possible reason?

Tue Jan 14, 2020 4:57 pm

pcmanbob wrote:
Tue Jan 14, 2020 3:09 pm
Bit confused by your replay .

The LED being partly on when first connected suggests you a have done some damage because testing this on my pi4B the LED is not lit at all.


I would expect to see the warning about gpio in use only if you ran the blink program for a second time.

So does the LED blink when commanded to by your program ?


This is the bit I don't get
But is it supposed to be "active" all the time? It is constantly on when connected
So is the LED on full brightness or just at that low level ?
-It is constantly on, at approx. 75% brightness.
-As soon as I start the program ( I called it blink.py) it switches off, blinks as instructed by the program 10 times in full brightness
-then returns back to its state of constant 75% brightness.

I've used this code on a fresh install as well as on my original install. It is the same regardless.

Code: Select all

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARD)

GPIO.setup(12,GPIO.OUT)
GPIO.output(12,GPIO.LOW)


dauer = 0.5

for x in range(10):
        GPIO.output(12,GPIO.HIGH)
        time.sleep(dauer)
        GPIO.output(12,GPIO.LOW)
        time.sleep(dauer)

GPIO.cleanup()
EDIT: I did the same test with PIN 16 and took my newly acquired multimeter and measured stuff. I read that the LED - Diode should have 4mA of current and 3.3 volts is supposed to be on these pins. Now I'm not too familiar with the multimeter. I put it on 200mA and get a reading of 36 on PIN 16, on PIN 12 I get "out of range", so I put it to the 10A and get a reading of 700ma - so something is not right.

I assume it is save to take measurements with a multimeter

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - defective GPIO?

Wed Jan 15, 2020 10:30 am

So if its on at 75% all the time you have done some damage to the gpio .

I don't think you were testing correctly if you were getting a reading of 36mA or 700mA as a gpio pin can only supply 16mA, unless its a result of the damage, but if you were drawing 700mA from a gpio pin I would have expected the pi to have failed / died by now.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - defective GPIO?

Wed Jan 15, 2020 6:47 pm

pcmanbob wrote: So if its on at 75% all the time you have done some damage to the gpio .

I don't think you were testing correctly
Yes these numbers were from me testing incorrectly. I rewired my testing equipment as I should: In series. So I got a reading of 0.5 mA while the LED, blue one, was fully lit:
Image

However, I have ordered a Level Shifter and wired everything according to this schematic:
https://core-electronics.com.au/media/w ... ematic.png

Also, I tried the same on my Pi3 where the same circuit works. So the Pin must be damaged.

I would so much love to find out what exactly happened.

Image this is the proper wiring, apparently.

So, connecting the Coaxial power connector prior to booting results in the Pi not turning on, so I must plug it in during turned on state. I'm kind of anxious now that I break something again. Why does it not boot with it plugged in? The control leds even light up if powered off, does that mean some current flows back, and that's a bad thing?

I disconnected it for now until I know what's safe and what isn't.

pcmanbob
Posts: 7668
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: WS2812b stopped working - defective GPIO?

Wed Jan 15, 2020 9:11 pm

Don't use a metal tool to hold the LED strip down you could be shorting some thing.

I have no idea why your pi will not boot if the power to the LED strip is connected be for powering the pi , but some thing must be wrong.
I would so much love to find out what exactly happened.
as I said be fore we cant say because we were not present , as you don't know what your did wrong a part from disconnect powered connections,
you will probably never know.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
davidcoton
Posts: 4400
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: WS2812b stopped working - defective GPIO?

Wed Jan 15, 2020 10:51 pm

Coulomb wrote:
Wed Jan 15, 2020 6:47 pm
So, connecting the Coaxial power connector prior to booting results in the Pi not turning on, so I must plug it in during turned on state. I'm kind of anxious now that I break something again. Why does it not boot with it plugged in? The control leds even light up if powered off, does that mean some current flows back, and that's a bad thing?
Yes, you are managing to back-feed something into the Pi's 3V3 via the GPIOs. That is usually seen as a Bad Thing, for two reasons:
  1. the GPIOs are not designed to withstand more than 3V3, nor to tolerate 3V3 if switched to output, low. This can be fatal to the GPIO and the whole Pi.
  2. the PMIC (voltage converter) will see that voltage when the Pi supply is connected, and then refuse to start up.
Signature retired

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - defective GPIO?

Thu Jan 16, 2020 8:31 am

thank you very much for helping me with this, appreciate it
pcmanbob wrote:
Wed Jan 15, 2020 9:11 pm
Don't use a metal tool to hold the LED strip down you could be shorting some thing.
I just put the pliers for taking the photo on the strip for a second, and everything was powered off ( the red LED on the pi is always on) But thanks for pointing that out!
pcmanbob wrote:
Wed Jan 15, 2020 9:11 pm
as I said be fore we cant say because we were not present , as you don't know what your did wrong a part from disconnect powered connections,
you will probably never know.
Ok, keeping that in mind will hopefully prevent damage in the future.

davidcoton wrote:
Yes, you are managing to back-feed something into the Pi's 3V3 via the GPIOs. That is usually seen as a Bad Thing, for two reasons:
  1. the GPIOs are not designed to withstand more than 3V3, nor to tolerate 3V3 if switched to output, low. This can be fatal to the GPIO and the whole Pi.
  2. the PMIC (voltage converter) will see that voltage when the Pi supply is connected, and then refuse to start up.
I found the circuit of the Level Shifter I'm using. I noticed that on 3.3V it just sais out - but I'm using 3.3 as IN (I'm no electrician so these things are not as obvious to me)
Image
Image
Do you think that caused the backfeed of the current? I've done some more research and have ordered this Level Shifter : https://www.ebay.de/itm/74HCT125-Leitun ... 2749.l2649

User avatar
davidcoton
Posts: 4400
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: WS2812b stopped working - defective GPIO?

Thu Jan 16, 2020 3:21 pm

Coulomb wrote:
Thu Jan 16, 2020 8:31 am
I found the circuit of the Level Shifter I'm using. I noticed that on 3.3V it just sais out - but I'm using 3.3 as IN (I'm no electrician so these things are not as obvious to me)
...
Do you think that caused the backfeed of the current?
Yes. There is a 3V3 regulator on the level shifter board, fed from the 5V supply. You do not need or want any connection from the Pi's 3V3 to the level shifter 3V3. Making that connection will do exactly what you are seeing, as in point 2 of my last post. Just disconnect the 3V3 wire, leave 0V and signal, and it will automagically just work.

The good news is that this extra connection should not have done any permanent damage.
Signature retired

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - defective GPIO?

Thu Jan 16, 2020 5:05 pm

Awesome. So one of my Pis is now dead anyway, I can at least use that as a testobject :(

Ok, so following your advice, this is what I inferred from it

Image

But do I need the GND, which I marked with a question mark?

User avatar
rpdom
Posts: 15868
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: WS2812b stopped working - defective GPIO?

Thu Jan 16, 2020 5:19 pm

Coulomb wrote:
Thu Jan 16, 2020 5:05 pm
But do I need the GND, which I marked with a question mark?
Yes. You always need the ground. Try connecting just one end of a battery to a light bulb and leaving off the other end... nothing happens. It needs a ground to return the current, as does any circuit connected to a Pi.

Coulomb
Posts: 10
Joined: Fri Jan 10, 2020 11:14 pm

Re: WS2812b stopped working - defective GPIO?

Thu Jan 16, 2020 5:25 pm

rpdom wrote:
Coulomb wrote:
Thu Jan 16, 2020 5:05 pm
But do I need the GND, which I marked with a question mark?
Yes. You always need the ground.
This I knew, otherwise, no current can flow, right? I was just unsure if I maybe can "ignore" this side (the 3V3) of the Level Shifter completely.

Then I will disconnect the two cables and run it again.

I've also started a course for beginners to learn some more basics. I thought connecting a LED Strip was the easiest, most straight-forward thing and as simple as inserting a light bulb... I was wrong :lol: :lol:

Return to “Beginners”