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

HATs and other add-ons • Re: Neopixels giving strange results

$
0
0
I have recently been thru the process of controlling a NeoPixel strip from the Pico using a transistor to control NeoPixel power. Here are
my Obsidian notes from that project; hope the notes explain what you need to do.

General Principle: Use the GPIO pin's low current to control a transistor, which switches a separate, higher-current power supply to the NeoPixels.
Using an NPN Bipolar Junction Transistor (BJT) as a Switch:

Connect NeoPixel positive (+) to separate power supply positive (+).

Connect NeoPixel negative (-) to the BJT collector.

Connect the BJT emitter to both Pico GND and power supply GND.

Connect the Pico GPIO through a current-limiting resistor (100Ω-1kΩ) to the BJT base.

Setting the GPIO HIGH (3.3V) turns the BJT ON, powering the NeoPixels.

Setting the GPIO LOW (0V) turns the BJT OFF, cutting power to the NeoPixels.
Important Considerations for BJTs: Choose an NPN transistor with sufficient collector current rating for your NeoPixels. The base resistor value is critical.
Using an N-Channel MOSFET as a Switch:

Connect NeoPixel positive (+) to separate power supply positive (+).

Connect NeoPixel negative (-) to the MOSFET drain.

Connect the MOSFET source to both Pico GND and power supply GND.

Connect the Pico GPIO (optionally through a resistor) to the MOSFET gate. Consider a pull-down resistor (e.g., 10kΩ) from the gate to GND.

Setting the GPIO HIGH (3.3V) (above the gate threshold voltage VGS(th)) turns the MOSFET ON, powering the NeoPixels.

Setting the GPIO LOW (0V) turns the MOSFET OFF, cutting power to the NeoPixels.
That looks like AI. It's also not relevant to the problem at hand (which is another AI trait).

Statistics: Posted by ame — Mon Apr 07, 2025 2:07 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles