How to use Raspberry Pi Camera

Step by step how to use it

Do you have a Raspberry Pi but you don’t know what to use it for? Do not waste time, connect it to a camera and let the imagination fly.

I will explain it taking as an example a Raspberry Pi 3 and a PiCamera 2.0. But for all other cases it is the same or very similar.
I will explain how to use it with Python.

What I need?

You will need a Raspberry Pi 3 and a PiCamera 2.0.
Also, if you know Python it will be great for you later. In case you have no idea what I am talking about, do not worry, it will be easy!.


Picamera 2.0

Enable camera

1) Install Raspbian in the RPi3. In case you don’t know how to do that, you can visit my other post First steps with Raspberry Pi donde te explico paso a paso como comenzar.

2) Connet the PiCamera into the correct slot


Make sure that the Raspberry Pi is turn off!.


3) Turn on the RPi3. Now is time to enable the camera.

How can I do that? It’s very easy, you need to do:

  • Menu
  • Preferences
  • Raspberry Pi configuration


  • Interfaces
  • Make sure to enable the camera.


4) Reboot.

Use the camera

Programming with Python 3

Como instalamos Raspbian, aprovecharemos que ya tiene instalado Python

1) Menu
2) Programming
3) Python 3

enter image description here

  • New file
  • Save as (Don’t save it as
  • Enter the following code:

from picamera import PiCamera
from time import sleep
camera = PiCamera()

Save with Ctrl + S and run with F5. The camera preview should be shown for 10 seconds, and then close. Move the camera around to preview what the camera sees.

But before finishing this tutorial why not explain the most common function of a camera?


Amend your code to reduce the sleep and add a camera.capture() line.


It’s important to sleep for at least 2 seconds before capturing, to give the sensor time to set its light levels.

Run the code and you’ll see the camera preview open for 5 seconds before capturing a still picture.

You’ll see your photo in /home/pi/Desktop named image.png

Now you can start to play with your new camera!

Start thinking about innovative projects that involve the use of a camera and surprised your friends!

Leave a comment