How to make a Raspberry pi Action camera ?

Vineet Kumar Gupta
4 min readDec 1, 2020

--

Raspberry pi is one the cheapest single board computer available but what can you make a action camera out of it , lets see

This Tutorial is based on this Github Repository

Step 1 : Collect all the items required

  1. Raspberry Pi any model should work but make sure wifi is present (This was tested on zero w)
  2. Pi camera any version should work currently only the official pi camera modules are supported but soon support for web cam would be added (Tested with v1.3)
  3. Power Bank or any 5v Power supply
Pi Camera

Step 2: Login into device using ssh or if having gui open terminal

Default username is ‘pi’ and password is ‘raspberry’

Step 3: Clone the RPcam repository to pi using git clone

git clone https://github.com/vineetkrgupta/RPcam

Step 3: Move to the newly created directory as RBcam and install all the requirements for the program using pip

pip3 install -r requirements.txt 

After the installation is complete the recorded video would be saved in the /static/Videos folder and /static/Photos folder

Step 4 : Make script persistent

In order to make script persistent and run it everytime when the device is powered on we will use crontab ,to do that first we have to make an entry we can do that by the following command

sudo crontab -e

After that a confirmation popup might appear type Y to accept and then use arrow keys to move down the file opened and make the following entry in the last of the document

@reboot python3 /home/pi/RPcam/main.py

Final Step

After doing this , we have to restart our device , as usual our device will connect to the network and now we just can use it using any web browser by the following commands but before that we need to find the ip of the raspberry pi . which can be found using looking into the network .

<raspberry pi ip >:5000

Now in order to click picture use

<raspberry pi ip >:5000/TakePicture

In order to view the last Picture or video taken just use

<raspberry pi ip >:5000/last

Similarly various functions can be called such as

  1. /check (to check the storage left)
  2. /TakePicNight ( to take picture in night mode take about 1 min for a photo to capture)
  3. /StartRecord (start recording video)
  4. /StopRecord (stop recording video)
  5. /shutdown ( Shutdown the device )
  6. /last ( see the last media captured )

IMPORTANT INFORMATION

Inorder to make everything very easy and use it on go club eveything into a small package and an addition PIR sensor might be used to detect motion and capture images

Project with PIR

Now by connecting raspberry pi to phone hotspot we can control the raspberry pi camera on the game

To avoid typing the whole url everytime in browser in order to capture photo or video we can use an app such as

https://play.google.com/store/apps/details?id=ch.rmy.android.http_shortcuts&hl=en_IN&gl=US

And then create shortcuts such as these

To Import these setting go to settings and select import and then import from url and use the following url

https://raw.githubusercontent.com/vineetkrgupta/RPcam/main/functions.json

After that manually change the ip of Every shortcut to the ip of your raspberry pi

And finally you can use your new raspberry pi Action camera

Happy experimenting :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Vineet Kumar Gupta
Vineet Kumar Gupta

Written by Vineet Kumar Gupta

Interested in Data Science, IOT & most probably anything related to computer science and engineering. https://www.linkedin.com/in/vineet-kumar-gupta/

No responses yet

Write a response