Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. Pi Camera Modules with Switchable IR-cut Filter

Pi Camera Modules with Switchable IR-cut Filter

Infrared cut-off filter for cameras

Cameras typically capture pictures for humans to see, and the images taken should look natural and appealing to human eyes.

However, most camera imagers can see the infrared, while we can’t. To help the imager better see what we see, we need to cut the infrared off.

This is when an IR cut-off filter is used. By employing an IR cut-off filter above the image sensor, the camera will only capture visible light.

Switchable IR-cut filter: Regular and NoIR cameras combined

Official Pi camera modules are offered in two kinds: regular camera module and NoIR camera module.

The NoIR camera module is an infrared camera module that gives you everything the regular camera module offers, with the only difference being the infrared cut-off filter.

It does not employ an infrared filter, so it can be used with infrared lighting. However, its pictures taken in the daylight will not look natural to our human eyes, usually more reddish.

This is why the switchable IR-cut filter becomes meaningful. It offers you an on-demand control of the IR sensitivity by mechanically switching the IR filter in and out, so it’s like regular and NoIR cameras combined.

Automatic IR-Cut filter control

The majority of switchable IR-cut filters are deployed for surveillance use, which requires the camera to maintain color accuracy throughout the daytime and night vision at night.

We don’t have to tell whether it’s already nighttime, because a light-sensitive trigger would do the work. A photoresistor is such a trigger, and it can determine whether the lighting condition is poor, so the IR illumination should be turned on and the IR filter switched off.

Arducam day-night vision cameras use photoresistors to automate the IR switching. This is the default option and no extra settings are required.

Manual IR-Cut filter control workaround

Although automatic IR-cut filter control can satisfy most users, some may still want a more proactive method to control it manually. Some workarounds are needed for this.

Working like a normal camera: Keep the IR filter always on

The black and red wires will lead you to a connector of the IR cut-off filter to the camera board. Unplugging the connector will disable the IR filter switch and make it a normal camera.

Working like a NoIR camera: Keep the IR filter always off

Photoresistors rely on lighting conditions to work. If you cover the photoresistor with a non-translucent material, it will produce the same result as a NoIR camera.

Manually control the IR-filter with scripts

For the Raspberry Pi 4

Originally, the camera LED pin was used to control the IR cut filter. However, the Pi 4 has had the camera LED GPIO line removed as it is not used on the V2.1 camera module. So the steps on Pi 4 would be different from the previous models.

1. Remove the photoresistor.

If you want the photoresistor to quit controlling and your scripts to take over, remove the photoresistor first.

2. Connect the Camera IR and GND pins to the RPI GPIO

Do it as shown in the image below. You may need some soldering and jumper wires.

Connect the camera IR and GND pins to RPI GPIO

3. Download the code

git clone

4. Update the wiringPi library

cd /tmp
sudo dpkg -i wiringpi-latest.deb

5. Control the IR-cut filter with commands

Enter the folder:

cd RPI_Motorized_IRCut_Control

Switch the IR-cut filter on:

python on

Switch off the IR-cut filter:

python off

For the Raspberry Pi 3B+ and previous models

For these models, we use the camera LED pin to control the IR cut filter.

1. Remove the photoresistor and weld a 470 ohm resistor

Do it as shown in the images below. Click on the image to enlarge.

2. Download the code

git clone

3. Compile source code

Enter the folder:

cd RPI_Motorized_IRCut_Control/camIrCutControl/

Compile source code:


4. Control the IR-cut filter with commands

Switch the IR-cut filter on:

./irCut 1

Switch off the IR-cut filter:

./irCut 0

Was this article helpful to you? Yes 1 No 1