0
\$\begingroup\$

I'm attempting to control an LED Lighting Strip from a RasperryPI GPIO pin. I have the following setup:

schematic

simulate this circuit – Schematic created using CircuitLab

Diagram of schematic

This is the diagram I have replicated except for only a single channel rather than RGB.

With this setup, the LED strip doesn't light up at all regardless of whether the GPIO pin is powered or not. I feel like I'm using the wrong FET, and if that is the case, what would be a more suitable FET to use in this instance?

\$\endgroup\$
  • \$\begingroup\$ You are not using the wrong FET but the wrong circuit. The control hast to be on the gate and the load on the drain, you have them the other way. Also the voltage connection is wrong. Try to make a simple circuit work with a single LED, learn it and come back to the strip. \$\endgroup\$ – Claudio Avi Chami May 21 '16 at 0:47
  • \$\begingroup\$ That schematic is wrong. Gpio to the gate. Led strip cathode to the source, ground to the drain. \$\endgroup\$ – Passerby May 21 '16 at 0:48
  • \$\begingroup\$ The FET is probably also not suitable. You need a logic-level FET that can be activated with a Vg_th of less than 3.3V. \$\endgroup\$ – Daniel May 21 '16 at 0:49
2
\$\begingroup\$

Three issues.

  1. Your schematic is wrong for the setup you want. It should be wired GPIO to Gate, LED Cathode to Source, and Ground to Drain. You correctly have the 12 Volt supply ground tied to the RPI ground. See @Daniel's answer for the correct schematic.

  2. Even with the right schematic, you have miswired the mosfet. The BUZ91A datasheet says its left to right Gate, Drain, Source. Your extta picture shows its currently wired as Drain, Gate, Source, explaining the behavior of 50% on when the GPIO is 3.3V, 100% on when GPIO is 0V. I'm shocked your RPI hasn't been fried, as using the GPIO as the Drain on 12V would mean all that voltage and current goes through your RPI's cpu.

enter image description here

  1. Once you fix the wiring, you may see that the mosfet won't turn on all the way. The datasheet shows that it's Voltage Gate - source Threshold is 3V typical, 4V max. Meaning that it may barely work at the RPI'S 3.3V level. That Mosfet is not well suited for 3.3V logic level applications. At 3.3V, the FET won't even pass fractions of an Amp. You made need a driver, see below.

enter image description here

If you want to stick to that mosfet, and you haven't somehow fried your RPI or the Mosfet, then you could use a NPN transistor as a driver. A 2n3904 or 2n2222 or any similar. It's not critical, it's just a switch. Logic will be reversed, so on the RPi, A logic High/3.3V will turn the leds OFF.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
\$\begingroup\$

This is what you're trying to do...

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Using this circuit, I can now control the strip to a certain extent. When the GPIO pin is outputting 3.3V, the LED strip is at around 50% brightness. When the GPIO pin is outputting 0V, the LED strip reaches its full brightness. Does that mean the FET isn't able to be fully activated with 3.3V? \$\endgroup\$ – Joe Torraca May 21 '16 at 1:21
  • \$\begingroup\$ @joe that means either it's broken, or you have the led strip connected to the drain and not the source. \$\endgroup\$ – Passerby May 21 '16 at 1:51
  • \$\begingroup\$ The online documentation for the BUZ91A says it's an n-channel so it must be broken then if that is the case. \$\endgroup\$ – Joe Torraca May 21 '16 at 1:52
  • \$\begingroup\$ @joe take a picture of your actual wiring, up close and in focus please. \$\endgroup\$ – Passerby May 21 '16 at 1:53
  • \$\begingroup\$ @Passerby Pictures here: imgur.com/a/QP7d2 \$\endgroup\$ – Joe Torraca May 21 '16 at 2:00
1
\$\begingroup\$

Your current setup has current going directly from the battery to the Raspberry Pi. You're correct in using a Raspberry Pi to control the gate of the FET, but as it stands the power supply will never drive the LED strip.

As Joe recommends, placing the load (i.e. LED strip) on the drain of the FET and grounding source will complete a circuit to power on the LED. It would also be a good idea to add a resistor after the LED strip to prevent it from damage, depending on its ratings.

\$\endgroup\$
  • 1
    \$\begingroup\$ It sounds like your MOSFET is in backwards. See my note about Vgs_th above too. \$\endgroup\$ – Daniel May 21 '16 at 1:07
  • \$\begingroup\$ Correction: I just tried this setup (LED strip on drain, GPIO to gate and GND to source) and the LEDs will light up as long as the wire from GND to the Raspberry Pi is disconnected. Otherwise the strip remains off. Obviously with the RPi disconnected, it's not able to be controlled so it's always at max brightness. \$\endgroup\$ – Joe Torraca May 21 '16 at 1:09
  • 1
    \$\begingroup\$ That is wrong behavior. If you have it connected correctly, it will be OFF by default. \$\endgroup\$ – Daniel May 21 '16 at 1:12

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.