Index>Robot Kit>DarkPaw Spider Robot Kit for RPi>Lesson 8 How to Take a Photo with Raspberry Pi

Lesson 8 How to Take a Photo with Raspberry Pi

3818

Lesson 8 How to Take a Photo with Raspberry Pi

 

In this tutorial we will learn the photography function of the Raspberry Pi.

For more details, refer to the Raspberry Pi official website:

https://www.raspberrypi.org/documentation/usage/camera/README.md

8.1 Components & Parts

 

Components

Quantity

Picture

Raspberry Pi

1

wps13.png 

Robot HAT

1

wps14.jpg 

Camera Module

1

wps15.jpg 

Camera Flex Cable

1

wps16.jpg 

 

8.2 Introducing the Camera Module

 

The Raspberry Pi camera module is capable of taking full HD 1080p photos and videos and can be controlled programmatically.

8.3 Schematic Diagram

 

The flex cable inserts into the connector situated between the Ethernet and HDMI ports, with the silver connectors facing the HDMI port. The flex cable connector should be opened by pulling the tabs on the top of the connector upwards then towards the Ethernet port. The flex cable should be inserted firmly into the connector, with care taken not to bend the flex at too acute an angle. The top part of the connector should then be pushed towards the HDMI connector and down, while the flex cable is held in place. (Pay attention that the metal of the connector should be in contact with that of the cable)

wps17.jpg 

Install the Robot HAT. Insert the cable through the hole of the Robot HAT.

wps18.jpg 

Connect the flex cable and camera module (metals of both should be in contact with each other).

wps19.jpg 

 

8.4 Programming the Raspberry Pi to Take Photos

Run the code

1. Log into the Raspberry Pi remotely.

wps20.jpg 

2. View the files of the current directory:

ls

wps21.jpg 

4. Type in commands, press Enter to run the program:

raspistill -t 1000 -o image.jpg

wps22.jpg 

5. 1s after the successful run, the camera will take a photo image.jpg.

1000: delay time of photo shooting

image.jpg: name of the photo

6. Type in "ls" to view the file.

ls

wps23.jpg 

 

8.5 Q&A

 

Error occurs when the command "raspistill -t 1000 -o image.jpg" is typed in the command line.

wps24.jpg 

Check whether the camera connector of the Raspberry Pi, flex cable, and camera module are well connected.

Metals of the flex cable and camera module should be in contact with each other

Metals of the camera module's flex cable and camera connector of the Raspberry Pi should be in contact with each other

Check whether the flex cable and camera are good or damaged.