Materials:
Raspberry Pi with a Camera Module Port
Raspberry Pi Camera
Monitor
Ensure your Raspberry Pi is turned off.
Locate the Camera Module port
Gently pull up on the edges of the port’s plastic clip
Insert the Camera Module ribbon cable; make sure the connectors at the bottom of the ribbon cable are facing the contacts in the port.
Push the plastic clip back into place
Next,
Start up your Raspberry Pi.
Go to the main menu and open the Raspberry Pi Configuration tool.
Select the Interfaces tab and ensure that the camera is enabled:
Reboot your Rasperry Pi.
Now your Camera Module is connected and the software is enabled, try out the command line tools raspistill and raspivid.
Open a terminal window by clicking the black monitor icon in the taskbar:
Type in the following command to take a still picture and save it to the Desktop:
raspistill -o Desktop/image.jpg
Press Enter to run the command.
When the command runs, you can see the camera preview open for five seconds before a still picture is taken.
Look for the picture file icon on the Desktop, and double-click the file icon to open the picture.
By adding different options, you can set the size and look of the image the raspistill command takes.
For example, add -h and -w to change the height and width of the image:
raspistill -o Desktop/image-small.jpg -w 640 -h 480
Now record a video with the Camera Module by using the following raspivid command:
raspivid -o Desktop/video.h264
In order to play the video file, double-click the video.h264 file icon on the Desktop to open it in VLC Media Player.
To control the Pi Camera using Python code, please visit Raspberry Pi Projects for more.