1
\$\begingroup\$

I am struggling to set up the wiring for controlling a LED Strip using MOSFETs.

I have seen a lot of different tutorials. According to this tutorial for example, source and gate are connected with a 10 kΩ resistor, which was working only partially for me. It seemed to create an inversed logic with a simple LED (+ resistor to diminish the 12 V current). When I then used the LED-strip (without resistor) it turned on and off but wasn't bright enough.

This one didn't use any resistors. I even tried reproducing it with an additional 10 kΩ resistor from gate to ground.

schematic

simulate this circuit – Schematic created using CircuitLab

Provided the ESP32 GPIO is turned on, everything seems right. The problem is that turning off the GPIO, or even unplugging it, doesn't change anything; the red LED stays turned on.

\$\endgroup\$
5
  • \$\begingroup\$ Please edit your question with a schematic. It's difficult to see how everything is connected from a photo. \$\endgroup\$
    – Null
    Commented Feb 18, 2022 at 20:18
  • \$\begingroup\$ Get rid of the LEDs and measure the voltage at the MCU output pin. Does your code actually make the voltage go up to 3V/5V when it is supposed to? And does it go to 0V when it is supposed to? You must toggle it slow or keep it static since the voltmeter won't pick up fast transitions. LED would always stay on if you got the MOSFET source and drain pins backwards. \$\endgroup\$
    – DKNguyen
    Commented Feb 18, 2022 at 20:22
  • \$\begingroup\$ SE:EE has an integrated schematics designer. Press 'Edit', place your cursor within your post and hit CTRL+M. \$\endgroup\$
    – Velvet
    Commented Feb 18, 2022 at 20:22
  • 2
    \$\begingroup\$ Did you accidentally flip the legs of the MOSFET? \$\endgroup\$
    – winny
    Commented Feb 18, 2022 at 21:01
  • \$\begingroup\$ That MOSFET need 10V gate voltage to get minimum resistance. Use logic level transistor. \$\endgroup\$
    – user263983
    Commented Feb 19, 2022 at 0:22

1 Answer 1

1
\$\begingroup\$

You are correct the logic will be reversed. That is simple to correct in software. I see some potential problems. You do not have enough voltage to drive that obsolete MOSFET fully on. You need to control the MOSFET when you are in reset mode and do not have control of the GPIO. To solve this problem place a resistor from the GPIO pin to ground, 10K would work. This can be a bit tricky as some of the GPIO pins need to be floating so you need to check the data sheet for the part you are using. You will need to either add a driver to use the existing MOSFET or pick one that will be on at less than 3V worse case. I generally define On and Off as High and Low but that depends on what I am driving. For inverted define on as low and off as high. You can use whatever you like.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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