0
\$\begingroup\$

I am trying to control 5V LED using ESP32's 3.3V GPIO. I researched voltage shifting using NMOS but could not get it to correctly output 5V when simulated in Tinkercad.

enter image description here

Is it possible to accomplish this without a 5V supply? What am I doing wrong here?

Edit: LED I got is https://www.amazon.com/dp/B01LXZSV2N/ref=sspa_dk_detail_2?psc=1&pd_rd_i=B01LXZSV2N&pd_rd_w=hAXXr&content-id=amzn1.sym.89ee1d2e-380f-4a05-89e5-d22eb0a17762&pf_rd_p=89ee1d2e-380f-4a05-89e5-d22eb0a17762&pf_rd_r=JY1V7JDVYCG4V8GWN336&pd_rd_wg=qfdlZ&pd_rd_r=9d901bb4-46a0-46fe-b2f1-9c4b264b07c5&s=toys-and-games&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExOTdHQThMNTZFOVJFJmVuY3J5cHRlZElkPUEwMzc0MzM1M1ZLTTJJM1FSS1REWCZlbmNyeXB0ZWRBZElkPUEwMDYxNzIxMjNYT1NKSkdaRjBMNCZ3aWRnZXROYW1lPXNwX2RldGFpbF90aGVtYXRpYyZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=

\$\endgroup\$
5
  • \$\begingroup\$ Does your ESP32 board have a 5V power output pin available to power your level shifter? If not, you'll need to generate 5 V somehow. \$\endgroup\$
    – nanofarad
    Commented Apr 25, 2023 at 20:06
  • \$\begingroup\$ @nanofarad No it does not. It only has 3.3V and VBAT, which I believe is also 3.3v. What's the usual way to generate 5V in such system? \$\endgroup\$
    – Megool
    Commented Apr 25, 2023 at 20:19
  • 1
    \$\begingroup\$ Is it really a 5V LED? Nearly all LEDs will work from 1.6V to 3.3V, depending on their color and chemistry. You have not specified your LED, which is definitely something you should have included. \$\endgroup\$ Commented Apr 25, 2023 at 20:46
  • \$\begingroup\$ @EdinFifić I edited my post with the LED I got \$\endgroup\$
    – Megool
    Commented Apr 25, 2023 at 21:00
  • 1
    \$\begingroup\$ Not enough detail, but they seem to be standard LEDs with a resistor. They should work at 3.3V but with significantly less brightness. You could probably open them and replace the resistors with lower resistances. \$\endgroup\$ Commented Apr 25, 2023 at 21:22

1 Answer 1

2
\$\begingroup\$

If you truly require 5v and only have a 3.3v supply, then you should generate a 5v supply using a boost converter.

However, many LEDs (even those whose datasheets specify 5v) can safely operate with a 3.3v supply. Perhaps your LED will work at 3.3v with no changes to the circuit.

You may need to reduce the resistor value to increase the LED brightness after reducing the supply voltage.

\$\endgroup\$
6
  • \$\begingroup\$ Rather than a boost converter, a small charge pump, e.g this, a MAX682, or similar might be easier to integrate for a small, light load depending on power/space/cost requirements. \$\endgroup\$
    – nanofarad
    Commented Apr 25, 2023 at 20:22
  • 1
    \$\begingroup\$ Great suggestion! I was lumping charge pumps and voltage multipliers in the same category as boost converters in my head, but they're indeed different things and charge pumps are probably more suitable to this kind of project. \$\endgroup\$ Commented Apr 25, 2023 at 20:27
  • \$\begingroup\$ The resistor is probably built into the button, so it can't be changed. It will probably still work, but won't be as bright. Maybe not bright enough. \$\endgroup\$ Commented Apr 25, 2023 at 22:42
  • \$\begingroup\$ reportedly The red led is actually two leds wired serially with 200ohm resistor while blue led wires two blue leds in parallel with same 200ohm resistror - red will probably not not work well from 3.3V green and yellow are probably same as red \$\endgroup\$ Commented Apr 26, 2023 at 1:53
  • 1
    \$\begingroup\$ @Megool Not off the top of my head, but plenty of boost ICs have adjustments of various types. You might need to shop around the wide variety that's out there. \$\endgroup\$
    – nanofarad
    Commented Apr 26, 2023 at 2:44

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.