LED
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 consum
To disable the red LED you simply need to add the following line to your config.txt file :
disable_camera_led=1
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.
GPIO Control
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 the GPIO. On the Model B you can use GPIO5 and on the B+ you can use GPIO32. I tested this in Python and it works fine. Here is an example script that blinks the camera LED five times :
1 #!/usr/bin/env python
2 import time
3 import RPi.GPIO as GPIO
4
5 # Use GPIO numbering
6 GPIO.setmode(GPIO.BCM)
7
8 # Set GPIO for camera LED
9 # Use 5 for Model A/B and 32 for Model B+
10 CAMLED = 5
11
12 # Set GPIO to output
13 GPIO.setup(CAMLED, GPIO.OUT, initial=False)
14
15 # Five iterations with half a second
16 # between on and off
17 for i in range(5):
18 GPIO.output(CAMLED,True) # On
19 time.sleep(0.5)
20 GPIO.output(CAMLED,False) # Off
21 time.sleep(0.5)
Last updated