Arduino Film Camera Shutter Checker

by ema_xiety in Circuits > Arduino

5084 Views, 12 Favorites, 0 Comments

Arduino Film Camera Shutter Checker

P8020014.JPG
P8020001.JPG

Recently I bought two used-old film cameras. After cleaning them I realized that the shutter speed could be lagged by the dust, corrosion or oil lack, so I decided to make something for measuring the real exposition time of any camera, because, by my bare eyes, I can't measure it precisely.

This project uses Arduino as the main component for measuring the exposition time. We are going to make an opto couple (IR LED and an IR photo-transistor) and read how much time the camera's shutter is open. First, I will explain the fast way to achieve our goal and, at the end, we'll see all the theory behind this project.

List of components:

  • 1 x Film Camera
  • 1 x Arduino Uno
  • 2 x 220 Ω Carbon film resistor
  • 1 x IR LED
  • 1 x Phototransistor
  • 2 x Small breadboards (or 1 big breadboard, big enough to fit the camera in the center)
  • Many jumpers or cable

*This extra components are needed for the explanation section

  • 1 x Normal Color LED
  • 1 x Momentary push button

Wiring Stuff

cam shutter_bb.png
P8020006.JPG
P8020009.JPG

First, attach the IR LED in one breadboard and the IR Phototransistor in the other so we can have them facing each other. Connect one 220 Ω resistor to the LED anode (the long leg or the side without the flat border) and connect the resistor to the 5V power supply on the Arduino. Also connect the LED cathode (short leg or the side with the flat border) to one of the GND ports in the Arduino.

Next, wire the Collector pin on the photo transistor (for me is the short leg, but you should check your transistor datasheet to be sure you are wiring it the correct way or you may end blowing up the transistor) to the 220 Ω resistor and the resistor to the pin A1 on the Arudino, then connect the Emitter pin of the photo transistor (the long leg or the one without a flat border side). This way we have the IR LED always on and the photo transistor set as a sink switch.

When the IR light arrives the transistor it will allow current to pass from the Collector pin to the Emitter pin. We'll set the A1 pin to input pull up, so, the pin will be always on a high state unless the transistor sinks the current to mass.

Programming

Set up your Arduino IDE (port, board and programmer) to match the configuration needed for your Arduino board.

Copy this code, compile and upload:

int readPin = A1; //pin where is connected the 330resistor from the phototransistor
int ptValue, j; //the storage point for the data readed from analogRead()
bool lock; //a bolean used to read the state of readPin
unsigned long timer, timer2;
double readed;
String select[12] = {"B","1","2","4","8","15","30","60","125","250","500","1000"};
long expected [12] = {0,1000,500,250,125,67,33,17,8,4,2,1};

void setup(){  
  Serial.begin(9600); //we set serial communication at 9600 bits per second
  pinMode(readPin,INPUT_PULLUP); //we are going to set the pin always high except when the photo transistor is sinking, so, we'd "reversed" the logic
  //it means HIGH = no IR signal and LOW = IR signal received
  delay(200); //this delay is for lettin the system start and avoiding false readings
  j = 0; //initializing our counter
}

void loop(){
  lock = digitalRead(readPin); //reading the state of the given pin and assigning it to the variable
  if (!lock){ //run only when the pin is LOW
  timer = micros(); //set the reference timer
  while (!lock){ //do this while pin is LOW, in other words, shutter open
    timer2 = micros();// take an elapsed time sample
    lock = digitalRead(readPin); //read the pin state to know if the shutter has closed
    }
    
  Serial.print("Position: "); //this text is for displaying the adquired information
  Serial.print(select[j]);
  Serial.print(" | ");
  Serial.print("Time opened: ");
  readed = (timer2 - timer); //calculate how much time was the shutter open
  Serial.print (readed);
  Serial.print(" us");
  Serial.print(" | ");
  Serial.print("Expected: ");
  Serial.println(expected[j]*1000);
  j ++;// increase the position of the shutter, this could be done with a button
  }
}

After the upload is done, open the serial monitor (Tools -> Serial monitor) and prepare the camera for readings

The results are shown after the "time opened:" words, all the other information is pre-programmed.

Setting Up and Measuring

P8020013.JPG
P8020014.JPG
Miranda sensorex 935701.PNG
praktica mtl5 1.PNG

Take off your camera lenses and open the film compartment. If you have a film already loaded, remember to finish it before doing this procedure or you'll damage the photos taken.

Place the IR LED and the IR photo transistor on opposite sides of the camera, one on the side of the film and the other one in the side were the lenses were. No matter which side you use for the LED or the transistor, just make sure they do visual contact when the shutter is pressed. To do this, set the shutter on "1" or "B" and check the serial monitor when "taking" a photo. If the shutter is nice working the monitor should show a reading. Also, you can place an opaque object between them and move it to trigger the measuring program.

Reset the Arduino with the reset button and take photos one by one at different shutter speeds starting by "B" to "1000". The serial monitor will print the information after the shutter closes. As an example you can see the times measured from a Miranda and Praktica film cameras on the attached images.

Use this information to do corrections when taking photos or diagnose the state of your camera. If you want to clean or tune up your camera, I highly recommend to send them to an expert technician.

Geeks Stuff

ptrans_rating.PNG
ptrans_diagram.PNG
led_rating.PNG
cam shutter_button.png
P8020002.JPG
P8020004.JPG
P8020011.JPG
serial plot test.PNG
with out setup delay.PNG
with delay on setup.PNG

Transistors are the base of all the electronic technology we see today, they were first patented around 1925 by an Austro-Hungarian-born German-American physicist. They were described as an device for controlling current. Before them, we had to use vacuum tubes to do the operations transistors do today (television, amplifiers, computers).

A transistor has the ability to control the current flowing from the collector to the emitter and we can control that current, in the common transistors with 3 legs, applying current on the transistor gate. In most transistors the gate current is amplified, so, in example, if we apply 1 mA to the gate, we get 120 mA flowing from the emitter. We can imagine it as a water tap valve.

The photo transistor is a normal transistor but instead of having a gate leg, the gate is connected to a photo sensible material. This material sources a small current when it is excited by photons, in our case, IR wavelength photons. So, we control a photo transistor modifying the power of the IR light source.

There are some specs we should take in account before buying and wiring our elements. Attached is information retrieved from the transistor and LED datasheets. First, we need to check the transistor breakdown voltage which is the maximum voltage it can handle, for example, my breakdown voltage from emitter to collector is 5V, so if I wire it wrong sourcing 8V, I'll fry the transistor. Also, check for the power dissipation, it means how much current can deliver the transistor before dying. Mine says 150mW. At 5V, 150mW means sourcing 30 mA (Watts = V * I). That's why I decided to use a limiter resistor of 220 Ω, because, at 5V, a 220 Ω resistor only allows to pass a max current of 23 mA. (Ohm's Law: V = I * R). Same case goes for the LED, the data sheet info says its max current is about 50mA, so, another 220 Ω resistor will be ok, because our Arduino pin max output current is 40 mA and we don't want to burn the pins.

We need to wire our setup as the one in the picture. If you are using buttons like mine, take care to put the two round protuberances at the center of the board. Then, upload the following code to the Arduino.

int readPin = A1; //pin where is connected the 220resistor from the phototransistor
int ptValue, j; //the storage point for the data readed from analogRead() void setup() { Serial.begin(9600); } void loop() { ptValue = analogRead(readPin); //we read the voltage value on the readPin (A1) Serial.println(ptValue); //this way, we send the readed data to the serial monitor, so we can check what is happening delay(35); //just a delay to make screenshots easier }

After uploading, open you serial plotter (Tools -> Serial plotter) and watch what happens when you push your IR LED switch button. If you want to check if the IR LED is working (also tv remotes) just put your cellphone camera in front of the LED and take a photo. If it is ok you will see a blue-purple light coming from the LED.

In the serial plotter you can differentiate when the LED is on and off, if not, check your wiring.

Finally, you can change the analogRead method for a digitalRead, so you can see only 0 or 1. I suggest to do a delay after the Setup() to avoid a false LOW read, (picture with one small LOW peak).