Connecting a camera to the Pi

Testing the camera on the Raspberry Pi


Ok, so today I got my new nifty gadget.  A camera for the Pi!  So here’s the unboxing.

I got it in a neat paper bag like this one :


This is what it looks like.


I opened the casing and connected it. It’s fairly easy.  Just pull up the handles, put it in, and push the handles back down.


Now to configure this.  In order to do this, just log on to the pi and start raspi config :

sudo raspi-config

locate the Interfacing options

Schermafbeelding 2017-02-20 om 19.30.54.png

Locate the camera option

Schermafbeelding 2017-02-20 om 19.31.12.png

Enable it

Schermafbeelding 2017-02-20 om 19.31.22.png

and reboot.

Schermafbeelding 2017-02-20 om 19.31.39.png

After the reboot sequence has finished, it’s time to test this.  There are actually 2 command line tools you can use to capture a still image and a video image.  The first one is called raspistill.  It’s got tons of options really.  You should really take a look at them.  But the easiest way to do a test is using this command :

raspistill -o me.jpg

Where the -o parameter sets the output filename.

Schermafbeelding 2017-02-20 om 19.37.04.png

So here it is :

Schermafbeelding 2017-02-20 om 19.38.53.png

The second one is raspivid

Here’s the syntax :

raspivid -o test.h264 -t 3000

in this command the .h264 file is the output. the -t parameter sets the number of seconds to record. It’s expressed in milliseconds, so 3000 means 3 seconds.

Schermafbeelding 2017-02-20 om 19.43.19.png

Good luck testing this!