There's a bit of hardware setup in this project, which involves building a circuit with a couple of transistors and a couple of resistors, but nothing that can't be done in a couple of hours.

Also, there are a few pre-built modules used, namely a DC-DC converter and a Dual H-Bridge Motor Driver circuit.

If you're not going to drive a motor, then you can skip the Motor Driver section and if you use a 5v battery pack you can skip the DC-DC converter section. Jump straight down to the Camera Shutter Circuit section.

Motor Driver

We'll start with the Dual H-Bridge Motor driver.

So, depending on which GPIO pin we activate, it will out out +12V or -12V on the A output or the B output. In the picture above, the motor is connected to the A output. If we wanted to use a stepper motor, we could use both A and B outputs, and change the code to pulse the GPIO pins accordingly. For now, we're just using one output to a plain 12V DC geared motor. You can also see in the image the timing pulley mounted on the motor which pulls the dolly along the rail.

DC-DC Converter

Next, we'll look at how we power the Raspberry Pi. Now we don't want to have a second battery just for the Pi, so we can use a DC-DC converter to give us 5v. A typical DC-DC converter is shown in the next image.

Notice that we feed the 5V in to the GPIO port, saving us having to have a connector sticking out of the mini-USB port, this saving us space.

Camera Shutter Circuit

Finally, we look at the circuit to drive the camera shutter. It's simpy a couple of NPN transistors, one for the focus and one for the shutter release.

The shutter release port in a DSLR will typically have 3 pins. One GND, one for focus, and one for the shutter. There's just like GPIO inputs, in that they will have a 3.3v voltage across them, and are activated by shorting them together. So, grounding the shutter pin will activate the shutter in the camera.

Some cameras need the focus pin actived before the shutter pin. Other cameras will trigger the camera with just the shutter pin shorted. On Canon DLSR's just the shutter pin is needed so one transistor and one resistor will suffice. Here's a diagram of the circuit. If you need to activate the focus pin on the camera, do a second one of these for the focus pin.

Here's the cable that's used to connect the project to a Canon 5D Mark III DSLR. It's made by replacing one end of a shutter release cable with a 3.5mm stereo jack plug.

Putting it all together

A couple of acrylic cases are ideal. You can leave the top off one of the cases for the PiTFT, as it's conveniently the same size as the Raspberry Pi. All the other circuitry can be put in another case below, and hidden away underneath the Raspberry Pi. You can also add suitable connectors for everything.
  • DC jack socket for the 12V input from the battery pack
  • DC jack socket for the 12V output to the motor
  • Stereo 3.5mm headphone socket for shutter release cable to DLSR
  • Power switch to switch everything off and on

And here's the finished article.

This guide was first published on Jan 27, 2014. It was last updated on Jan 27, 2014.

This page (Hardware) was last updated on Jan 25, 2014.

Text editor powered by tinymce.