Raspberry Pi likes its Camera

Index To the Series
1. Raspberery Pi likes Open Source
2. Cross-Compiling for Raspberry Pi
3. Cross-Compiling ITK for Raspberry Pi
4. Raspberry Pi likes VTK
5. Raspberry Pi likes Node.js


Following on our series exploring the use of the Raspberry Pi,
Here we describe how to use Pi Camera.


First: The Hardware

We start with our trusty Raspberry Pi board (this is a Model B):


Then unbox the Raspberry Pi camera, freshly arrived from AdaFruit.


The connector of the Camera must be inserted in the socket that is just beneath the Ethernet port,
as pointed by this helpful pencil


We open the socket by pulling the black cover towards the Ethernet port:


and insert into it the connector of the camera, placing the lead side away from the Ethernet port


Then close the connector by pushing the black cover away from the Ethernet port:


Now, we look back at the camera module itself. It comes with a protective plastic cover:


That we carefully remove, using its open end:



This is how the set up looks from the side


and here is a mystical moment when the Raspberry Pi board becomes self-aware by looking at itself:


This completes the Hardware part of the installation.



 Second: The Software Configuration

Now it is time to deal with the software configuration and usage.

We log in the Raspberry Pi, and update the packages with

   sudo apt-get update

   sudo apt-get upgrade

Once the update / upgrade process finishes, we run the application that reconfigures the board:

   sudo raspi-config

This open the global configuration menu, where we can move the cursor to the “Enable Camera” option:

and select to enable the camera for real:

After pressing ENTER, we are sent back to the top configuration menu, and using the TAB key we can select to Finish the configuration changes:

At that point we are asked whether we want to reboot the board, and we opt for Yes:

The menu terminates and we see the typical shutdown warning message:


Third: The Testing

Once the board has rebooted, we log in again, and we can test the capture of images with the command:

     raspistill  -o   image01.jpg

That results in images like the following


Note that the camera has a fixed lens, and its focus starts at about 60cm away from the camera.

Lens modifications would be needed for taking macro images.

We know for example that this can be fixed with a piece of plastic and a drop of water.

A close up to the water drop:

and with it take macro pictures like the following:




This can be easily converted into a remote snapshot server, following the instructions in this

Raspberry Web Server Python Tutorial.

whose source code is in this Git hub repository




Going Beyond

The source code of the Raspberry Pi camera applications can be found at


and it is configured with CMake.


4 Responses to Raspberry Pi likes its Camera

  1. Pingback: Courses Thibault

  2. Pingback: Luis Ibanez

  3. Pingback: Courses Thibault

  4. Pingback: Courses Thibault

Questions or comments are always welcome!