Components Required:
- Raspberry Pi 3 B+
- SD Card
- Micro USB Cable with Adapter
- Monitor with HDMI cable
- Mouse and Keyboard
- Raspberry Pi Camera
Step 1: Connect Camera to Raspberry PI
![](http://cdn.shopify.com/s/files/1/0014/4313/5560/files/image2_large.jpg?v=1561104114)
Remove the protective covering from camera lens. Insert the cable in the camera port (the contact side should face HDMI interface)
![](http://cdn.shopify.com/s/files/1/0014/4313/5560/files/image10_large.jpg?v=1561104213)
Step 2: Enable Camera Interface and reboot
1. Open terminal and type the command raspi-config
2. Select Interfacing options
3. Select Camera
4. Select Finish and it will ask to reboot now. Select yes.
![](http://cdn.shopify.com/s/files/1/0014/4313/5560/files/image5_large.png?v=1561104131)
Step 3: Capture an image
Once the camera is enabled, we are ready to capture an image.
To capture a still image open terminal and type the command
raspistill –t 2000 -o image.jpg
![](http://cdn.shopify.com/s/files/1/0014/4313/5560/files/image3_4ea663f8-e11a-4f0f-b256-a4e97206cd1d_large.png?v=1561104119)
Here “raspistill” is a command that captures an image, the parameter “-o” specifies the filename of image.
Step 4: Record a video
To record a video open terminal and type the command
raspivid -o video.h264 -t 10000
Here raspivid is a command that records a video, the parameter “-o” specifies the filename of video and the parameter “-t” specifies the duration of video (in milliseconds).
For example, this command will record a 10 second video and save it as video.h264.
Author: Nakul Garg