All Collections
Teleport Station on Linux and Windows
DSLR auto power cycling on error and to conserve power
DSLR auto power cycling on error and to conserve power

Ensure reliability by using a power relay

J
Written by John Goode
Updated over a week ago

DSLRs can have USB bus hang ups. Using a simple power relay allows Teleport Station to automatically power cycle the camera when needed. You can also schedule power up, and power down to conserve power, when not capturing.

Below are some Raspberry Pi relays, most allow you to you to cycle power using a simple script or command. This can easily be configured in the Teleport Station callback configuration.

Note you need to match the voltage of the relay to your camera or power brick. On a Windows PC a USB based relay would be the simplest to use.

Here is a Raspberry Pi script to control common relays. It uses the popular RPi.GPIO Python package. Simply set this script as the script to call within Teleport Station configuration and it will do the rest.

relay-turn-on-py :

#!/usr/bin/python

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)

GPIO.setup(12, GPIO.OUT)

// use the pin where your relay is hooked up instead of 12
GPIO.output(12, GPIO.HIGH)

print("relay on")

relay-turn-off-py :

#!/usr/bin/python

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)

// use the pin where your relay is hooked up instead of 12
GPIO.setup(12, GPIO.OUT)

// turn off
GPIO.output(12, GPIO.LOW)

print("relay off")

For Raspberry Pi, it is usually possible to control the relays using just a bash script, for example, in this case you do not need Python or the GPIO library:

#!/bin/sh
ON=0
OFF=1
# GPIO numbers 26, 20 and 21
RL1=26
RL2=20
RL3=21

# Write output
echo $ON > /sys/class/gpio/gpio$RL1/value
echo $RL1 on
sleep 3

echo $OFF > /sys/class/gpio/gpio$RL1/value
echo $RL1 off
sleep 3

echo $ON > /sys/class/gpio/gpio$RL2/value
echo $RL2 on
sleep 3

echo $OFF > /sys/class/gpio/gpio$RL2/value
echo $RL2 off
sleep 3
echo $ON > /sys/class/gpio/gpio$RL3/value
echo $RL3 on
sleep 3

echo $OFF > /sys/class/gpio/gpio$RL3/value
echo $RL3 off

Some relays available for purchase :

Did this answer your question?