Skip to the content.

MycilaShutterSpeedTester

ESP32 firmware to measure camera shutter speeds

Latest Release GPLv3 license Contributor Covenant Build GitHub latest commit

Description

This is an ESP32-based device designed to accurately measure camera shutter speeds. It uses a light sensor to detect when the shutter opens and closes, calculating the exact duration with microsecond precision. The device displays the last 8 measurements on its screen and outputs detailed readings via serial console.

The device supports two shutter types with optimized detection thresholds:

Switch between modes by double-clicking the button.

Perfect for:

YouTube video to demonstrate the device in action:

Demo Video

Table of Contents

Hardware Requirements

To build this project, you will need the following M5Stack components:

Component Price Link Required
ATOMS3 Dev Kit ~$15 M5Stack Store ✅ Yes
Light Sensor Unit (Photo-resistance) ~$3 M5Stack Store ✅ Yes
ATOMIC PortABC Extension Base ~$3 M5Stack Store ✅ Yes
ATOM TailBat (Battery Accessory) ~$9 M5Stack Store ⚪ Optional

Total cost: ~$21 (without battery) or ~$30 (with battery)

Note: The ATOM TailBat battery is optional but recommended for portable use.

Installation

Releases (firmware binaries) are available on the GitHub releases page.

Prerequisites

You need esptool.py installed on your system. Install it using pip:

pip install esptool

Flashing the Firmware

  1. Connect your ATOMS3 to your computer via USB
  2. Erase the flash memory:
    esptool.py erase_flash
    
  3. Flash the firmware:
    esptool.py write_flash 0x0 MycilaShutterSpeedTester-BOARD.bin
    

Wiring

The wiring is straightforward using the M5Stack ecosystem:

  1. Connect the ATOMS3 to the PortABC Extension Base

    • Simply plug the ATOMS3 onto the PortABC base
  2. Connect the Light Sensor to Port B

    • Plug the Light Sensor Unit into Port B of the PortABC Extension Base
    • The light sensor will be connected to GPIO8
  3. Optional: Connect the TailBat

    • Attach the ATOM TailBat to the bottom of the setup for portable operation
    • This allows you to use the device without USB power

Connection Diagram:

[ATOMS3 Dev]
     ↓
[PortABC Extension Base]
     ↓ Port B
[Light Sensor Unit]
     ↓ (optional)
[ATOM TailBat Battery]

Important: Make sure the light sensor is connected to Port B (GPIO8) for the firmware to work correctly.

Usage

Setup

  1. Position the light sensor directly in front of your camera lens
  2. Ensure the sensor is close enough to detect light changes when the shutter opens
  3. The device should be powered on and displaying the main screen
  4. Select the appropriate shutter mode:
    • Leaf shutter mode for cameras with leaf shutters
    • Focal-plane mode for cameras with focal-plane shutters
    • Double-click button A to switch between modes

Taking Measurements

  1. Point the light sensor at a light source (or camera lens pointed at light)
  2. Fire the camera shutter
  3. The device will automatically:
    • Detect when the shutter opens (light increases)
    • Detect when the shutter closes (light decreases)
    • Calculate the time difference
    • Display the measurement on screen and serial console

Display Information

Serial Console

Connect to the serial console (115200 baud) for detailed information:

500000 us => 500 ms => 1/2 s
250000 us => 250 ms => 1/4 s
125000 us => 125 ms => 1/8 s

Button Controls

Calibration Modes

The device includes calibration modes for both shutter types to fine-tune the light detection threshold. Different cameras and lighting conditions may require different sensitivity levels.

When to calibrate:

How to calibrate:

  1. Enter calibration mode:

    • Double-click button A to cycle to either “LEAF SHUTTER Calibration” or “FOCAL-PLANE Calibration” mode
    • The screen will show the current threshold value and real-time light sensor readings
  2. Adjust the threshold:

    • Point the light sensor at your light source (same setup as for measurements)
    • Observe the raw sensor value displayed on screen
    • Hold button A to increment the threshold (cycles from 0 to 4075 in steps of 25)
    • The sensor reading will be colored:
      • Yellow: Sensor value is above threshold (light detected)
      • Red: Sensor value is below threshold (no light detected)
  3. Find the optimal threshold:

    • With the shutter open (sensor pointing at light), the reading should be yellow (above threshold)
    • Trigger the shutter and observe if readings drop to red when closed
    • Adjust the threshold so it reliably distinguishes between open and closed states
    • The threshold is automatically saved to device memory
  4. Reset to defaults:

    • Single-click button A in calibration mode to restore factory defaults:
      • Leaf shutter: 3300
      • Focal-plane shutter: 3875

Default calibration notes:

Tips for Accurate Measurements

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.