Build a Camera Shutter Speed Timer




If you're into film photography using vintage mechanical cameras, you might expect that after 50 years of existence they don't often work as well as they might have originally.  Lubricant dries out, dirt seeps into the mechanisms and eventually things start to go wrong. 

When the delicate timing mechanisms of the shutter begin to deteriorate, the shutter times can change, and this results in incorrect image exposures.  Sometimes  the inaccuracy iis substantial and clearly noticeable, but at higher shutter speeds, it is difficult to tell the difference between 1/500th of a second and 1/1000th of a second.  However, to the film that difference is substantial.

When doing camera shutter repair, having a way to measure the timings can help give you insight into what might be wrong, and also lets you test as you tinker with things to see if you're making things better or worse, and how close you are getting to your desired shutter accuracy.  It's an invaluable tool for any aspiring camera repair tinkerer to have.

This project is based on the PIC18F2525 microcontroller, and an HD44780 16x2 character LCD.  It uses an OPT101 photodiode with integrated trans-impedance amplifier for the sensor, and a 1 watt red LED for the light source.

Step 1: Tools and Materials

For this project I had access to some pretty elaborate tools, but its nothing that can't be done with simple hand tools, it just takes longer.

- 6.5" x 4.5" x 2" Aluminum project enclosure
- Chemistry bolt-down retort stand base
- 8" stainless steel retort stand rod
- Retort stand clamp  x 3
-1/4" thick aluminum plate
- 1" length of 1/4" aluminum or steel rod
- 1.5" length of 1/8" steel rod  x 3
- 1/2" hole rubber grommet x 2
- Various screws, nuts, washers
- Epoxy

Circuit Components:
- 16x2 character HD44780-based LCD
- PIC18F2525 microcontroller
- 28 pin IC socket
- 10k trimpot
- 7805 voltage regulator
- 100nF capacitor x 3
- 10k resistor
- 4.7 ohm 2 watt resistor
- 8MHz crystal
- 15pF ceramic capacitor x 2
- Male header pins
- Female header pins
- Various lengths of wire
- OPT101 photodiode IC
- 8 pin IC socket
- 1W red LED
- SPST toggle switch
- Panel-mount pushbutton
- Panel-mount DC jack
- Heatshrink


- Drill
- Various drill bits
- Mill (if possible)
- Soldering iron
- Solder
- Wire stripper
- Wire cutter
- File
- Center punch
- Hammer
- Tap and die set

Step 2: Schematic and Code

Below is the schematic, it is also available in the attached PDF in high resolution.  The C files and a pre-compiled .hex file are also included.

The files:

flex_lcd_photogate_final.c A modified HD44780 LCD driver with the LCD pins set up as shown in the schematic.  Simply modify the location at the top of the program to match the location of this file on your hard drive.
photogate_final.c   The program code.
photogate_final.hex   The compiled code for the PIC, just waiting to be programmed into it with a USB or serial programmer.

Code explanation:

The code is fairly simple.  The sensor is connected to a hardware interrupt pin.  When the unit turns on, the external interrupt register is prepared to look for a LOW-TO-HIGH change.  When the sensor receives light, the voltage increases until it is in the logic HIGH range.  This triggers the interrupt, and the interrupt routine enables a 100us overflow timer.  It also sets the external interrupt register to now be looking for a HIGH-TO-LOW change. 

While the state is high, every 100us the timer increments a counter.  When the HIGH-TO-LOW event occurs, the external interrupt routine disables the timer, and the timer's count value is converted to milliseconds and sent to the display.

Step 3: Build the Circuit

A good place to start is building the circuit.  I built mine on stripboard, but perfboard or your preferred circuit assembly method is absolutely fine.  An important thing to keep in mind is that the wires running from the crystal to the PIC need to be as short as possible so that the timing signal is not subjected to excessive signal noise.

I used various connectors on the board to make assembly easier.  I would very highly recommend using male/female header pins as a board connector for the LCD, it makes it much easier to assemble and debug the circuit.

The circuit includes a 5V regulator, so the input power to the circuit can be between 6V and 24V without issue.  Any DC wall adapter should work without trouble. 

The schematic for the OPT101 sensor and LED are also included in the top left corner of the schematic.

How to know it's working:

When power is applied, the screen will display "Film Shutter Speed Timer" and waits for you to press the ready button.  When ready is pressed the screen displays "Ready" and the sensor is waiting for light!

Step 4: Preparing the Enclosure

The enclosure is a 6.5" x 4.5" x 2" aluminum project box.  A good way to mark the locations for drilling is to stick masking tape on the surface of the box and draw on top with pencil.  After marking the locations for drill holes, mark them with the center punch. Once all the locations are punched the masking tape can be peeled off.

A good way to mark the square for the LCD is to draw a rectangle on the masking tape, take a sharp knife and use a straight edge to cut along the lines you drew, and peel away the tape.  The razor blade will have marked the surface of the box directly.

If using a mill to cut the rectangle, begin by drilling a hole and inserting a cutter through the hole, then make your way around the perimeter of the rectangle.  After the rectangle is clear, remove the tool radii from the corners of the cutout with a file.

If using a drill to cut the rectangle, start by punching closely-spaced markings 1/4" apart all the way around the inside of the rectangle.  Drill with a 1/4" bit so that almost no material remains to hold the center material in place.  Break the center out with a hammer or file.  Then, file the jagged edges smooth and square the corners.

Step 5: Assembling the Sensors

To have a range of freedom for the sensor and LED so that cameras of different size and shape can be accommodated, I made two aluminum segments to have a number of sensor positions.  They could also be made of wood if you prefer.

To make sensor mounts, cut and file two strips of 1/4" aluminum plate, 1/2" wide by 2" long.  Drill five holes spaced 1/4" apart down the center, and drill with a 3/16" drill bit. Drill a 1/8" hole into the edge of the piece as shown in the picture below.  Epoxy a 1.5" long 1/8" steel rod into  the hole on the edge.  The mounts are now complete.

To prepare the LED, solder + and - wires to the LED's star base so that it won't need to be heated again.  Heat might damage the epoxy if it hasn't fully cured yet.  Then, epoxy a screw on the back. 

To prepare the sensor, I protected the circuitry from the screw head with some hot glue.  After the hot glue cooled, I glued the screw on top of the hot glue with some epoxy, and coated everything else with epoxy.

Step 6: Camera Mount

To mount the camera to a stand clamp, I decided to thread the end of a 1" segment of aluminum rod and screw it into the bottom of the camera mount, then it would be placed into the clamp and held by a set screw. 

Take the 1" length of aluminum rod and thread the first 1/4" with a 1/4-20 die.  This is the industry standard camera tripod mount thread.  It should screw tight into the camera bottom.

The retort stand clamps that I had required 3/16" diameter rods, so the hole has to be expanded.  This is done by simply drilling out the 3/16" hole with a 1/4" drill bit.  The camera mount is now ready.

Step 7: Assembly

I started with the electronics.  First, place a little bit of tape on the inside of the enclosure where the LCD connector pins will be, to make sure they don't touch the enclosure.  I used hot glue to hold the LCD in place, but nuts and bolts could be used too.  Place the switch and button and solder them to the board.  Make some sensor cables out of wire, female header pins and heat shrink tubing.  Insert the grommets in their holes and pass the connectors through them.  Connect them to the PCB pin headers.  Since the PCB is on a connector, its easy to work on it and then attach it to the LCD when finished. 

Use some bolts, tooth-washers and nuts to attach the retort stand base to the top of the enclosure.  Insert the retort stand rod into the base and put the clamps in place.  Insert the sensor holders and sensors, and connect the sensor cables.

Step 8: Finished!

To set the device up for camera testing, first, position the sensor at the base of the stand. Next, insert the threaded rod into the camera and then the rod into the clamp. Move the camera into alignment just above the sensor and clamp it tightly. If you are testing an SLR without the lens, make sure that the sensor will not collide with the mirror as it flips up. Open the back of the camera and move the LED into position just above the shutter. Turn the device on and cock the camera lever. Set your shutter speed. Press the ready button and fire the shutter. I recommend doing at least 10 tests on each speed to make sure that the speeds are consistent and accurate.

From concept to completion this project took about 5 weeks.  If anyone has any suggestions, questions or comments I would love to hear them.  Thanks very much for reading and I hope that this Instructable was helpful, informative and interesting to you.

Please turn to the next page to see the results of my first test run!

Step 9: Results

Below are the results generated my my Pentax K1000.  You can see there is an issue on the last line of the data, the shutter speed is much much faster than it is intended to be.

What does this mean?

I know from additional investigating that there is a problem with this camera.  at 1/500th of a second the shutter only opens 80% of the way before closing, this means that the time measurements are correct, but in actual fact you would only produce 80% of a picture using this speed.  At 1/1000th, the shutter only opens 20% of the way, so the light getting to the sensor was cut off quite quickly, resulting in a reading of 400us instead of the expected 1ms.  This problem is likely due to dried lubricant in the shutter mechanism making it open incorrectly at high speeds.

Microcontroller Contest

Participated in the
Microcontroller Contest



    • Backyard Contest

      Backyard Contest
    • Planter Challenge

      Planter Challenge
    • Games Contest

      Games Contest

    31 Discussions


    10 months ago

    I am very interested in your project. Would it be possible to make the same one with 3 sensor and 3 display, so that you measure the curtain timing and speed at the beginning, middle and end of travel path.

    1 reply

    Reply 10 months ago

    I think that should be possible, however measuring the curtain speed would be tough, unless you are doing something like starting at "0" and detecting the start and end of each sensor detection, that would tell you the opening and closing time. I don't think you'd get that information just measuring the duration that each sensor is detecting the shutter to be open, but that would detect "shutter capping" and the change in shutter slit width from start to finish, like you describe below.


    8 years ago on Step 9

    The shutters not fully opening isn't an error. Mechanically shutters can only move so fast so to get "faster" shutter speeds, only a portion of the frame is exposed at a time simulating a faster shutter speed. Read more here:

    2 replies

    Reply 8 years ago on Step 9

    I have taken the camera and looked through the shutter at a bright white wall in sunlight, when the shutter fires at all other speeds it is clear the entire frame lights up, but at 1/500 only 80% lights up and at 1/1000 it is clear that about 20% lights up. Even with this "scanning" exposure method, I should still see the entire frame light up.

    This is a common problem with old shutters, it is a result of dried lubricant in the mechanism preventing faster motion. The first shutter is slow due to a malfunction, so the second shutter overtakes it mid-exposure, resulting in a partially-exposed image.


    Reply 10 months ago

    What you’ Experiencing is shutter capping. Second curtain is faster that first. At a point in the travel pat, the second curtain will obscure the film windows, and the slit wild the will be colsed


    2 years ago

    All I can say is wow. I started using film cameras in 1967 at the age of 15. My dad gave me a welta accordian type viewfinder with parallex correction that he taught me the basics with. We went on to builda dark room in the garage and developed 100's of B&W least half of my negatives were not worth printing. After getting my first job at a restaurant, I saved up to buy a used Rolleicord with a 1/500 shutter speed setting

    1 reply

    2 years ago

    Looking at the schematic, the output of the photodiode goes to Pin 3 of the connector; once connected with the main board, that signal is sent to ground. Am I missing something or should the output of the photodiode go to Pin 2 of the connector, which then goes to Pin 21 on the PIC?

    1 reply

    Reply 2 years ago

    you're right, there is an error there. the photodiode output goes to pin 21.


    6 years ago on Introduction

    hello ... very nice and well done. I also thought I build something like that, but I have no time.
    How much did it cost?
    you want to sell it?
    Thank you.

    2 replies

    Reply 6 years ago on Introduction

    It didn't cost me much since I had a lot of the parts on hand, it might cost $60 if you had to buy everything. I don't want to sell it as I use it all the time. The design would need some improvements if it was to be commercialized. It is not accurate for faster than 2ms (1/500) shutter speed.


    6 years ago on Step 9

    Why did you use such a bright LED?


    6 years ago on Introduction

    Nice project!

    I thought I'd ask about a discrepancy between the parts list and the schem that's confusing me:

    Is the cap that goes from the Ready switch to ground supposed to be 1 nF or 100 nF? The parts list calls for three 100nF (0.1uF) caps, but the schematic only uses two of them, and the 1 nF cap in the schem isn't in the parts list.

    I'm wondering whether the parts list or the schem is correct.


    3 replies

    Any recommendations on a suitable PIC18F programmer, C compiler, and IDE environment? I'm a total PIC-newb. I'm going to miniaturize my build, using an 8x2 display to make the device pocket-sized. That means I'll have to make some changes to the code and re-compile before burning a hex file to the pic.

    I spent the day trying to get the Microchip XPLAB X IDE up and running, but it's C18 compiler for the PIC18F seems to be quite finicky -- it's throwing all sorts of errors with the supplied code, and the build keeps failing. I'm wondering whether this IDE might just be buggy.

    Would you mind discussing what type of environment you used to develop & implement the supplied code, as well as what sort of hardware you used for debugging and burning to the PIC?

    thanks again!


    Sorry about that, its not going to work in MPLAB. I wrote the code in CCS and it is not directly compatible with MPLAB.  If you feel up to the task you can rework it to get it to run, but I am not a very good programmer and can't offer much help.  I use CCS because it spares most of the setting up of the chip's resources, or at least makes it easy and more plain-text than MPLAB does. 

    I've learned quite a bit about RTC circuits and timekeeping since this project was done, there are some pretty easy ways to make it way more accurate.


    7 years ago on Step 9

    This looks like a very interesting project and will be worth trying for all film camera users. I have attempted to make electronic timers based on infrared diodes as emitters and detectors, but without any success so I resorted to making a purely mechanical set-up based on the famous Leica Drum Tester. It uses a slotted drum rotating at a constant speed, and is still a quick method of spotting shutter bounce and fade.

    1 reply

    Reply 7 years ago on Step 9

    A quick google finds some interesting information on that method of testing, it's quite similar to a method I saw using the scanning electron gun of a CRT television for the same effect. Quite interesting, thanks for sharing.


    8 years ago on Introduction

    This is absolutely amazing, great work. I created a far simpler version that uses a flashlight or laser pointer, phototransistor, 1.5 volt battery, a resister, and a mini-stereo audio plug to connect to a computer via the line input port. Then I use audio recording software to record the signal generated by the light hitting the phototransistor as a wave file that is very accurate. It's not nearly as good as this design because computer audio ports are not designed to read DC current so the signal gets dropped if it is too long, but it is accurate for most shutter speeds above 1/20 second. I should post an instructable for my simple version anyway because even though your design is far better, it may be a bit much in the way of electronics and programming for most people to tackle (including me).