Martin Foot

Controlling a Sony Alpha SLR Remote Release With a Microprocessor

I wanted to control my old Sony Alpha SLR with an Atmel AVR. It turns out it’s very easy to do.

I repurposed a cheap Alpha remote trigger cable from amazon.co.uk (about £3) for this, but you can also make your own connector. See this instructable by Brad Justinen that shows how to mimic the Alpha remote release connector using a 4 pin internal CD-ROM drive audio connector.

"Sony Alpha Shutter Release Cable"

Other parts required:

  • An optoisolator or relay (relays are more difficult to use)
  • 3 single line header pins
  • Some solderboard
  • A soldering iron and solder
  • A drill
  • A cable tie or some glue
  • A saw

Step 1: Remove the casing around the trigger button

I used a junior hacksaw to chop off the bottom end completely. After doing this you should see three wires. The mechanism simply connects two of them together to focus and then the third to take the photo.

Once the bottom is off, you should be able to use some side cutters to chop off the three wires or de-solder them.

"Step 1"

Step 2: Remove the casing around the cable

I used the junior hacksaw again to chop carefully around the end with the cable. The aim is to keep the rubber cable tensioner as part of the cable, not to chop the cable off.

After doing that, you should have something that looks like this:

"Step 2"

Step 3: Make the breakout board

I drilled a hole in the solderboard big enough to fit the camera cable, then two smaller holes either side. I fed the cable through and used a cable tie to hold it in place. This allows there to be some tension and tugging without the solder connection breaking. I then soldered each of the three cables into the board and a single row of three headers to connect to a breadboard for prototyping.

"Step 3"

Step 4: Wire up the optoisolator

Using an optoisolator means that you can’t accidentally send any current through the camera’s remote release trigger port. It’s likely to be protected but there’s still the chance that it could be damaged if this happened.

The single optoisolator DIL package has four pins. I connected the input side from one of the AVR’s digital out pins to ground, and to the output side I attached the white and yellow cables (focus) to one pin, and the red cable (shutter) to the other. Simply by putting this pin to the HIGH state in the microprocessor I can take a photo with the SLR. Note that you may need a resistor here depending on the optoisolator and the amount of current your chip can drive.

My use case is for time-lapse photography, which is why I wired the two focus pins together. I will set my camera up manually, set to manual focus, then connect the cable. As the camera is in manual focus mode, having the two focus pins connected does nothing.

Setting Up a Personal Wiki With AWS and Gollum

This post explains how to get a personal wiki using Gollum running on Amazon Web Services (EC2) on a micro instance with the free usage tier.

For a long time I’ve been using TiddlyWiki as a personal wiki for note taking. I used DropBox to sync the wiki html file between machines. I have wanted to upgrade this for a while for a system that has proper versioning and better syntax highlighting. I’ve also wanted to test out using AWS as I think it will be a useful experience for the future.

Step 1 - Get a domain name.

Any domain name will do. I recently learned about Internationalised Domain Names, which are URLs that contain language-specific Unicode characters. Browsers interpret the Unicode characters in a system called Punycode, which encodes the Unicode characters into a restricted ASCII character set, allowing DNS entries for IDN sites in the ASCII character set.

For instance, hover your mouse over the following URL in a modern browser and you will see a domain beginning with xn--: ☁→❄→☃→☀→☺→☂→☹→✝.ws

I had a browse through a Unicode character table, found a glyph that I liked (it looks like a skull with a monocle), then found the punycode URL for the character, then registered it with NameCheap. Despite the name, the customer support was very good.

I now had the URL http://ௐ.com.

Step 2 - Set up an Amazon Micro Instance

I signed up for the free usage tier of AWS, started up a micro instance, assigned an elastic IP to the instance, then pointed the DNS A record to that IP using NameCheap’s DNS server.

I used all of the default settings, and the micro instance image is the Ubuntu 13.04 server image. The next step was to install all required dependencies and Gollum itself:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim build-essential ruby ruby-dev libxslt1-dev git-core libxml2-dev
sudo gem install redcarpet gollum

The Gollum wiki has a list of other gems that you might find useful for different types of language markup and syntax highlighting. After the dependencies had been installed, I opened up TCP port 4567 on the web server security group, and created the wiki itself:

mkdir wiki
cd wiki
git init .

I added a file at config.ru to enable HTTP Basic Auth on the Rack application, based on the file I found here.

require 'rubygems'
require 'gollum/app'

use Rack::Auth::Basic, "Restricted Area" do |username, password|
   [username, password] == ['user', 'password']
end

gollum_path = File.expand_path(File.dirname(__FILE__))
Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:wiki_options, {})
run Precious::App

I could then see the server running with HTTP basic auth (see more authentication options for Rack::Auth here) on port 4567, after running the following:

rackup -p 4567 config.ru

Hitting <Control+Z>, then running the following will let you log out of the session and the server will continue to run.

bg
disown

You can install an Upstart script to have Upstart manage your Gollum process. A quick Google found one that looks like it will do the trick here.

Note: This git repository has no remote, so this is your only copy. I suggest using an EBS volume to store your git repo, or for instance a nightly Cron job that pushes to another server.