Тёмный

How to wire up WS2811 RGB LEDs to the Raspberry Pi 

TeCoEd
Подписаться 3,4 тыс.
Просмотров 38 тыс.
50% 1

Wire up a string of RGB LEDs (Ws281x) to your Raspberry Pi and write a short Python code to control the LEDs. Uses Adafruit Circuit-Python library and neopixel libraries.

Опубликовано:

 

23 фев 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 134   
@mikehlusak1371
@mikehlusak1371 4 месяца назад
1000 thank you's! I have tried getting these going every few months, then I give up. Finally 100% working; thanks!!
@TeCoEd
@TeCoEd 4 месяца назад
Excellent glad that the video was useful. 👍
@kayajones9215
@kayajones9215 3 года назад
This video was amazing for me, thank you sm. others are so confusing and you go over everything and give an explanation thank you again
@TeCoEd
@TeCoEd 3 года назад
I'm so glad!
@TobiasHolmPiano
@TobiasHolmPiano 4 года назад
Well done and helpful - thank you! :)
@TeCoEd
@TeCoEd 4 года назад
glad it helped, I spent many hours looking for an easy guide, did not find one, so I made one instead!
@n0b0t19
@n0b0t19 4 года назад
Great walk-through! Thanks :-)
@TeCoEd
@TeCoEd 4 года назад
Glad you enjoyed it!
@the_wub
@the_wub Год назад
This was so helpful, thank you!
@TeCoEd
@TeCoEd Год назад
You are welcome
@dablet
@dablet 2 года назад
that was great! thank you mate
@normhapp8629
@normhapp8629 3 года назад
Very good video. One question: is the data from the RP 5v or 3.5v? Another video said that you need a voltage converter to get 5 volts on the light string data line. Thanks, Norm
@TeCoEd
@TeCoEd 3 года назад
The data is from GPIO pin 18 I think. The 5volts is provided by a separate power supply.
@normhapp8629
@normhapp8629 3 года назад
@@TeCoEd I looked at the RP specs and GPIO is 3.5v (on) or 0 (off). That being said, your configuration works on your video. Possibly could become a problem addressing a large number of lights. However, thanks again, your video is one of the best I have seen.
@TeCoEd
@TeCoEd 3 года назад
@@normhapp8629 I see. Yes you can power the LEDs with the 5v pin however it is not a constant and you may get full LEDs. Suitable for small LEDs though.
@josephhansen1320
@josephhansen1320 5 месяцев назад
Thanks so much this was really helpful
@leesahcage3297
@leesahcage3297 3 года назад
Excellent video, one of the best I have seen. How many pixels can the Pi control?
@TeCoEd
@TeCoEd 3 года назад
Thanks. The LEDs are powered by a 5v power supply and you can run about 300 and then they start to fade out. But just add another 5v supply half way and then you can add another 300. So you can run as many as you like to from the Pi.
@leesahcage3297
@leesahcage3297 3 года назад
@@TeCoEd Really so if I had 3 5v 40A power supplies do you think I can control 1000 pixels with one raspberry pi Zero W or 4B?
@TeCoEd
@TeCoEd 3 года назад
@@leesahcage3297 yes that is correct. The Pi is simply to provide the code and control the LEDs. so you need the power supplies.
@TeCoEd
@TeCoEd 3 года назад
@@leesahcage3297 check this out. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oGtUr5dmoPk.html
@jaws2531
@jaws2531 3 года назад
Great Video! Question, are you also using a level shifter? From what I have read the Raspberry Pi GPIO pins output @ 3.3v and the NeoPixels need 5v for the data and thats where the level shifter apparently comes in. I have tried your exact setup pretty much and so far I can't get it to power up any of the leds. I am guessing its because I don't have a level shifter and was just verifying if you were using one. Thanks!
@TeCoEd
@TeCoEd 3 года назад
Hi. No level shifter. The LEDs are powered by a separate 5v power supply. Some LEDs require 12v so you may need a different powder supply. Check the LED model and the recommended power supply.
@TeCoEd
@TeCoEd 3 года назад
Also check from 2 mins into the video. I talk about how to rig up the power. First time I set them up I was using the wrong power supply.
@jaws2531
@jaws2531 3 года назад
@@TeCoEd Thanks as this was another idea I had also to what my problem is. I have another power supply arriving tomorrow that is a 5v 60a so it should good. My current was 5v 4a, which I thought was similar to yours but it doesn't seem to light any leds up. Once I get this all figured out my goal is to retro fit a 1981 Nevco Score Board from a local HS gym with Led lights that I can control a bit to just set a fake time and score. Will be just for decoration in the shop =) Thanks for your advice. Have a great 2021!
@TeCoEd
@TeCoEd 3 года назад
@@jaws2531 that sounds like a great project. Let me know how you get on.
@jaws2531
@jaws2531 3 года назад
Well good news.... I solved my own issue. Apparently I missed this part: sudo nano /etc/modprobe.d/snd-blacklist.conf blacklist snd_bcm2835 Once I created that file with that line everything works now!
@Codebyakshay
@Codebyakshay 8 месяцев назад
The lines are so basic 😂i am amazed thanks tho ❤❤ respect from india
@TeCoEd
@TeCoEd 7 месяцев назад
ru-vid.comszkbxcfkrbU
@_livelovelife
@_livelovelife 3 года назад
I'm going to running the same setup, just a slightly different program to light the LEDs. Anyway, do I have to use the 2 wires hanging off to the side? Could I use the positive red wire on the connector instead and run it to the positive terminal on the power supply? And could I also just attach two ground wires to the negative terminal and route one of them to the ground on the pi, and then one of them back to the LED strip? (I'd prefer to do it this way, it's just more convenient and saves a bit of space in my setup. Please let me know if this works. Thank you).
@TeCoEd
@TeCoEd 3 года назад
The connector is used to join the red and white wires to the power supply, you don't have to use it. As long as there is a separate power supply and only the data and ground run from the Pi pins then it will work.
@_livelovelife
@_livelovelife 3 года назад
@@TeCoEd Forgot to ask, but does this work with the WS2812B LED strip? Thanks. I have that one lying around as well that I might want to go ahead and test
@TeCoEd
@TeCoEd 3 года назад
@@_livelovelife it should do.
@avachavoshi574
@avachavoshi574 3 года назад
thank you very much. just one question, how to turn the leds off afterwards?! :D
@TeCoEd
@TeCoEd 3 года назад
Try pixel.clear() or pixel.off()
@JuanGiovaniLandaCervante-hz6iv
@JuanGiovaniLandaCervante-hz6iv 24 дня назад
Se pueden controlar 1600 leds?
@ch41ky822
@ch41ky822 3 года назад
Great video, Would a 5v 3A usb to dc work instead of a plug ? I'm building a cabinet but limited in socket space although i have usb ports in the wall sockets or even usb port on raspberry pi4 8gb!
@TeCoEd
@TeCoEd 3 года назад
Yes this would work as long as you have the correct ends. The plug power is great for longer lengths of LEDs as they begin to lose the brightness at the end of the length. Over 100 and they start to fade, so the power plug keeps them bright and the correct colour.
@ch41ky822
@ch41ky822 3 года назад
@@TeCoEd great thank, u have 50 led bulbs around the screen of on my machine so im hoping this will work, cheers thanks for reply,
@TeCoEd
@TeCoEd 3 года назад
@@ch41ky822 yes 50 LEDs will be fine. I had chained together 300 LEDs.
@loudthing87
@loudthing87 Год назад
Where is your music from? It's catchy.
@TeCoEd
@TeCoEd Год назад
Here is the link for the music. soundimage.org/
@ZenerFox
@ZenerFox 7 месяцев назад
I am confused about what to do when the arrow goes up. Does that mean that I have to use the male end to connect the green and white wires to the raspberry pi and white and red to the adapter?
@TeCoEd
@TeCoEd 7 месяцев назад
The arrow is the direction the data flows in, it indicates which end to attach the data cable from your Pi to. If the arrow is pointing up then go to the bottom other end of the LEDs and attach the wires from that end.
@synthstatic9889
@synthstatic9889 9 месяцев назад
Great video! My string of LEDs came with a male connector that is supposed to plug the LEDs into the controller pins (rasberry pi pico in this case) the connector has a power wire. Should I remove the power wire before plugging it into my pi?
@TeCoEd
@TeCoEd 9 месяцев назад
Yes, have you got an external power supply for the LEDs?
@synthstatic9889
@synthstatic9889 9 месяцев назад
Yes
@TeCoEd
@TeCoEd 9 месяцев назад
@@synthstatic9889 OK, so use the power supply and remove the wire before plugging in.
@synthstatic9889
@synthstatic9889 9 месяцев назад
@@TeCoEdwill do. Thanks!
@davisspradling5456
@davisspradling5456 9 месяцев назад
I can only get one light to come up on for some reason and it seems to be the first light. My lights show the data arrow pointing up on every light where I noticed that yours point down. Could this be the problem?
@TeCoEd
@TeCoEd 9 месяцев назад
What power supply are you using? This can be the cause.
@kenmcmullan9330
@kenmcmullan9330 3 года назад
What's the red wire for in the triple connector?
@TeCoEd
@TeCoEd 3 года назад
Red wire is the power wire.
@dswersky
@dswersky 3 года назад
Thanks for this! Got it working great with a pi Zero with one hitch- the animations work, but there's some glitchy flickering. I've changed the /boot/config.txt, added the recommended hdmi settings. Still some strange random-color flickering. Any ideas? Thanks again!
@TeCoEd
@TeCoEd 3 года назад
It could be a power issue? Are you powering the LEDs on a separate supply?
@dswersky
@dswersky 3 года назад
@@TeCoEd Yes, I'm using a 5V/5A external power supply. I read elsewhere that it could be the power/ground/data connections, I'm using some thin prototyping leads. Going to solder some heavier-gauge wire in and use JST connectors, see if that helps.
@TeCoEd
@TeCoEd 3 года назад
@@dswersky It may be the power supply. I had 300 LEDs chained together and had to use a 12v supply to the colour fading by the end of the chain. Different LEDs also use different voltage.
@dswersky
@dswersky 3 года назад
@@TeCoEd This strip only has 50 leds, it's identical to the one you have in this video.
@TeCoEd
@TeCoEd 3 года назад
@@dswersky must be the wire quality then.
@pb9756
@pb9756 2 года назад
I know this is a bit old, but can you put a parts list that you used?
@TeCoEd
@TeCoEd 2 года назад
Pi 4 and the any WS2811 LEDs. Also a 12volt power adapter and the adapter. 👍
@canaust96
@canaust96 7 месяцев назад
The sudo pip3 install returns the error “this environment is externally managed…” I have pi 4 and just installed 64bit OS. I’ve tried the .venv route with no luck. Any ideas?
@TeCoEd
@TeCoEd 7 месяцев назад
Hi. Try pip3 install, pip install. Remove the sudo.
@jannikthyzen1407
@jannikthyzen1407 3 года назад
can i also connect the red Wire to 5v of Raspi? So there is the same power supply for both
@TeCoEd
@TeCoEd 3 года назад
Do you mean use the red wire to power the Pi or use the red wire to power the LEDs from the 5v?
@jannikthyzen1407
@jannikthyzen1407 3 года назад
@@TeCoEd I mean to power the Pi...so i dont need another connection via mini usb to the plug
@TeCoEd
@TeCoEd 3 года назад
@@jannikthyzen1407 the 5v pin provides 5v output only. If you input 5v you risk damaging the Pi. You can get add on board such as the Pixel Pi that only require 1 power source.
@jannikthyzen1407
@jannikthyzen1407 3 года назад
@@TeCoEd ok thanks for the answer! :-) I will check for other ways to power the Pi via GPIO
@ch41ky822
@ch41ky822 3 года назад
How do I get these blinking/ flashing with music etc please?
@TeCoEd
@TeCoEd 3 года назад
I had to program the lights to go with he music. I could not find a sounds activated code. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-tikqi6JMaOo.html.
@kayajones9215
@kayajones9215 3 года назад
Hey, nice video. I have been trying to wire up WS2813 lights however it is not working.
@TeCoEd
@TeCoEd 3 года назад
What power supply are you using ?
@kayajones9215
@kayajones9215 3 года назад
@@TeCoEd Hey i figured it out
@willdoyle5380
@willdoyle5380 3 года назад
@@kayajones9215 what did you do?
@otto.bjorkland
@otto.bjorkland 2 года назад
@@kayajones9215 How did you do? I cannot figure out how to do it
@tinkertron
@tinkertron 3 года назад
how many amps is that power plug?
@TeCoEd
@TeCoEd 3 года назад
5volts and 4amps.
@conceptroot
@conceptroot 4 года назад
how to run this code with no sudo?
@TeCoEd
@TeCoEd 4 года назад
You can't, it requires you to run the code with sudo. But, if you open Python in the terminal with 'sudo Python', then you can run the code from Python IDE.
@andrespalusalu7393
@andrespalusalu7393 4 года назад
can I also use a battery or a powerbank as an external power supply?
@TeCoEd
@TeCoEd 4 года назад
Yes, I use the Anker power packs, they provide around 6 - 8 hours of use.
@GhettoArabSage
@GhettoArabSage 3 года назад
@@TeCoEd is this to power the rpi or the LED? I'm looking for a solution to only have one power supply to light up a few LEDs.
@TeCoEd
@TeCoEd 3 года назад
@@GhettoArabSage the 5V power supply is for the LEDs. Because there are over 50 and you lose the signal powering it from the Pi.
@GhettoArabSage
@GhettoArabSage 3 года назад
@@TeCoEd if I'm not mistaken the gpio pin is 5v, no? Why the need for extra energy?
@GhettoArabSage
@GhettoArabSage 3 года назад
@@TeCoEd thanks for the reply btw. I really appreciate it.
@DanFagerburg
@DanFagerburg 2 года назад
I am having trouble getting my lights to respond to the python I write. I have no way of knowing why my GPIO pins may not be working- Help?
@TeCoEd
@TeCoEd 2 года назад
Some things to check, 1) the LEDs are compatible, you are using the version of the LED library, Pi software is up to date. Let me know how you get on.
@crazierpuma_6080
@crazierpuma_6080 Год назад
Hi TeCoEd, thanks for your video. I've been following yours steps but when i put "sudo pip3 install adafruit-circuitpython-neopixel" it appears one error. "Python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kqjsi4hc/sysv-ipc/ I've seen that someone had the same problem but no solution
@TeCoEd
@TeCoEd Год назад
Try without pip3 just pip.
@crazierpuma_6080
@crazierpuma_6080 Год назад
@@TeCoEd New error "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xTd60y/adafruit-circuitpython-neopixel/ ( I'm a noob at this :,) )
@TeCoEd
@TeCoEd Год назад
@@crazierpuma_6080 are you running the code in root?
@TeCoEd
@TeCoEd Год назад
@@crazierpuma_6080 also Adafruit have updated their instructions. learn.adafruit.com/neopixels-on-raspberry-pi/python-usage
@crazierpuma_6080
@crazierpuma_6080 Год назад
@@TeCoEd ok, ill try it now. I don't know if I'm running out in root
@David-zw8xu
@David-zw8xu 3 года назад
Hello! Whenever I run "sudo pip3 install adafruit-circuitpython-neopixel" I end up with this message: 'Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-51ng5rn6/adafruit-circuitpython-neopixel/', and when I run the test .py in the terminal, it reports there is no module named board or neopixel. How can I fix this? Thank you!
@TeCoEd
@TeCoEd 3 года назад
It may be because you have to specify the type of neopixels. Try, sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
@David-zw8xu
@David-zw8xu 3 года назад
@@TeCoEd Thanks for the speedy reply. I tried what you suggested, and and it didn't work. I am pretty much new to raspberry pi projects, so maybe there could be something flying over my head?
@TeCoEd
@TeCoEd 3 года назад
@@David-zw8xu are you using the newest version of the Pi OS?
@TeCoEd
@TeCoEd 3 года назад
@@David-zw8xu you may need to install pip, www.linuxscrew.com/install-pip
@David-zw8xu
@David-zw8xu 3 года назад
@@TeCoEd Thank you so much for your help, I've done both but to no avail.
@ScottWinterringer
@ScottWinterringer 2 года назад
oh, this is for wirepy or whatever.
@timleimbach5817
@timleimbach5817 3 года назад
Why didn't you use any resistors?
@TeCoEd
@TeCoEd 3 года назад
Not needed as the power is from the supply plug, not the Pi so, as long as you don't put the wires around the wrong way it all works. 👍
@timleimbach5817
@timleimbach5817 3 года назад
@@TeCoEd Awesome thanks! I'm currently trying to make the same setup.
@TeCoEd
@TeCoEd 3 года назад
@@timleimbach5817 let me know how you get on. 👍
@timleimbach5817
@timleimbach5817 2 года назад
@@TeCoEd Life got in the way so I took a break, but just made it work! Thanks
@Wesfelkins
@Wesfelkins 3 года назад
It compiles but nothing happens.. any advice?
@TeCoEd
@TeCoEd 3 года назад
Are you using the correct voltage. Some LEDs require 12 some 5.
@Wesfelkins
@Wesfelkins 3 года назад
@@TeCoEd Yes 5 Volt WS2811. It works on the 5 volt arduino for reference
@Wesfelkins
@Wesfelkins 3 года назад
@@TeCoEd Yea, it just turns them all off for some reason..
@Wesfelkins
@Wesfelkins 3 года назад
@@TeCoEd FIXED: I had to use GPIO 10
@TeCoEd
@TeCoEd 3 года назад
@@Wesfelkins great job. I was going to suggest the GPIO pins next.
@douglasoshea8064
@douglasoshea8064 2 года назад
no picap?
@TeCoEd
@TeCoEd 2 года назад
I have a PiCap but had already started the project. I will make a video on the new year using the PiCap.
@thefonze1985
@thefonze1985 8 месяцев назад
no
@TeCoEd
@TeCoEd 3 года назад
Adapter plug here www.amazon.co.uk/inShareplus-100-240V-Adapter-Voltage-Transformer/dp/B088WBTNRV/ref=mp_s_a_1_9?dchild=1&keywords=led+adapter+for+lights&qid=1616882800&sprefix=LED+adapter+&sr=8-9
@someguy650
@someguy650 3 года назад
Is there a way to chain multiple of these strips together connected to one pi? I can’t find the size I need so is that possible?
@TeCoEd
@TeCoEd 3 года назад
Yes you can join as many as you want. You just need to use additional power supplies. I had 100 and they were fine. Then 200 news another power supply.
@someguy650
@someguy650 3 года назад
I did some more research and understand it a bit more now. It depends on the watts the lights use so you might be able to get away with one power supply depending on the lights. This was the first and clearest video that didn’t use some breadboard. Thanks!
@TeCoEd
@TeCoEd 3 года назад
@@someguy650 you are welcome. I am glad that you found it helpful.
Далее
I’m Never Buying LEDs Again! EASY DIY WLED!
13:11
Просмотров 1,2 млн
Blinking LED Raspberry Pi Tutorial
12:32
Просмотров 24 тыс.
Multicoloured LED Pixels WS2811 & IR Remote Controller
10:01
A Better Way To Make Better Breadboard Jumper Wires
10:43
Turn Your Pi into a DMX Gateway!!! - D.I.Y Theatre
22:46