My high speed photography project for water drops ect, is comming along very nicely so here what i have done so far.
With the Arduino Duemilanove i'm controlling a: Solenoid valve, Photogate, Flash and my Camera.
Works like this:
open shutter on camera
a delay control the drops from the solenoid valve
a photogate waits for the drop the pass the gate
after a delay the flash get fired and the picture is taken.
Here is the schematic for it, this is the first time i have drawn a schmatic so there might be some error in it:
And the code:
int buttonPin = 2; // Connection to the Button
int solenoidPin = 8; // Connection to the Solenoid valve
int flashPin = 9; // Connection to the Flash
int cameraPin = 10; // Connection to the Camera
int photogatePin =11; // Connection to the Photogate
int varloop = 0; // Check variable for Photogate
int val = 0; // Variable for checking if something has passed through the photogate
int bval = 0; // Variable for checking is button is pressed
int flashTimer = 212; // Delay before flash is fired ----- Millisecond
// int flashTimer_micro = 500; // Delay before flash is fired ----- Microsecond (1000 = 1 milisecond)
int solenoidDelay = 250; // Delay for the Solenoid vale, determinds how many drops are dropped
int cameraDelay = 250;
void setup(){
pinMode(cameraPin, OUTPUT);
pinMode(solenoidPin, OUTPUT);
pinMode(flashPin, OUTPUT);
pinMode(photogatePin, INPUT);
pinMode(buttonPin, INPUT);
}
void loop(){
bval = digitalRead(buttonPin);
if (bval == HIGH){
varloop = 0;
} else {
openShutter();
dropWater();
while(varloop != 1){
detectFlash();
}
varloop = 0;
}
}
int openShutter(){
digitalWrite(cameraPin, HIGH);
delay(cameraDelay);
digitalWrite(cameraPin, LOW);
}
int dropWater(){
digitalWrite(solenoidPin, HIGH);
delay(solenoidDelay);
digitalWrite(solenoidPin, LOW);
}
int detectFlash(){
val = digitalRead(photogatePin);
if (val == HIGH) {
delay(flashTimer);
// delay(flashTimer_micro);
digitalWrite(flashPin, HIGH);
delay(50);
digitalWrite(flashPin, LOW);
delay(500);
varloop = 1;
}
}
you should try something similar with balloon popping... just replace the solenoid with a linear actuator attached to a needle... and you wont even need the photogate
One thing I was wondering about though. You have the photogate, so why go to the trouble of the solenoid? When I did this, I used a laboratory burette to give me a slow stream of nice fat drops.
To control how fast the drops are moveing, i need about 10 drops a sec to get the drops.I have the solenoid connected to a Mariotte Siphon (http://www.martin-waugh.com/?p=19 )so i get a steady stream of drops af the precise speed i want.
Hi Jens , I am a little confused (not difficult) over the Mariotte Siphon and the solenoid set up , If the solenoid is normally closed and fixed to the outlet of the Siphon , wouldn't the drops just sit behind the solenoid valve and build up. Then once released just drop in one spurt.
Also I am not really into code is this a one shot operation or does the button switch start the process
Yes the are a fixed pressure behind the solenoid valve, but i only open the solenoid valve for a very short time 75-250 micro sec, to control how many drops the solenoid valve will release, the height of the marion siphon depends how much pressure, thus determining the drop rate.
Yes the button starts the whole process.
I don't have a photo of the setup, i have just taken it down, but i will set it up again in a couple of days , then i will take a photo and post it
Thanks Jens , I made the Hi-viz set-up and that works quite well but when trying to get a collision it was like a disco in here the flash going off every 500 milliseconds lol
I hot the picture now (forgive the pun) just waiting for my solenoid to arrive , then get down to business
Me again Jens , looking at the schematic have you made a mistake with the LTV816 , the anode is going to ground on the diode pins , or am I having a blonde moment
Me again Jens , looking at the schematic have you made a mistake with the LTV816 , the anode is going to ground on the diode pins , or am I having a blonde moment
Barry you are right i have made a mistake i have them switch around, the line that goes to the GND should to to arduino and the line with the resistor should go to GND
To avoid massive flash fire you can change the reset delay on the kit, the assemble instructions will tell you how.
I'm building something similair. what do you mean by a photogate? an led + phototransistor pair? will water passing through it trigger it? (never tried it before..
Thank you for the photo and the valve info.
The only valves which i have found are this: First Sensor - Deutsche Homepage
I sent mail with an inquiry over prices and availability, but i have no answer received at this time.
Currently i use a analog control (with 555 timer IC) with an IR gate and 3 Vivitar 283 flashes. I start the drops manually with pipette.
Images made with this setting: MF Fotogalerie