-2

I've got a 5 meter LED strip connected to a breadboard as such

12V Supply

(+) -> (+) on breadboard rail

(-) -> ground on breadboard rail

Arduino (Wemos D1, all pins w/ PWM)

pin7 -> gate(1st MOSFET)

pin8 -> gate(2nd MOSFET)

pin9 -> gate(3rd MOSFET)

GND -> ground on breadboard rail

MOSFETs (IRLB3034 equivalent)

Gates (already explained)

Drain(1st MOSFET) -> Red line on WS2812 strip

Drain(2nd MOSFET) -> Green line on WS2812 strip

Drain(3rd MOSFET) -> Blue line on WS2812 strip

Source(all MOSFETs) -> (-) on breadboard

And despite this, when I run an extremely simple program such as this, I get white light (all being lit up), and can never individually address a color. I can write all to 0 and will still have a white light, same with writing all to 255, and same again with writing one or two to 255 and the remainder to 0.

int redPin = 7;
int bluePin = 8;
int greenPin = 9;

void setup() {

}

void loop() {
  analogWrite(redPin, 255);
  analogWrite(bluePin, 0);
  analogWrite(greenPin, 0);

}

I'm thinking my AliExpress board may just be faulty, advertising PWM on every pin when that is not the case, or I may have selected the wrong MOSFETs for this application. Using this identical setup (same breadboard, same MOSFETs) with my Raspberry Pi 2B I was able to change the color of the lights.

Hoping someone here has worked with the Wemos D1 and can help. The documentation on this board seems to indicate that everything should be working, but it is not. I have two boards (same seller) and can confirm that it works with neither.

  • 1
    "Red line on WS2812 strip" Uh... WS2812 only have power and data. – Ignacio Vazquez-Abrams Sep 22 '16 at 1:42
  • 1
    You say “with my Raspberry Pi 2B I was able to address the lights individually” ... was the program the same? Or perhaps you used a WS2812 library on the Raspberry? Anyhow, each WS2812 has a chip that PWM's the lights; they aren't intended for external PWM. – James Waldby - jwpat7 Sep 22 '16 at 2:01
  • 2
    A schematic (instead of the text) would greatly improve the quality of your question. – sa_leinad Sep 22 '16 at 2:45
  • 1
    Please supply some details on the LED strip you have and how it is powered since it's clearly not WS2812's. – Andrew Sep 22 '16 at 8:09
0

Unfortunately the WS2812 LEDs color is set by powering it up and sending data to it. This means that you don't need the FETs at all.

Sparkfun have a really good walkthrough for hooking up and controlling these LEDs:
WS2812 Breakout Hookup Guide

To achieve what you set out to do (ie controlling the color with the FETs) you will need a different analog LED strip (such as this). Adafruit have a really good walkthrough for hooking up and controlling the LEDs in this fashion.
Controlling Analog RGB LED Strips

  • The setup duplicates this ( popoklopsi.github.io/RaspberryPi-LedStrip/#! ) to a T. The strip I have is non-addressable, and needs about 5A to power it when R,G, and B are at full throttle. Unfortunately none of the examples in that Sparkfun link apply to my case, as each refer to individually addressable strips. The way I understood it was that the lines each carry 12v and use the PWM to dim/brighten each color individually, hence the MOSFET. This has worked before in an identical setup, with the only change being using a RPi instead of the Wemos. – Logan Halloran Sep 22 '16 at 5:57
  • 1
    Are you sure that the LED strip is using WS2812 LEDs. According to the datasheet (cdn-shop.adafruit.com/datasheets/WS2812.pdf) it is controlled by digital data. – sa_leinad Sep 22 '16 at 6:59
  • @Logan Halloran, thanks for the link. Just to prove that your circuit works, have you tried the program controlling the I/O digitally (ie. digitalWrite())? You may need to add a pull down resistor to the gate of the FETs. Something like this: github.com/freetronics/NDriveModule/raw/master/… – sa_leinad Sep 22 '16 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.