Replacing a simple and inexpensive remote cable release for your camera with Raspberry Pi may seem like a classic case of over-engineering, but using the tiny machine to control the camera opens up a whole new world of photographic opportunities. Using a simple Python script, you can turn Raspberry Pi into a powerful and flexible intervalometer or trigger the shutter using sensors connected to the computer. Add to Raspberry Pi a Python-based web app, and you can control your camera from any computer or mobile device.
As with any DIY electronics project, there is always a risk of damaging your camera, so proceed with caution. If you are not sure what you are doing, don’t proceed at all.
This project provides brief instructions on how to build a Raspberry Pi-based cable shutter release and deploy a simple web app that can be used to control it. The setup uses a Sony NEX-3N camera, but any Sony camera compatible with the RM-VPR1 cable release should work fine. And with a few minor tweaks, you can adapt the setup to work with many other camera models.
- RM-VPR1 remote cable release (you can buy a compatible unit cheaply on eBay)
- 2x 1K resistors
- 2x 2N2222 NPN transistors
- A breadboard and handful of jump wires
First, disassemble the remote cable release. The release has three wires: focusing wire (yellow), trigger wire (red), and ground wire (white). The wire colors may vary depending on the unit you use. The way the cable release works is very simple: when it mechanically shorts (i.e., closes the circuit) the focusing and ground wires, the camera obtains focus. With the focusing and ground wires still shorted, the release then shorts the trigger and ground wires, which triggers the camera’s shutter.
To close the circuits in the required order electronically, you need to create a twin-transistor switch as shown below:
Use the following diagram to wire the circuits on the breadboard:
Next, boot Raspberry Pi and run the nano test.py command to create a test.py file and open it for editing. Paste the following code into the file:
from time import sleep
import RPi.GPIO as GPIO
Save the script and make it executable using the chmod +x test.py command. Plug the cable release into the camera, turn it on, and run the script using the sudo ./test.py command. If everything works properly, the camera should fire.
To make it easier to control the cable release, you might want to add a simple Python-based web app. To do this, install the Python Bottle framework:
sudo apt-get update
sudo apt-get install python-pip
sudo pip install bottle
Instead of writing the web app from scratch, you can grab the code for this project from GitHub using the following command:
sudo git clone https://github.com/dmpop/sony-rpi-remote.git
Once you’ve done that, use the terminal to switch to the sony-rpi-remote directory, and run the sudo ./server_sony_rpi_remote.py command to launch the app.
Point then the browser to http://127.0.0.1:8080/ (replace 127.0.0.1 with the actual IP address of Raspberry Pi), and you should see the web app in all its bare-bones beauty.