Introduction

Raspberry Pi Camera Module

The Raspberry Pi camera board contains a 5 MPixel sensor, and connects via a ribbon cable to the CSI connector on the Raspberry Pi. A User's Guide describes setup and use. The video and still image quality is better than a USB webcam of similar price.

The camera was released for sale on the 14th of May 2013 and the initial production of 10k camera boards[1] sold out after several days. By mid-July 2013 stock was available again.

Because the focal length of the lens is roughly the same as the width of the sensor, it is easy to remember the field of view: at x meters away, you can see about x meters horizontally, assuming 4x3 stills mode. Horizontal field of view in 1080p video mode is 75% of that (75% H x 55% V sensor crop for 1:1 pixels at 1920x1080).

RAW images

The raspistill --raw option will append RAW data to the JPEG. The RAW data contains the image direct from the sensor, before debayer and color processing. A simple tool called raspi_dng[3] is being developed[4] to convert the JPEG+RAW file into a standard Adobe DNG file.

Configuration

The cameras red LED lights up when recording video or taking a still picture, this can be turned off by adding the following line to config.txt (RPiconfig)

Troubleshooting

Camera not working at all

Make sure the flex cable is inserted the correct way on both ends, and each connector has the locking tab engaged. The RPi + camera draws about 260 mA more current when recording video, than without the camera. The Model B is about 550 mA by itself, so camera use pushes it over 800 mA. Some power supplies, cables, and polyfuses may not maintain 5V onboard at this current load well enough for reliable operation. You can check this with a voltmeter across TP1 and TP2.[6][7]

In some cases, the micro-connector from the camera module to the camera board PCB has been loose. This can be fixed by removing and re-seating the small (tiny!) yellow flex cable connector labelled "P5V04A SUNNY" on the camera board. It makes a click when it is fully seated.[8]

Colored Banding or Flickering on video

This can be caused by a poor power supply, or bad power cable. Several people have fixed this by replacing the power supply, or the microUSB power cable.[9][10]

It can also be caused by indoor fluorescent lighting. The camera defaults to video mode at 30 fps, which works well in the USA with 60 Hz power. If you are in Europe or elsewhere with 50 Hz power, this may give you flicker under fluorescent lighting.[11] Try using the option -fps 25 to change the frame rate to 25 frames per second.

The Foundation has noted that the camera only passed EMI emissions testing with ribbon cable lengths of 15cm, although longer cables may also work.[13] One user 'rew' reports a 4 m (13 foot) extension cable is working.[14][15]

Adjusting Lens Focus

The camera is fixed-focus (at infinity) as delivered. The thread-locking glue dots can be scraped off[16] allowing manual lens focus, as close as 6 cm, or complete removal of the lens[17] allowing other optical systems. The lens thread size may be M6 x 0.35[18].

Macro, Wide, Tele adaptor lenses

The near focus point of the camera is about 1 meter as delivered. Without modification to the camera itself, it is possible to put a simple external lens in front such as reading glasses, SLR diopter ("close-up filter") or loupe to enable closer focus. For best results, put the additional lens very close to the camera lens.

Macro, Wide-Angle, and Telephoto adapter lenses designed for the iPhone 4/4s and similar devices will also work on the R-Pi camera. Depending on your configuration, properly mounting the accessory lens in front of the camera module may require some ingenuity. Focus becomes critical with a telephoto adapter, so success there may also require the manual focus modification.

Replacing Stock Lens

Changing the lens is a more significant and risky modification than simply adding an accessory lens.
Richard Kinch has made an adaptor to mount M12 thread lenses on the R-Pi camera board, after unscrewing and removing the stock lens.[19][20] Martin Miller has posted a guide on raspberrytorte.com describing complete camera module disassembly and replacing lens holder with a stock M12 unit.[21] Various M12 x 0.5 (S-mount) lenses intended for board-level cameras are available at focal lengths from fisheye to long telephoto.[22][23][24]

Removing IR Filter

The IR filter is rigid and glued to the bottom inside of the black plastic lens housing, requiring complete disassembly to remove. Two early attempts by RPi forum users M33P[25] and scorp[26] were initially successful, but in both cases the camera died soon afterwards from blunt trauma to the fragile bond wires on the die.[27]

A RPi blog post (27 May 2013) has more description of this process with a video of the modification, and video from the resulting IR-enabled camera.[28]

Housings

To help building your own camera board case or enclosure, a hand-measured mechanical drawing[29] of the camera module is available, thanks to Gert van Loo. There is another drawing[30] from raspberrypi-spy.
There are some CAD files for housings and camera holders available on Thingiverse[31].