Raspberry Pi Pico Tutorial : NeoPixels / WS2812B LED's

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • Welcome to the - Learn how to use the Raspberry Pi Pico Tutorial Series:
    This video looks at the NeoPixels / WS2812B addressable LED's using the Raspberry Pi Pico.
    In the first example we look at how to control the LED's individually and setting the color.
    The second example we make a simple Larson Scanner / Knight Rider LED's.
    We finish the video by looking at a prototype for an upcoming project on creating an Edge Lit acrylic clock also known as the cheap "nixie clock"
    Check out my channel for other videos on the Raspberry Pi Pico, as I will regularly upload tutorials and projects related to the Raspberry Pi Pico.
    If you found this tutorial helpful, subscribe to the channel and leave a comment and welcome to the NerdCave.
    Code:
    github.com/Gui...
    Library:
    github.com/bla...
    Getting started video:
    • Raspberry Pi Pico Tuto...

Komentáře • 75

  • @oliverbrown9146
    @oliverbrown9146 Před 22 dny +1

    This was a fantastic video!

  • @directorstu
    @directorstu Před 8 měsíci +3

    Thanks very much for this. Fast and too the point. But not so fast a newbie like me cannot follow it. Much appreciated!

  • @12polizei24wegvonhier
    @12polizei24wegvonhier Před rokem +2

    Great video!!!! Fun project for my Audi and will drive around until I get fined by the police and cry. Instructions and links were super helpful. Thanks for the coding. I’m learning Python on the fly and this is a fun way to do it.

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Glad it was helpful!, you should share the video

  • @Keeping_IT_Simple
    @Keeping_IT_Simple Před 2 lety

    2:24 you say verbally GP pin 21 but the diagram & code actually use GP pin 28
    really enjoying your style of explaining things - very relaxing but at the same time you manage to impart plenty of information

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety +2

      Thank you for your feedback, noticed that when I uploaded was using GP21 and then changed to 28 later to keep wiring more neat.

    • @Keeping_IT_Simple
      @Keeping_IT_Simple Před 2 lety +1

      @@NerdCaveYT not a problem , just wanted you to know that I actually pay attention to your videos !

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety

      @@Keeping_IT_Simple Thank you, I am happy to receive feedback, my comment section is real quiet.

  • @WilliamBurlingame
    @WilliamBurlingame Před 2 lety +3

    Thanks for the video. I was able to light a strip of 90 LEDs with my pico. I did have one problem. I get green instead of red on example 2. I didn't look to see what caused the problem. I just made red = (0, 255, 0) and made the adjustment for other colors.

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety

      I checked the library I made a change got the same but didn't update the original library what you can do is change this line to strip = Neopixel(numpix, 0, 15, "GRB")

    • @WilliamBurlingame
      @WilliamBurlingame Před 2 lety +1

      @@NerdCaveYT Thanks for the reply. I made the change. I also have increased the numbver of pixels I'm using on my project to 180 with one 5V input from the pico.

  • @FabZone4u
    @FabZone4u Před 6 měsíci +2

    You say "upload it to the pi" does this mean 'RUN' or do I have to save the code to the Pico itself? When I hat RUN nothing lights up, I only get "MPY: soft reboot" in the console

    • @NerdCaveYT
      @NerdCaveYT  Před 6 měsíci

      So there might be a few things going on, since it is just showing soft reboot means the code is running, but like you said no output can you send a image to my discord of your circuit?

  • @F1_zzzussy
    @F1_zzzussy Před rokem +1

    amazing vid, just wanted to know how to light up only one pixel.

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      will just change the code to one pixel, and thank you

  • @Jai.zTechDomain
    @Jai.zTechDomain Před 6 měsíci +1

    Thank You!

    • @NerdCaveYT
      @NerdCaveYT  Před 6 měsíci +1

      No problem, I probably need to do an update on those videos for example how to initialize multiple strips etc.

    • @Jai.zTechDomain
      @Jai.zTechDomain Před 6 měsíci

      @@NerdCaveYT I just adapted your tutorial to work with an old LED ring that I had lying around, pretty simple stuff once you understand. Thanks

    • @Jai.zTechDomain
      @Jai.zTechDomain Před 6 měsíci

      @@NerdCaveYT would you have any idea of how to make the neo pixels work so that they change colour based on the temperature coming from the pi picos internal temperature sensor? I have tried but can’t get it to work

    • @NerdCaveYT
      @NerdCaveYT  Před 6 měsíci

      Let me have a look at it this weekend, the best way will probably be a function that based on temperature change the RGB value so that when it gets warm it changes as temperature rise gradually and not instantly, the simple method is just if statements changing the color for every degree@@Jai.zTechDomain

    • @Jai.zTechDomain
      @Jai.zTechDomain Před 6 měsíci

      @@NerdCaveYT alright cool, thanks man

  • @heinzfpv4787
    @heinzfpv4787 Před rokem

    Great tutorials ❤❤

  • @djbongwater
    @djbongwater Před rokem

    awesome video, damn im such a noob

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      nah it is quick to learn since so many awesome already write most libraries it just finding them and using them. I am planning to start a total beginner series for the pico

  • @Alvin_Ajith
    @Alvin_Ajith Před 4 měsíci +1

    Is it possible to control the brightness of individual pixels separately ?

    • @NerdCaveYT
      @NerdCaveYT  Před 4 měsíci +2

      yes using the RGB value for example (0,0,0) is blank none where as (255,0,0) will be full RED but (128,0,0) would be half the brightness of RED

    • @Alvin_Ajith
      @Alvin_Ajith Před 4 měsíci

      @@NerdCaveYT Thanks !

  • @matthiasfalzon3997
    @matthiasfalzon3997 Před 2 lety

    Hello, thank you for this, it runs perfectly and I was quickly able to modify the code for more uses.
    Quick question, I used this neomatrix before on a raspberry pi 4 and it required a micro-controller which converted the gpio output to 5V, is this not required here? Clearly it is not required but it is safe to run it this way? I remember before that the adafruit documentation said that the DIN inputs need to be 5V, else it may damage the neomatrix.

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety

      The pico has a Vbus and Vsys which takes in 5V step it down to 3.3V. The Din pin connected to the pico is just where the data is sent to each pixel to control which one is on or off so it is an output not a input so the pin will not receive anything or be damaged and will be limited to sending out 3.3V dc

  • @StevenCookFX
    @StevenCookFX Před 8 měsíci

    Changes to recent builds makes the modules RP2 and machine non existent. I keep getting errors. I can't find anything about how to get around this other than using DigitalIO which means a lot of rewriting code. :/

    • @NerdCaveYT
      @NerdCaveYT  Před 8 měsíci

      is this what the error message gives you in Thonny? It would be easier if you send me pictures in discord so I can see what is happening, and of the circuit. This might be a dumb question but on the LED pin are you using Vin I know some manufactures put the input cable at wrong end of strip

  • @danijaime17
    @danijaime17 Před rokem

    Hello nice video, for me it doesnt work becaue of the libraries, could you tell me how i can install the libraries like utime, pin, array...?

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Are you running micropython on your pico and did you import all the libraries in the beginning.

  • @techminds5105
    @techminds5105 Před rokem

    hey NerdCave, I am getting this error and I was hoping maybe you can help me here :
    Traceback (most recent call last):
    File "", line 1, in
    ImportError: can't import name Neopixel
    and great video btw .

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Hello did you upload this library to your pico? github.com/Guitarman9119/Raspberry-Pi-Pico-/tree/main/Neopixel the neopixel.py "from neopixel import Neopixel" is the library on your pico the same as the line of code here from "neopixel"

  • @dantek6429
    @dantek6429 Před 2 lety

    I get this after running the script a few times:
    Traceback (most recent call last):
    File "", line 11, in
    File "neopixel.py", line 97, in __init__
    OSError: [Errno 12] ENOMEM
    Unplugging and then plugging back in seems to resolve the issue. Any idea what is going on here?

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety

      Not sure what will cause this, according to line 97 it is when it get initialized are the LEDs being power seperately or from the Pico

  • @Gruthius
    @Gruthius Před rokem

    I am using the "SEZO WS2812B RGB 5050SMD 8x32" LED Matrix from amazon and cannot for the life of me even get one pixel to go to a colour other than white at full brightness. I have tried both this library you have suggested and also the adafruit library with CircuitPython. Both give the same result. By selecting num of pixels just turns that many fully white, with the occasional green pixel at the end. Cannot modify the brightness or anything. Any suggestions?

    • @Gruthius
      @Gruthius Před rokem +1

      Figured it out, my GP28 pin was the issue, changed it to GP0 and it fixed everything.

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      I wonder why I know GP28 is the ADC2 but it should still be a GPIO pin with the added adc capability.

  • @jamesharris6062
    @jamesharris6062 Před rokem

    if your using your own power 5v do you only need to add the signal wire to the pi pico?

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      I powered the Pico from the 5V as well, but to answer your question just have to check if common ground is needed or not will get back to you on this one

  • @a35ij
    @a35ij Před rokem

    Hi, just wondering how you're getting on with the led clock project, could not find any video on it.

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Hello, so I have made one with the 8*32 RGB matrix. Just have not recorded it yet, but some good news is it will be up next week, getting back into CZcams making videos. I have taken a long break and ready to be back

    • @PhilipBloodD
      @PhilipBloodD Před 6 měsíci

      @NerdCaveYT - this is my first time watching and I enjoyed this video. I was also interested in the led clock project. Did that ever get posted?

  • @Videogame9559
    @Videogame9559 Před rokem

    Hi I have had difficulty running the program I only change number pixel to 25 I get an error line 3 no name random or no name neopixel. ? Any help please anyone. What do I need to update or install. Thanks

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Did you copy over the neopixel.py to your Pico, also are you running micropython and finally is the interpreter set to micropython, which is in the right corner of Thonny.

  • @joejvr5020
    @joejvr5020 Před 2 lety

    hey, using WS2812B with Pico, getting no errors on code but LEDs not working (29 LEDs without ext power supply) also using (pin40) power, (pin38) ground and (pin34) gp28, hoping you can point me in the right direction :) thanks

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety +1

      Hi, okay if you are getting no errors in code, then first suggestion will be to check the connections, that the GND is connected to any ground on the Pico, for the +5V can you connect it to VSYS(pin39) this will be the voltage after the regulator stage from you Pico. The Din pin just double check that it is Din and not Dout, lets try a different pin like Pin1 which should be GPIO0 so the line of code will be:
      numpix = 29
      strip = Neopixel(numpix, 0, 0, "RGB")
      If that still does not work, you can reach me on discord then we can take a look at the circuit. discord.gg/xY77FWRb

    • @joejvr5020
      @joejvr5020 Před 2 lety

      @@NerdCaveYT thanks for the help today, it was the Din/Dout that was reversed, thanks again

  • @peter7329
    @peter7329 Před rokem

    when i did night rider from the example it was green to get red i had to set red 0 255 0

    • @NerdCaveYT
      @NerdCaveYT  Před rokem +1

      I simple fix in the code where it says RGB change it to GRB

    • @peter7329
      @peter7329 Před rokem

      @@NerdCaveYT but what's caused it? I cut and pasted the code from the links

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      @@peter7329 I think it is in the library, because I made some changes it could be that I uploaded the wrong code by accident

    • @peter7329
      @peter7329 Před rokem

      @@NerdCaveYT I see thanks I've found the section micropython fir pico book

  • @squirralien1863
    @squirralien1863 Před 2 lety

    Is there a limit to how many LED's you can run with the pico, could you run a 32x8 panel with a completely random ? I have just discovered the pico and how affordable they are with the shortage of the RP boards.

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety +1

      Technically, VBUS on the Pico (pin 40) is capable of supplying 0.5A (USB 2.0) or 1.0A (USB 3.0), thus if you try to supply 32x8 if you have current limit and low brightness it would be possible but will be pushing the limit, a cheap external 5V dc charger will work just fine if you are planning to make a display with the 32x8 panel. I am planning to use the 32x8 panel to write text to screen via in Bluetooth in future videos.

    • @squirralien1863
      @squirralien1863 Před 2 lety +2

      @@NerdCaveYT I would run power direct to the panel and only use the pick for the signal/program, so no issue with power, that sounds great then the pick should handle it well.
      I want to have a 32x8 with just a random on off using maybe 20% on at any one time, not 100 percent on the 20% but I want to put it behind a server cabinet tinted glass door so it has a super computer random flash appearance, bit silly but would look pretty cool.
      I have two servers so maybe one for each server so with the power on its running then it’s an instant very flash power indicator.
      I also have a table top jukebox that was a cassette player radio that looks like the Werlitzer bubbler 1015 jukebox, I am putting a 5” screen in it and a pi 3b running fruitbox, so I might use a pico to run some lighting on that as well, normally it’s just lights constantly on, so adding animated light sequencers will top it off.
      Thanks for your video and I look forward to more.

    • @NerdCaveYT
      @NerdCaveYT  Před 2 lety +1

      That sounds cool, yes the Pico is depending on where you buy it between 2-5 dollar and really so great for beginners since you can use MicroPython / CircuitPython. The arduino boards also recently got more expensive due to the silicon shortage. I have not played around with audio visualizers but using that with the jukebox the react with the music would be cool, please do share the projects when your are finished, would like to see it, and thank you for your feedback.

    • @squirralien1863
      @squirralien1863 Před 2 lety

      @@NerdCaveYT I wasn't going to have the lights activating from the sound but I did come up with a plan, the outside has an arched light from the base up and over to the other side, this is where i will run a smooth soft slow colour change or maybe a series of patterns but always smooth and slow, in the middle of the jukebox is a u shaped light and I would like to work out how to have a VU style light effect starting from the centre bottom of the U shape and going out each side and upward, that one going to the music might be cool. I think because the jukebox is small being a table top the pico will be perfect, I guess it might take two one for each lighting effect and my pi3b to run fruitbox and the 5" display.
      I really do hope I can find your videos again when it is finished so I can share the end result, actually I will put a shortcut to this video in the jukebox folder, problem solved.
      I have a terrible memory so I lose so much info.
      This is a link to a picture of the model I have so you can picture the U shaped lights better
      i.ebayimg.com/00/s/MTAyNFg1NzY=/z/PoYAAOSwhuxaynBz/$_86.JPG

  • @yapzanan6753
    @yapzanan6753 Před rokem

    Is it save to drive 25 neopixels without any external powersupply? I intend to use it as rgb perkey for keyboard

    • @yapzanan6753
      @yapzanan6753 Před rokem

      according to the datasheet, neopixels use 60mA (pure white, max brightness), it supposed to draw arround 1.5A total. I used 0.1uF decoupling cap for every neopixels.
      Do I need some level shifter? Because as far as I know, Raspberry Pi Pico are not 5V tolerant and only use 3.3V logic

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      So in the video I used the 5V supply from the pico. The pico has a buck-booost converter so it can supply 5V but like you said limited current. If it is 25 leds which will not be full brightness I think it will be okay but it is probably better just to use an external supply to power the pico and LEDs on Vsys

  • @Videogame9559
    @Videogame9559 Před rokem

    Hi add code to thony pi pico and run it but got an error line 3. Random no name neopix?

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Hello, have you uploaded the from Neopixel library:
      Line 3: from neopixel import Neopixel
      it is included in the github repository

  • @cerensoysal2927
    @cerensoysal2927 Před rokem

    can we do this with WS2812B 8 leds?

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      Hi which part are you referring to in the video? You can change the number of pixels to be 8 and use it as needed in your code. It will start from pixel 0 and last one will be 7. Each pixel "LED" is programmable.

    • @cerensoysal2927
      @cerensoysal2927 Před rokem

      @@NerdCaveYT We are doing a project using Pi Pico and HC-05 Bluetooth module. We also use app inverter. We are using the ws2812b-8 led, there are 8 of them, but we could not light it. If the Pi is a 3.3 volt led, could it be because it gives 5 volts? Do we need to use any converter? Can we do it without using a converter? The delivery date is tomorrow and we're still having this issue, we've taken care of everything else.

    • @NerdCaveYT
      @NerdCaveYT  Před rokem

      @@cerensoysal2927 The V+ of the LED strip is connected to the Vsys of the Pico which will give it the 5V power then the Din pin can be any GPIO pin on the Pico, did you double check that you connect to the LED strip to pin In Din and not Dout that is often a problem I see people have

  • @MxS820
    @MxS820 Před 9 měsíci

    How can i use it on Rpi 4 using c++ ?

    • @NerdCaveYT
      @NerdCaveYT  Před 9 měsíci

      There should be a library for it, but using the Rpi why not use python or is your program written in C++

    • @MxS820
      @MxS820 Před 9 měsíci

      @@NerdCaveYT
      Yes my code is written in C++ :(