I'm trying to measure shutter speeds on old cameras. This essentially consists of:
- Shining a torch at one end of the camera
- putting the photoresistor at the other end
- trigger the shutter which temporarily lets in the light from the torch (boosting the photoresistor values temporarily)
- 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.