Powering Pico Pi w/ WS2812B #10074
Replies: 6 comments 7 replies
-
@IdidothBawx can you provide more info? Perhaps a photo of the wiring. How are you powering the strip (which pin is it connected to)? When you use external power, is it via the USB port, or via one of the V pins? Do you have a multimeter? Checking the voltage on the + pin on the strip would be a good thing to try. |
Beta Was this translation helpful? Give feedback.
-
What is this module: from picozero import Button My Pico W has no such module. |
Beta Was this translation helpful? Give feedback.
-
@IdidothBawx Where did you get |
Beta Was this translation helpful? Give feedback.
-
The reason this doesn't work is that pin 40, the VBUS pin, only acts as an output when the Pico is powered from USB. The LED strip is therefore unpowered when you run it from an external supply on pin 39. Simply move the V+ pin on the LED strip to pin 39 and it will work. You may be interested in this alternative approach which uses the official neopixel library and a much more minimal switch library. I only have an 8-LED Neopixel so the numbers are adapted. from neopixel import NeoPixel # Official driver
from machine import Pin
import uasyncio as asyncio
from primitives import ESwitch
async def blink(): # Influences onboard LED to indicate power to the Pico
led = Pin(25, Pin.OUT)
while True:
led(not led())
await asyncio.sleep_ms(500)
# Main program //
numpix = 8 # I only have 8
yellow = (255, 100, 0)
green = (0, 255, 0)
red = (255, 0, 0)
off = (0, 0, 0)
def line(np, start=0, end=numpix, color=off):
for x in range(numpix):
np[x] = color if start <= x < end else off
np.write()
async def main():
asyncio.create_task(blink())
sw = ESwitch(Pin(22, Pin.IN, Pin.PULL_DOWN), lopen=0)
pixels = NeoPixel(Pin(28, Pin.OUT), numpix)
line(pixels) # All off
while True:
await sw.close.wait() # Wait for switch to close
sw.close.clear()
line(pixels, 5, 8, red)
await sw.close.wait() # Wait for next closure
sw.close.clear()
line(pixels, 3, 5, yellow)
await sw.close.wait()
sw.close.clear()
line(pixels, 0, 3, green)
await sw.close.wait()
sw.close.clear()
line(pixels)
asyncio.run(main()) If you want to try it you'll need to create a |
Beta Was this translation helpful? Give feedback.
-
I'll review once again when I'm back in my office.
That said, the challenge is related to EXCLUSIVELY to power over USB.
I can connect/power the unit from my computer and everything works
perfectly.
When connecting to a power supply (e.g. powerbank, outlet) via USB, the
main.py will not function appropriately. I can confirm power to the Pico
via the onboard LED blink (see my code above), but the button choice
selection fails to illuminate any of the ws2812b LEDs -- each 5v power
option I try (options that are not my computer) push enough amperage;
multimeter confirms power all the way through.
…On Mon, Dec 5, 2022, 07:49 Peter Hinch ***@***.***> wrote:
The reason this doesn't work is that pin 40, the VBUS pin, only acts as an
output when the Pico is powered from USB. The LED strip is therefore
unpowered when you run it from an external supply on pin 39. Simply move
the V+ pin on the LED strip to pin 39 and it will work.
—
Reply to this email directly, view it on GitHub
<#10074 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AP4EIFJ5ELBXKG3IAM5BQMLWLXXHZANCNFSM6AAAAAASKZY7JY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
WS2812 is a 5V device, the Pico is a 3.3V device. Which with exactly 5V is: 5*0.7 = 3.5V. And the Pico is just giving it 3.3V. I'm guessing that you computer is actually outputting a bit less than 5V, especially when powering the LED string. Or maybe your external supply outputs a bit more. Anyway, you are probably just out of spec. You could try connecting the WS2812 strip to Vsys insted of Vbus. Then you will get the voltage drop over D1. But the correct solution is probably converting the 3.3V output to 5V. I use this circuit: (This is the same as the Philips i2c level shifter circuit. Explained here https://assets.nexperia.com/documents/application-note/AN10441.pdf). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Absolute newbie here...
Putting together a busy light for my office cubicle; 3d printed a miniature stoplight w/ lenses, inserted a strip of 10 ws2812b leds, push button for toggling red/yellow/green/off, code resides on the board as main.py, etc...
All connected to my Pi Pico and, when USB connected to my computer, functional. Button cycles through the defined choices (red/yellow/green/off) with absolutely no challenges.
Testing w/ an external power supply to the USB wasn't yielding anything, so I added a block of code to blink the onboard LED. Now, when powered externally, I can see that the main.py is running successfully because of the onboard LED. However, no lights on the 2812b strand, no toggle, nothing...
External power supply is 5v 2.5A -- I believe this should be enough. What [entirely obvious and forehead-smacking frustratingly simple] thing am I missing here?
Appreciate all of you!
Beta Was this translation helpful? Give feedback.
All reactions