2
\$\begingroup\$

I built the following circuit. +3.3V GPIOs and +5V driven by an RPi Zero. Common-anode RGB LED wired to three IRLB3034 MOSFETs. These have Vgs(th)-min/max of 1V/2.5V.

The GPIOs are supposed to switch the MOSFETs to drive the LEDs on the 5V rail. Each LED is supposed to pull about 700 mA.

Symptoms

  1. The red LED works perfectly.
  2. The green LED was turning on as soon as the RPi was connected to power. I could stop this by shorting the gate to ground, but it would slowly build up again. Once the GPIO pin was explicitly set to 0 it would also stop. I "solved" this with a 100 Ω resistor from its gate to ground. Not really sure why this works.
  3. The blue LED doesn't fully turn on. If I apply 5V to the gate it does, but 3.3V just doesn't cut it (maybe 10% brightness).

Possibilities

  1. I've misunderstood something about the MOSFETs?
  2. The blue MOSFET is broken?
  3. Poor construction. I made this using an AdaFruit protoboard, big wires for the high-current and lots of solder. Have checked again and again for shorts.
  4. Something else??

Updates

  1. The 100 Ω resistor I added only for the green LED, and have now added to the diagram.
  2. This is the LED: link and datasheet
  3. The LED voltages are R: 2.5V, G: 3.6V, B: 3.6V.

circuit-diagram

\$\endgroup\$
23
  • 1
    \$\begingroup\$ "I solved this with a 100 Ω resistor from its gate to ground." Your schematic shows 10k to ground. (This is much more sensible than 100 ohm.) \$\endgroup\$ – Transistor Feb 14 at 9:48
  • 1
    \$\begingroup\$ (1) Can we have a web link to your 700mA RGB LED? (2) If for Blue LED, Vgs = 5V works, but Vgs = 3V3 does not work, so it is likely the MOSFET does not fully turn on at Vgs = 3V3. (3) You remind me that once I bought two batches of IRL540N, one batch regular price, the other half of regular price. I later found that all the the regular ones work OK for Vgs = 3V3, but not all the cheapies. \$\endgroup\$ – tlfong01 Feb 14 at 10:06
  • 6
    \$\begingroup\$ Vgs threshold is not the right specification to use. In the data sheet there will be Rds(on) values for various values of Vgs. That is the key specification. \$\endgroup\$ – Peter Smith Feb 14 at 12:26
  • 3
    \$\begingroup\$ OK, but now you've a 100:100 potential divider so you can only get half your GPIO output voltage on the FET so you're making it difficult to turn it on. The 10k should be more than adequate. \$\endgroup\$ – Transistor Feb 14 at 12:30
  • 2
    \$\begingroup\$ Datasheet : " Very Low RDS(ON) at 4.5V " translation : 3.3V won't cut it, at least, not reliably. \$\endgroup\$ – user_1818839 Feb 14 at 13:03
2
\$\begingroup\$

The voltage drop across the resistors in series to the green and blue LED might be part of the problem.

If each LED really needs 700 mA, the voltage drop across the resistor for the blue LED would be 1.4V. This would leave 3.6V for the blue LED forward voltage and the Vds of the MOSFET. This might just be enough but I wouldn't bet on it.

For green, the voltage drop across the resistor would be about 2.5V, leaving only 2.5V for the LED and MOSFET's Vds. This probably isn't enough.

And as @Transitor recommended, I also wouldn't use the 100 Ohm from Gate green to GND. Besides the potential divider this will draw quite a lot of current from your GPIO. You should alos check if your 5V supply can source the 2.1A for all three LEDs.

Some ideas to solve the LED issue:

  • Make resistor green and blue smaller. Probably the easiest solution but with ill defined LED currents.
  • Use a BJT with a resistor in the emitter as a constant current source providing 700mA. This however might need more than a 5V supply.
\$\endgroup\$
9
  • \$\begingroup\$ I accidentally swapped the resistance values in the diagram, please see corrected now. They are calculate so that the resistor and LED together consume the full 5V at ~700mA. Is that wrong? Do I need additional voltage for the MOSFET Vds? But if that's the case why does blue struggle when red and green don't? And why does blue suddenly work when I apply 5V to gate. (Note that green and blue LEDs have the same forward voltage.) \$\endgroup\$ – carderne Feb 14 at 16:31
  • \$\begingroup\$ I just took a look at your MOFSETs data sheet, the Vds is probalby negligible small. Regarding your updated schematic, I see 3.6Ohm for blue and green, is that correct? Anyway.. considering the forward voltage you posted and neglecting the Vds of the MOSFET, the voltage drop across the green and blue resistors is 1.4V, meaning about 400mA for the LEDs (if 3.6Ohm is correct). Looking at the LEDs datasheet this probably is enough to turn them on. Why blue works with 5V at the gate is weird. I don't think it's the transistors Rdson. Maybe something wrong wired in the blue part? \$\endgroup\$ – ringk89 Feb 14 at 16:49
  • 2
    \$\begingroup\$ See if you can find a complete data sheet, your link does not show forward voltage. At 700mA I would expect the forward voltage of the LED to be much more. Many times they are constructed with die in series. Your circuit diagram looks good especially the gate resistors. However I would suggest changing the 5V to maybe 12v and recalculating your cathode resistors. Start with a 1K and measure the voltage drop across the LED, this will be approximately the forward voltage. Measure drain to source on the MOSFET they should be less then 0.03 volts. Main thing have fun! \$\endgroup\$ – Gil Feb 14 at 19:04
  • 1
    \$\begingroup\$ Hi @Gil, I just added the complete datasheet. And learned something new! (Or something I long ago forgot.) You're right, the datasheet shows that above ~500ma, the forward V is around 3.3V (instead of 2.5V) for red, and 4.3V (instead of 3.6V) for green/blue. So I should definitely recalculate my resistors to get the brightness I'm looking for. But this still doesn't explain why blue isn't turning on! (Just testing with 1 Ω and marginally brighter but no big difference.) \$\endgroup\$ – carderne Feb 14 at 21:51
  • 1
    \$\begingroup\$ I believe you do not have enough voltage on the blue LED. When it is turned on,(not necessarily lit) measure the voltage on both leads of the LED, it is below the VF rating. Check the voltage of the MOSFET relative to ground, it should be less than 0.02 volts, if not you are not properly driving it or it is not in the circuit correctly. I am sorry to say but I believe you need a boost converter if 5V is all that is available because of the blue led. Try swapping leds and see if it is consistently the blue led. In each case measure the voltage across the LED and note of it. are any backwards? \$\endgroup\$ – Gil Feb 16 at 1:50

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.