Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5009

General • Re: Pico to run multiple LED's with input buttons

$
0
0
rpdom is correct. The on-board LED uses only about 3mA, I measured a current delta of 2mA on one board with a USB gizmo. So at 20mA each LED may look overly bright in a darkened room. If OP is happy to limit brightness to the 50mA RP2040 package max, direct connect with resistors is I think the "least bumpy" solution. One LED to one pin and it can perform any pattern you want.

I've only done direct GPIO connect with 7-segment LED displays (on PICs haha, I've only been a Pico user for a month), powering them one digit at a time. If that's too bright, then shorten the power-on time (reduce duty cycle). But older PICs on big packages have pretty generous power limits, say 300mA for the larger DIPs. I have less of a need to direct connect discrete LEDs, but one common application where LEDs are over-driven is IR LEDs.

Suppose I want to take some risk and direct connect all of the LEDs and run them using very short duty cycles. See Figure 170 (page 619) in the RO2040 datasheet. Then look at some LED curves:

https://lednique.com/current-voltage-re ... iv-curves/

Say we set output to 2mA drive and pins are active high. As current goes up, the output drivers will saturate and voltage will drop. Estimate the operating point from the graphs. A red LED might run at about 1.6V and 18mA or so. Blue about 2.4V and 12mA, and for white 2.6V and 10mA. All ballpark figures, guesstimates and hopefully RP2040s are usually near typical. Of course you are dropping the rest of the V in the RP2040, so run it for short periods only. RP2040 has a central thermal pad, so I think they will survive (touch wood). One just need to pulse them fast enough to get a steady light, maybe 1ms per LED. But it's best if you have more than one board, then if you kill some pins, it's a good learning experience. Anyway, I've never killed a PIC or Pico GPIO pin before, so I guess I'm still not that much of a radical experimenter.

Statistics: Posted by katak255 — Sun Apr 28, 2024 6:03 am



Viewing all articles
Browse latest Browse all 5009

Trending Articles