Skip to main content
2 of 4
added 99 characters in body
Andy aka
  • 472.9k
  • 29
  • 383
  • 839

while GPIO is 3.3V, I want to drive the LED using 5V source

and

but this FET-based circuit is inverting.

No it isn't, not when driving an LED attached to the drain circuit. You want current through the LED when the GPIO pin is high so, functionally, that's non-inverting.

If source connects to ground and gate is driven by the MCU pin then current flows through the drain-connected-LED when the MCU output pin is high (and activating the MOSFET): -

enter image description here

Image (modified) from here

Andy aka
  • 472.9k
  • 29
  • 383
  • 839