Project tutorial
Capturing The Water Drops With Arduino

Capturing The Water Drops With Arduino © MIT

Make your first high-speed photos of water drops with an Arduino.

  • 3,097 views
  • 7 comments
  • 5 respects

Components and supplies

Apps and online services

About this project

This project was born as a result of a longing for trying this area of photography. Below you will see a simple Arduino-based setup I built to make high-speed photos of water drops.

First of all you should have a photocamera with manual settings and an external flash light, both of them must support remote control. I have Sony DSC-HX300 (Fig. 1) and GODOX SY8000 (Fig. 2) with cables.

In Fig. 2 one can see two Arduino wires carefully insulated and attached to the PC-connector of the SyncCable.

I decided to modify the remote control by adding a simple 3-pin header (Fig. 3).

Inside the remote control (Fig. 4) there are three springy metal strips (1 – «+» of the shutter; 2 – GND; 3 – «+» of the autofocus) which short out two circuits («2–3», then «1–2») when the button is being pressed.

Since the pin header is now installed we can emulate the button press programmatically using Arduino.

The SyncCable works in the same way: the contacts in the PC-connector have to be shorted out to fire the flash.

My goal was to capture the moment of splash when a drop falls onto the water surface.

To simplify the setup I used some parts of a medicine dropper assembled together (Fig. 5).

The laser module KY-008 and the LM393-based light sensor module will detect the drop falling (Fig. 6).

It is possible to arrange these modules in such a way that the falling drop will interrupt the laser beam thus breaking the circuit. The light sensor is capable of adjusting its sensitivity to the laser power by rotating the variable resistor on the module. Additionally, the modules can be positioned at a long distance from each other.

The shooting is conducted in the darkness using long exposure for several seconds so that only short-time flash light matters for the final results.

The circuit diagram is shown in Fig. 7.

The setup is not fully automated. Before the observable drop separation the user presses the Button. This opens the shutter for a few seconds through shortening out the contacts consecutively in the remote control by Autofocus Trigger and Shutter Trigger. Also the Button press allows firing the flash light. When the drop crosses the laser beam the Flash Light Trigger shorts out the contacts in the PC-connector and the flash light fires. The time between crossing the laser beam and shortening out the contacts in SyncCable is adjusted by the Potentiometer in a range from 1 to 500 ms. (limits can be changed in the code). In this way, different moments of the splash can be captured. Next drops do not fire the flash light: to activate this function the Button has to be pressed again.

The assembly is shown in Fig. 8.

An optical coupler can be added in the circuit above to separate the high-voltage flash light from low-voltage electronics.

The main code parameters are shown in Fig. 9. The project is based on Arduino Nano.

The flag «DBG_MODE» is intended for the preliminary arrangement and adjustment of both the laser module and the light sensor module. In this mode, neither the camera nor the flash light is used. The Arduino board built-in LED serves as an indicator.

To adjust the setup uncomment the flag, compile the code and flash the Arduino. If the setup is correct, the LED goes ON when the Button is pressed (shutter simulation) and goes OFF when a drop crosses the laser beam (flash light firing simulation).

When the setup works well comment the flag back, compile the code and flash the Arduino again.

The code also contains following constants:

· Arduino pins to which the components of this project are connected;

· delays applied when the contacts of autofocus, shutter or flash light are being shorted out;

· limits of the time range adjustable by the Potentiometer.

Some results are shown in Fig. 10 – 12.


Code

Untitled fileArduino
//#define DBG_MODE

const byte BUTTON_PIN = 2;
const byte FOCUS_PIN = 3;
const byte SHUTTER_PIN = 4;
const byte FLASH_PIN = 5;
const byte SENSOR_PIN = 6;
const byte RESISTOR_PIN = A5;

const unsigned int FOCUS_DELAY = 100;
const unsigned int SHUTTER_DELAY = 100;
const unsigned int FLASH_DELAY = 10;

const unsigned int FIRE_DELAY_MIN = 1;
const unsigned int FIRE_DELAY_MAX = 500;

boolean prevButton, currButton;
boolean prevSensor, currSensor;
boolean allowFlash;
unsigned long fireDelay;

void openShutter() {
  #ifndef DBG_MODE
    digitalWrite(FOCUS_PIN, HIGH);
    delay(FOCUS_DELAY);
    digitalWrite(SHUTTER_PIN, HIGH);
    delay(SHUTTER_DELAY);
    digitalWrite(SHUTTER_PIN, LOW);
    delay(FOCUS_DELAY);
    digitalWrite(FOCUS_PIN, LOW);
  #else
    digitalWrite(LED_BUILTIN, HIGH);
  #endif
}

void fireFlash() {
  #ifndef DBG_MODE
    digitalWrite(FLASH_PIN, HIGH);
    delay(FLASH_DELAY);
    digitalWrite(FLASH_PIN, LOW);
  #else
    digitalWrite(LED_BUILTIN, LOW);
  #endif    
}

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pinMode(FOCUS_PIN, OUTPUT);
  pinMode(SHUTTER_PIN, OUTPUT);
  pinMode(FLASH_PIN, OUTPUT);
  pinMode(SENSOR_PIN, INPUT);
  
  #ifdef DBG_MODE
    pinMode(LED_BUILTIN, OUTPUT);
  #endif
  
  
  digitalWrite(FOCUS_PIN, LOW);
  digitalWrite(SHUTTER_PIN, LOW);
  digitalWrite(FLASH_PIN, LOW);

  prevButton = digitalRead(BUTTON_PIN);
  prevSensor = digitalRead(SENSOR_PIN);
  allowFlash = false;
}

void loop() {
  currButton = digitalRead(BUTTON_PIN);
  if (prevButton != currButton) {
    prevButton = currButton;
    if (currButton == LOW) {
      allowFlash = true;
      prevSensor = HIGH;
      fireDelay = map(analogRead(RESISTOR_PIN), 0, 1023, FIRE_DELAY_MIN, FIRE_DELAY_MAX);
      openShutter();
    }
    else {
      delay(50);
    }
  }

  currSensor = digitalRead(SENSOR_PIN);
  if (prevSensor != currSensor) {
    prevSensor = currSensor;
    if (currSensor == HIGH) {
      if (allowFlash) {
        allowFlash = false;
        delay(fireDelay);
        fireFlash();
      }
    } 
  }
}  

Schematics

7_-_circuit_en_Tdr3x4foaz.png
7   circuit en tdr3x4foaz

Comments

Similar projects you might like

Motion Sensor Water Gun

Project tutorial by Team Engineering Is Easy

  • 20,566 views
  • 6 comments
  • 37 respects

Arduino Plant Water Management System w/ BME280

Project tutorial by Kutluhan Aktar

  • 9,919 views
  • 1 comment
  • 15 respects

COVID - 19 Automatic Water Tap

Project tutorial by Akshay Joseph

  • 12,472 views
  • 1 comment
  • 25 respects

Automatic Pet Water Chiller

Project tutorial by Mitomon

  • 3,560 views
  • 0 comments
  • 9 respects

Arduino Control AC Water Heater temperature

Project tutorial by Mohannad Rawashdeh

  • 24,130 views
  • 0 comments
  • 11 respects

Easy IOT Water Leakage Indicator

Project tutorial by Patel Darshil

  • 23,716 views
  • 3 comments
  • 21 respects
Add projectSign up / Login