PiJuice Point and Shoot Camera Project

The Point and Shoot Camera Kit uses a combination of the PiJuice HAT, Media Center HAT and Raspberry Pi camera board to create a touch screen standalone camera all housed in the PiJuice Maker Kit Case. This project is designed to highlight the features of the PiJuice HAT as well as the new Media Center HAT.

This Point and Shoot Camera project is based on the Adafruit “DIY WiFi Raspberry Pi Touchscreen Camera” by Phil Burgess with some additional changes, including a battery level indicator for the PiJuice so you will know when your battery gets low.

What you will need

You will need the following parts to build this project. Some parts are optional and only required for the initial setup procedure:

  • PiJuice Maker Kit
  • Raspberry Pi Computer
  • PiJuice HAT
  • Media Center HAT
  • Official Raspberry Pi Camera Module
  • Media Center HAT Case
  • 16GB micro SD card
  • Raspberry Pi power supply

Hardware Setup

We have created a handy little guide on how to assemble your PiJuice Maker Kit case for a number of options including mounting the Pi Camera and a camera strap to the case. Check out the guide here – How to assemble your PiJuice Maker Kit Case

Installing the Software

There are three different ways in which you can run the software for this project:

  1. Download the pre-compiled image and flash to a micro SD card and insert it into the Raspberry Pi
  2. Use the auto installation script provided below
  3. Manual install the software using the below steps

1. Download OS

You can download the Point and Shoot project OS and flash it to a SD card (8GB min) and insert it into your Raspberry Pi. You can download the image below:

https://drive.google.com/a/pi-supply.com/file/d/1x8WRktBjh7o1oBK6hUUDIvUDmVRBgpOO/view?usp=sharing

md5 = df849e5e0f710e414be4fe27b4040b72

2. Auto-installation

Just run the following script in a terminal window and the point and shoot camera software will be automatically setup:

# Run this line and the point and shoot software will be setup and installed
curl -sSL https://raw.githubusercontent.com/PiSupply/PiJuice/master/MakerKits/Point-shoot-cam/install.sh | sudo bash

3. Manual Installation

The manual installation process requires that you have the latest Raspbian Stretch which can be downloaded from the Raspberry Pi website and that you also known some basic linux commands.

  1. Make sure you have the most up to date version by running the following command:
sudo apt-get update
  1. Install the PiJuice Base software which is required to interact with the PiJuice board. For this project we install the base package but you can also install the GUI:
#Install Base package
sudo apt-get install pijuice-base

 

#Install GUI package
sudo apt-get install pijuice-gui
  1. Download the PiJuice GitHub repository where you will find all the project files for the point and shoot camera:
git clone https://github.com/PiSupply/PiJuice.git
  1. Compile the YUV to RGB convertor for the Raspberry Pi camera and copy the Desktop file to the Desktop directory:
cd PiJuice/MakerKits/Point-shoot-cam
sudo make
cp Point-Shoot.desktop /home/pi/Desktop/
cd ~
  1. Enable the Raspberry Pi camera by using either raspi-config or you can edit the /boot/config.txt and add the following line: start_x=1.
  2. Download the Media Center HAT GitHub repository:
git clone https://github.com/PiSupply/Media-Center-HAT.git
  1. Install the Media Center HAT software:
cd Media-Center-HAT/Software/
sudo bash media-center.sh 90

Usage

To launch the point and shoot camera software simple double tap on the Desktop icon or you can launch it manually from the command line using the following commands:

cd PiJuice/MakerKits/Point-shoot-cam/
sudo python point-shoot-cam.py

To take a picture simply point the camera in the direction you want to take a picture and then tap anywhere on the screen.

On the main screen you will see two buttons, on the left to access the point and shoot settings and on the right to view all previously taken pictures. There is also on the upper right hand side a battery level indicator, which tells you the current status of the battery charge level.

Note: The battery level indicator updates every 60 seconds

Point and Shoot Settings

By tapping on the setting button on the home screen you can change some of the camera settings.

Storage

There are three storage options to where you can save your photos to:

The first is the “Photos Folder”, this is where the images will be saved to in the Raspberry Pi home directory. If the folder does not exist then it will be automatically created. This folder can be accessed using any other program on the Raspberry Pi but it cannot be easily accessed when inserting the SD card into a computer.

The second option is the “Boot Partition”, selecting this option the photos will be saved in the boot partition in a folder named “/boot/DCIM/CANON999”. When the SD card is inserted into another computer it will imitate a SD card from a digital camera and your computer may automatically start to import those images. The downside to using this method is that the boot partition is generally limited in available space.

Lastly, if your Raspberry Pi is connected to your Wi-Fi then you can use cloud storage service called DropBox, where the images can be uploaded to.

Size

There are three picture sizes that you can choose from when taking a photo, Large, Medium and Small.

Large (2592×1944, 4:3 ratio) is the largest size using the 5 megapixel Raspberry Pi Camera. The actual area captured by the camera is much larger that what is displayed in the viewfinder.

Medium (1920×1080, 16:9 ratio) is hi-definition resolution, widescreen format at 2 megapixels.

Small (1440×1080, 4:3 ratio) is a small 1.5 megapixel image.

Effect

The effect screen is where you can change the image to a number of different effects, 17 in total. There are 16 different artistic effects that can be applied to photos, excluding the normal effects. To scroll through the various effects simply tap the directional arrows either side of the effect name.

ISO

ISO setting will adjust the amount of exposure to the camera module, just like any other standard digital camera. The higher the setting the better the camera will work in low light conditions but the image quality may suffer and appear grainy.

Note: The ISO setting will have no effect on the viewfinder, only the captured images.

Quit

Simply “Tap to Confirm Exit” to quit the program and back to the Desktop.

DropBox Setup

Dropbox is a cloud storage solution and synchronizing service. Anyone can sign up for free to this service with a basic package of 2GB of storage, and you can increase this using a number of methods such as paying for a subscription or by inviting your friends to sign up.

Due to the nature of the cloud service, it does require an internet connection either through WI-Fi or Ethernet, Wi-Fi being the most practical solution for this project.

  1. Create a Dropbox Account

Create a Dropbox account if you don’t already have one. A basic Dropbox account is free and will give you 2GB of storage. Sign up at Dropbox.com

  1. Download the Dropbox software using the following commands:
wget https://github.com/andreafabrizi/Dropbox-Uploader/archive/master.zip
unzip master.zip
rm master.zip
mv Dropbox-Uploader-master Dropbox-Uploader
  1. Create a new Dropbox App

Visit https://www.dropbox.com/developers/apps and log in with your Dropbox account credentials.

Use the “Create app” button to begin the process. Select “Dropbox API” and “Full Dropbox”, then assign your app a unique name, then click “Create App”.

In the setting tab of your new app, there is a section with the heading “OAuth 2”, look for the button “Generate access token”. This will give us a long string of seemingly random letters, which is a unique identifier for linking your camera to the Dropbox account.

  1. Set up Dropbox Uploader

On the Raspberry Pi navigate to the Dropbox uploader directory with the following command:

cd /home/pi/Dropbox-Uploader

Now run the dropbox_uploader.sh script from that directory:

./dropbox_uploader.sh

During the uploader script you will be prompted to enter your access token that was generated in Step 3. This must be exact, which is why using SSH to copy paste can be useful.

Note: If you make a mistake during this process you can simply run the script again.

Now let’s test everything is working by uploading a sample file:

echo 12345 > foo.txt
./dropbox_uploader.sh upload foo.txt

This will create text file with the text”12345” and then upload it to your Dropbox folder. Open up your web browser and login to Dropbox and see if the file is there.

Now when you run the point and shoot camera program and select Dropbox from the setting smenu, all photos will automatically get uploaded to your Dropbox account.

 

First published at 6:43pm on January 28, 2019
Last updated at 5:41pm on February 7, 2020