Electrical – Switch 12V and 24V low current load (LED button) with 3.3V and 5.0V arduino

arduinoledmosfetpowerswitches

I am trying to control a 12V and 24V LED inside a push button like the one below.

I have tried with transistors and today with mosfets.

Problem: I cant make the LED fully turn OFF and ON as it would when applying directly the 12V or 24V power source to the LED directly.

(I have two versions of the pushbutton LED, 12V and 24V and I would like to learn how to design the different circuit for each to control them)

I have measured the LED consumption when feeding:

  • 12V directly and the current is 3mA
  • 18v its 5mA

I have tried the following n channel mosfets:

  • IRLML2502 smd
  • 13NM60N

These are the buttons:
enter image description here

I have tried this link schematic and various others, but the LED always stays dimmed on and will not make much diference on the gate voltage change.
I have also tried this schematic without the 27ohm resistor
I have also tried it without resistors
I have also tried it with only a pulldown 10k resistor

Driving LED strip from microcontroller

enter image description here

My only though is that the LED is not a plain LED as I can drive it with a 12V without additional resistor. I measured the resistance of the LED terminals and its Mohms, so I guess no current flows when joining LED + mosfet. Anyway, there must be a way of doing this right.

Additionally, I would like to control it via a 3.3V or 5.0V arduino output. All tests so far have been done with 5V

Best Answer

Based on your schematic which should work wonderfully , there can 4 issues.

  1. The mosfets aren't suited to logic level control.

  2. You didn't wire it as shown.

  3. The mosfet are damaged.

  4. Your code is wrong.

If you wire the led and mosfet to power and tie the gate to ground, does it turn off? If you tie it to 3.3V via a 1k resistor does it turn fully on? What is the resistance of drain to source when gate is at 3.3V?

You can avoid mosfet issues, replace it with a standard small signal npn transistor, like a 2n3904. 1k base resistor is enough art your load current.