Is there a way to use an ESP pin to power an IR LED?

I have this setup, using the ESP32-cam.
The IR LED has its own build-in luminance sensor, switching the LED on when dark. Even so, I don’t want the IR LED to be on all night, only eg. when motion is detected. Is there a way I can use some of the ESP pins to achieve this, without using an external relay?

I was hoping the PIR would provide enough voltage at its HIGH state, but it failed trigging when connecting the LED to the signal pin on the PIR.

checkout Rui’s tutorials on esp:

I am not talking about the built-in LED on the ESP, but external IR LED as in the drawing above.
He does not power an IR LED the way I am looking for.
My question is more like can I power the LED from an ESP pin?

Hi,
have You found out answer for your question. I’m struggeling with exactly the same topic.
Best.

An ESP32 can tolerate an absolute maximum of 40mA of current drawn from a GPIO pin (and depending on the pin used, the limit could be as low as 20mA), and the voltage is 3.3V. My guess is that both voltage and maximum current are too low for an IR LED (at least for one that is meant to illuminate more than a really small room :smiley: )

1 Like

I ended up like this. And truly this LED is not as bright as I would want to. looking for en external IR LED in the future. The built-in ir-led I use can use 3-5 V.

I also build in a PIR sensor in the same box.
on top of the IR light (brass surface) I put a 3 mm thick aluminium piece as heatsink to cool doen the IR led.

1 Like

How did you deal with the heat of the IR Module?

Are you using it with 5v or 3,3v?