Removing IR Filter From ESP32-Cam, Part III

Okay, so it’s been a while but I finally got a chance to tinker with the ESP32-Cam in the dark again. 🙂

I’m using the same kind of IR illuminator that I used last time. You can get them all over the place. These little guys:

IR Illuminator for Raspberry Pi Camera
Image taken from

I went back over what I’d done last time and looked at my notes that I’d made after. The last time, I thought I’d play it safe and use a constant-current source to power the LED. I’ve had good results in the past using an LM317 to do this quickly and cheaply, so that’s the way I went, limiting the current to 125mA.

Turns out, though, that I was underpowering the illuminator because not only is it capable of more than 125mA, it was only getting around 2.4V because I was powering the LM317 off a 5V supply instead of the 12V I should’ve used.

This time around, I changed how I powered it. After a bit of poking around, it seems the illuminator runs on a 3.3V supply. I wanted to run it off a 5V USB pack because it’s so convenient, so I cheated and just put two 1N4001 diodes in series between +5V and the illuminator to get down to around 3.3V:

Two diodes in series on a breadboard

I also ended up adding a 1uF tantalum capacitor between the GND and +5V pins of the USB connector to cut down on some of the noise.

There is a tiny potentiometer on the module that supposedly controls at which point the module will turn on the LED, but it seems that it controls the current through the LED and has very little (if anything) to do with the amount of light on the photoresistor. Turning it all the way in one direction (clockwise, I think) gives a current of about 65mA through the LED, while all the way the other direction gives a current of around 420mA.

Unless you attach a heat sink, DO NOT RUN THESE IR ILLUMINATORS AT FULL POWER. It didn’t take too long before I could smell that all too familiar burning electronics smell, and the module itself failed shortly after.

I took another one, covered the photoresistor, and dialed it in to about 300mA. In this case, with unrestricted natural convection, it was able to run for over five hours before I turned it off. It was hot to the touch, but not unbearably so. Yours will probably be different, so keep an eye on it!

Here’s what happened with the current as the time went on:

Current reading through USB port
Current reading through USB port
Current reading through USB port
Current reading through USB port

So in the first 20 minutes or so the current climbed from 295mA to 325mA and then stayed there for the nest four hours and 50 minutes. For the entire time, the voltage across the module was 3.2V:

Voltage across IR illuminator

So, 325mA at 3.2V works out to 1.04W. That’s a lot better than the 0.3W from the previous setup. The advertising for these modules claims 3W, but I think it’s assuming you’re using both at the same time (they all come in 2-packs) and are running them with the pot dialed to full power.

Yes, there are problems with how I did this. Using two diodes isn’t a great way to “set” the voltage. Those USB meters are notorious for being inaccurate, too. So again, if you decide to try this, keep an eye on your stuff!

So the big question then, is: does running the LED at 3.5x the power make much of a difference? I think it does. Here’s a look from the dining room table with the LED covered up…

Living room, no illumination

… and uncovered:

Living room with IR illumination

Note that surface C is about six feet from the camera. A is ten feet, and B is about 22 feet. This is noticeably better than the last set of tests – the pictures I took inside the hallway with the closed doors last time confined the IR and kept it bouncing around. In this picture, the room is wide open and the pattern on the wall over 20 feet away is still easy to make out.

Here we are back in the hallway like last time. Here it is without IR:

Dark hallway, no IR

… and with IR:

Dark hallway with IR illumination

For reference, here’s what the camera saw when I did this test back in May:


The picture from today with the illuminator running 3.2V@300mA is noticeably brighter and less grainy. This is a good thing!

And I braved a near-solid wall of mosquitoes to try the ESP32-Cam again outside on the deck steps. Here’s a picture with no IR (it’s a little blurry because I was waving my arms trying to keep from being exsanguinated:

Yard at night, no IR

Unfortunately, the bird feeder has moved around the yard a few times since May, so I wasn’t able to use it to compare with last time. However…

Yard at night with IR on

… this time I can see THE FENCE. And the garden. And the solar panel in the garden. And the little weather station thing. Even the eavestrough on the neighbour’s house! Here’s what it looked like last time:


Quite the difference! I’m also only using one of the illuminators – they come in pairs. Twice the output won’t correspond to twice the brightness in the camera, but it will certainly lighten things up even more.

The ESP32-Cam with the IR filter removed and this particular illuminator do not put on a stellar performance, but I’m comfortable saying that they works well indoors, and they’re decent outside, too. Not good enough to, say, catch a license plate of a car driving by, but just fine within six to ten feet.

I still plan to put one of these outside, but getting a wifi signal out there is pretty tricky. I’ll either have to move the router or add something else to the network here. That might end up being a whole other project.

Thanks to everyone who commented and sent messages – I appreciate the feedback!

2 thoughts on “Removing IR Filter From ESP32-Cam, Part III”

  1. Thanks for the good photo examples with a removed IR filter on this ESP32 Cam. I am looking at building a fleet of cheap IR wifi cameras positioned at peek holes to detect intruders face from about 1-2 meters at night and send ideally telegram messages at detections.
    Planning to run the whole thing on 3.7V Lion Battery boosted to 5V or so.
    Depending on the combined current ~400mA for the IR light and approx 200-400mA for the ESP32-CAM. Triggered at a close range motion and run for about 20 minutes, it may be a good option with a regular couple monthly recharging of the battery. Does that sound right compare to your measurements?

    Can I ask also what wifi range you get with ESP32 without antenna expansion? Multiple places reports around 5 meters.

    1. Hello Gunay!

      That sounds like an interesting project – depending on the capacity of the battery you’re using, you should be able to get a decent amount of runtime out of it. Are you using an 18650? Don’t forget the conversion losses you’ll see from the boost/buck converter to get 5V.

      One of the things I did to try to lower power consumption a bit was remove the camera flash LED. I’m not sure how much of a difference it makes but if you’re going to flood the area with IR then you certainly don’t need it (and then it won’t shine at night and give away its location). Some of the boost/buck converters that are designed for use with Li-ion batteries have circuitry built in that will prevent the battery from being run flat – if the one you plan to use doesn’t, you’ll probably want to add it.

      The PCB antennas on these boards aren’t half bad. I generally have no trouble getting around 7 meters indoors (wood frame house), but a lot of it has to do with the orientation of the antenna and how much radio noise there is – don’t even bother if you’re looking to set this up by a microwave oven that sees a lot of use. 🙂

      One last thing – be careful with your IR sources. It is easy to damage someone’s eyes with IR (even non-laser sources) at those distances, particularly at night. Check the datasheets and look into literature about eye-safe limits for IR illumination.

      Good luck with your project!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.