Friday, March 25, 2011

Zeus: trigger your camera with lightning

Introduction

I have always been fascinated by photographs about lightnings. While it is relatively easily to put a lightning strike in any photograph using image editing techniques :) I still prefer the real thing. Since photography is a hobby of mine, I wanted to be able to photograph lightnings. However, when I tried to do it without any specialized equipment, I didn't have much success.


The finished product.
I don't like the knob on the potentiometer, I just put it on for the sake of the photo - who knows when I will find a nicer one...

Reading a bit about the subject on the internet I found there are many designs/solutions available, to get around the problem. Since the price of the commercially available ones are too high for my budget (and let's face it, it's not much fun buying something ready made when you can also make it yourself), I decided to make one for myself for less.

I found many similar designs on different web sites and finally I came up with my own, which is - admittedly - very similar to one particular one I found on this photography site (only in Hungarian). I kept most of the design, but replaced the relays with opto couplers and put the whole thing in a plastic box to make it easy to drag around.

If you are interested to make one like this, please e-mail me. I can provide you with customized kits that contain as many or as few components as you need/like (from just a programmed microcontroller to a fully built and tested PCB) to suit your experience/skills. Please note, I do NOT provide the enclosure as it is very time consuming for me to make. The code for the PIC is also available on request.

Hardware

The circuit is based on a 16F628A PIC microcontroller. This is one of my favourite PIC micros and I have used it in several previous projects.

Schematics of the circuit

The light sensing part (OPT101) is a monolithic photodiode and single-supply transimpedance amplifier in a single 8DIP package allowing a smaller final product size. When designing the PCB care must be taken to position this part in a place where it can "see" the ambient light and lightning bolts.

The connection with the camera is provided by two opto couplers. This allows the camera's circuitry to be completely decoupled from my circuit so that any problem in my circuit will not damage the camera.

The cable that attaches to the camera is recycled from an old, cheap camera remote release cable - I just removed the original buttons from it. These remote release cables (for any camera that supports it) can be easily sourced through eBay for a couple of euros. My latest one for Nikon cameras cost around €1,50. The advantage of this is that you don't have to prepare your own special cable/connector combo for a specific camera, which can be tricky.

The "El cheepo" remote release before...
... and after the conversion.

The PCB was designed to use mostly SMT parts to save on PCB manufacturing costs and make the device as compact as possible.

The circuit also contains an ICSP interface for easy development.

Operation

After powering up, the circuit enters calibration mode. In this mode the user must adjust the light sensitivity. This is to allow operation in both total darkness and with some ambient light. The best setting is when the Mode and the Calibration LEDs are bot lit up (or almost), although this is not critical.

The 4 LEDs are used for calibration and mode feedback to the user.
By clicking once the Mode button the device is armed and waiting for the lightning. This is signalled by lighting up the Meter LED. At the same time the camera enters metering mode (the equivalent of pressing the exposure release button half way).
When the device senses a sudden change of ambient light it lights up the Trigger LED for a while and sends the exposure release signal to the camera synchronously (the equivalent of pressing the exposure release button all the way).
For proper operation the camera's autofocus feature should be disabled and a suitable long exposure time should be set.

In the following video I demonstrate the operation of the device. Unfotunately, I haven't been able to test it in an actual storm with lightning, since I live in an area where storms are very rare (Greece). Instead, I faked the lightning with a flash activated manually. If you listen carefully you can hear when the camera enters "metering" mode and when it takes the photograph.


Steps shown in the video:
  • Switching on the device
  • Calibrating for the light available in the room
  • Arming the device
  • Simulating a lightning
  • The camera is triggered and the picture is taken - you can see it showing up for a few seconds on the camera's screen.


Battery life

I used a very low quality, "no name" rechargeable 9V Ni-MH battery for the tests. During tests conducted in-house I was able to keep the device continuously in armed mode (awaiting lightning) with the occasional exposure (you can test it very easily with a manual flash) for more than 5 hours with one charge. This is more than enough to cover a storm since most ones with lightnings are very brief (at least in my area).

Although the battery is "no name", the connections try to be professional - shrink tubes protect each solder joint on every off-the-PCB part.


Case for the circuit

The most difficult part of the project (for me) is almost always the presentation, i.e. a nice, user friendly case or housing. For this project I ordered a small plastic project box on eBay and customized it. The box is 130*24*68 mm, big enough to contain all the parts including the PCB and a 9V battery.

The PCB was designed to fit snugly in the enclosure box next to a 9V battery
I designed the PCB so that the light sensor, the control LEDs and button are nicely aligned with each other, so only holes had to be drilled on the face of the box. Only two components (+ the battery) are separate from the PCB: the on/off switch and the sensitivity potentiometer. They are both mounted on the face of the box under the battery.


Possible future improvements

  • If I have some time in the future I may change the software to auto calibrate the device, i.e. the user should not fiddle with it manually.
  • Once I find a suitable socket, I will also add external power support which will power the device as well as recharge the battery in the enclosure.


More images

I took the following pictures while I was assembling a device for someone. This is the recommended order of assembly, from small to larger elements.

The empty PCB - front side

The empty PCB - back side

All the SMT resistors and capacitors soldered on

The two SMT ICs are also soldered on

The stabilizer IC and the optocouplers are also in their places

All the components are soldered on

There was a short circuit (manufacturing defect) on one of the boards which I fixed by removing some of the copper (unfortunately I had to remove a lot because I didn't see where exactly the short was) and using a coated copper wire to make the necessary connection. The circuit is now working perfectly.

And finally, some close ups of the enclosure.

Close-up of some of the control elements: ON/OFF switch, sensitivity potentiometer and connection for the camera remote release cable.

Four screws in the four corners hold the box together.

Update 23/01/2013

I have made some improvements to the PCB. It got smaller and some of the parts that have not been integrated to the PCB are now soldered to the PCB.

Component side - v1.3

Solder side - v1.3

Update 6/8/2013

I just won Lifehacker's "Best Camera Hacks" competition with this entry!