The Pi camera module includes a red LED in one corner of the PCB. This lights up when the camera is active. It’s really useful in giving a visual indication that the camera is doing something and most of the time you will be glad it is there.
However there are a number of reasons you might wish it wasn’t.
In my testing here are some of the reasons it can get in the way :
- It can cause reflections on objects you are trying to photograph giving them a red glow.
- For nature photography it scares animals.
- For security applications it may draw unnecessary attention to the device.
- It consumes power.
To disable the red LED you simply need to add the following line to your config.txt file :
To edit the config.txt file you can use Nano :
sudo nano /boot/config.txt
Use the arrow keys to scroll to the end of the file and add “disable_camera_led=1″ to the last line. Press “CTRL-x” to quit. If prompted press “Y” followed by “Return” or “Enter”.
Reboot your Pi with “sudo reboot” and when you next use the camera the red LED will be disabled.
To enable the light again you can either use Nano to remove the line you added above or you can change it to “disable_camera_led=0″. Reboot the Pi and you will have your camera light back.
Thanks to a hint by @TeamRaspi on Twitter I checked the schematics of the Rev 2 Pi and discovered that once disabled using the process above you can control camera LED using GPIO5. I tested this in Python and it works fine. Here is an example script that blinks the camera LED five times :
#!/usr/bin/env python import time import RPi.GPIO as GPIO # Use GPIO numbering GPIO.setmode(GPIO.BCM) # Set GPIO for camera LED CAMLED = 5 # Set GPIO to output GPIO.setup(CAMLED, GPIO.OUT, initial=False) # Five iterations with half a second # between on and off for i in range(5): GPIO.output(CAMLED,True) # On time.sleep(0.5) GPIO.output(CAMLED,False) # Off time.sleep(0.5)
Here is a short clip showing the camera LED being turned on and off using Python :
UPDATE : Since the latest update to Raspbian the disable_camera_led feature appears to have stopped working. Hopefully it will be restored soon! The Python script still allows control of the LED.