0

Arduino + Mosfet + NeoPixel Strip
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino + Mosfet + NeoPixel Strip

by travisgillespie on Tue Dec 22, 2020 6:19 pm

Hoping someone can help me understand how to wire a microcontroller (e.g. Arduino) to a Mosfet and 3-pin addressable NeoPixel strip (8 - 30 LEDs max). There are examples online with 4-pin RGB strips, but cannot figure out how to successfully drive a 3-pin with the Mosfet IRLB8721 https://www.adafruit.com/product/355. Also, tried various Adafruit boards (Trinket M0, Feather M0 Express, Metro 328, Metro Mini 328), and have read through multiple documents, but have overlooked something.

Becky Stern has a pretty cool example on TinkerCad, which I copied and modified slightly. The addressable strip lights up when Arduino pin (pin-3 in this case) is connected directly to data-in, but fails when pin-3 is connected to Mosfet gate (with drain connected to data-in, and source to gnd). My best guess is pin-3 is not producing enough voltage to turn the Mosfet on. Is there a way that I can re-wire or code my project to make it work? Here is a snapshot and link to my project for convenience.
https://www.tinkercad.com/things/7wydTXxboWQ-copy-of-copy-of-neopixel-strip/editel?sharecode=Dx3ggsY4FQ_O1FFwfjSid8B5no0tT5XSovuQlx3KNs0&sharecode=Dx3ggsY4FQ_O1FFwfjSid8B5no0tT5XSovuQlx3KNs0,
94371DDD-89A6-41A1-9878-10BB15550832.jpeg
94371DDD-89A6-41A1-9878-10BB15550832.jpeg (968.95 KiB) Viewed 104 times

travisgillespie
 
Posts: 7
Joined: Tue Sep 17, 2019 12:54 am

Re: Arduino + Mosfet + NeoPixel Strip

by blnkjns on Wed Dec 23, 2020 3:04 am

Remove the mosfet and connect it directly? its a data line, no power line.

blnkjns
 
Posts: 194
Joined: Fri Oct 02, 2020 3:33 am

Re: Arduino + Mosfet + NeoPixel Strip

by travisgillespie on Thu Dec 24, 2020 8:20 pm

Thanks for sharing. Can you provide some more feedback? I am new to this stuff and want to learn it.

• Why won’t mosfet work with a data line on a 3-pin neopixel strip, but it will work when hooking mosfets up to RGB 4-pin led strip like this example https://learn.adafruit.com/rgb-led-strips/usage?

• How are the RGB terminals on the 4-pin different from a DIN terminal?

E96E76CE-2660-4928-8F87-081F0A65C2B4.gif
E96E76CE-2660-4928-8F87-081F0A65C2B4.gif (74.07 KiB) Viewed 89 times

travisgillespie
 
Posts: 7
Joined: Tue Sep 17, 2019 12:54 am

Re: Arduino + Mosfet + NeoPixel Strip

by blnkjns on Fri Dec 25, 2020 11:47 am

That is a system where the mosfets are used to PWM (pulse-width-modulate) the brightness of each of the 3 colours in parallel: that example will have THE SAME COLOUR for every LED. It is a passive system. The mosfet has to switch the current of ALL connected LED's at once, which can be a couple of Ampere.
Neopixel on the other hand is an active system, where EACH LED has a controller IC that does the PWM for each led individually. You only need to feed it a stream of RGB values, and it will pick the right one from the series for each connected LED. All Neopixels can have DIFFERENT COLOURS. The power switching happens INSIDE the LED, it has built in transistors that PWM the direct connected 5V to the three colour LED's in the module. Din/Dout only transfers the data values throughout the string, which is a matter of micro-amperes.

blnkjns
 
Posts: 194
Joined: Fri Oct 02, 2020 3:33 am

Re: Arduino + Mosfet + NeoPixel Strip

by travisgillespie on Fri Dec 25, 2020 2:34 pm

This is very helpful, thank you :)

travisgillespie
 
Posts: 7
Joined: Tue Sep 17, 2019 12:54 am

Please be positive and constructive with your questions and comments.