0

I'm trying to measure shutter speeds on old cameras. This essentially consists of:

  1. Shining a torch at one end of the camera
  2. putting the photoresistor at the other end
  3. trigger the shutter which temporarily lets in the light from the torch (boosting the photoresistor values temporarily)
  4. Recording the duration of the increased spike in light levels

What I have currently records light levels but the variation is massive and typically incorrect in that they change depending on how close the torch is to the shutter and typically records values between 400 and 900 ms which is far too long (should be about 50ms).

This is the key code I have so far:

if (shutterbot.opened())
{
    /* Measure length of time it is opened until closure */
    unsigned long previousMillis = millis();

    while(true)
    {
        unsigned long currentMillis = millis();
        unsigned long time_elapsed = currentMillis - previousMillis;

        if (shutterbot.closed())
        {
            finished = true;
            /* Report back to user */
            Serial.println("Shutter speed is: ");
            Serial.println(time_elapsed);
            break;
        }
    }

}

The open and close methods in the shutterbot class are:

/* If light is 10% higher, set it to start recording */
int Shutterbot::opened()
{
    if (light_level() > 400)
    {
    return true;
    }
    else
    {
    return false;
    }
}

/*
  If light drops to below 10% higher, set it to stop
  recording
 */
 int Shutterbot::closed()
 {
     if (light_level() < 400)
     {
     return true;
     }
     else
     {
     return false;
     }
}

The full project code is here and just needs a photoresistor module and an arduino uno to test. I'm not sure I've provided enough information so if there are any questions, please let me know. Any help is greatly appreciated and thanks for reading.

  • Have you tested the reaction time for the photoresistor? Perhaps by turning on a light with the arduino and timing how fast the photoresistor hits your threshold. – Craig Jul 16 '18 at 22:49
  • 1
    if @craig is right and the photo-resistor takes too long to transition, maybe you should use a fast photo-transistor? – esoterik Jul 17 '18 at 0:07
  • Thanks guys, I haven't timed the span between resting levels and the spike but I'm going to try the IR route instead. Not sure about a fast photo resistor. Do they have sampling rates or anything associated? – sam.cooper645 Jul 17 '18 at 17:55
0

It is unlikely a photo resistor can be used to time an event with sub second granularity. This is because the electrons in such a device have many conductive states which they migrate into when exposed to light and out of when left in the dark. It takes time for the electrons to drift into and out of these conductive bands. In some cases it may take a good portion of a second. As described in the 2nd paragraph in the Design Considerations section of the above wikipedia page:

Photoresistors also exhibit a certain degree of latency between exposure to light and the subsequent decrease in resistance, usually around 10 milliseconds. The lag time when going from lit to dark environments is even greater, often as long as one second. This property makes them unsuitable for sensing rapidly flashing lights, but is sometimes used to smooth the response of audio signal compression.

| improve this answer | |
  • Thanks for looking into it st2000. I'll scrap the idea and go down the IR route instead – sam.cooper645 Jul 17 '18 at 17:55
  • You should be able to use a photo diode or transistor as suggested by others here. In case you were wondering I blundered into this same problem years ago on a college project. – st2000 Jul 18 '18 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.