How to build a Bluetooth controlled Photogate for high Speed photography

This tutorial will show you how to build a automated Bluetooth controlled trigger for high speed photography.

Parts List:

#affiliate links#

PVC Pipe

Conduit Body

ARDUINO

5 volt regulator

optocouplers

photo interrupter

IR led

IR transistor

led’s or flashlight

2N2222 transistors

resistors

speaker

capacitors

HC-06 or HC05 Bluetooth board

breadboard

jumper wires

power connector

RCA plugs

RCA wires

camera and flash cables

camera handlebar mount

Schematic:

The APP:

Click here to download the app

ARDUINO Code:

int fdel = 0; //flash trigger delay
int camb = 0; //camera bulb time
#define camt 10 //camera trigger pin
#define flash 8 //flash trigger pin
#define irLed 12 //ir led
int x = 0; //while loop hold
int irt; //ir transistor value
int irTrigger = 0; // flash trigger threshold
#define relay 9

void setup() {

Serial.begin(9600);
pinMode(irLed, OUTPUT);
pinMode(camt, OUTPUT);
pinMode(flash, OUTPUT);
digitalWrite(irLed, HIGH);
pinMode(relay, OUTPUT);

}

void loop()

{
digitalWrite(camt, LOW);
digitalWrite(relay, HIGH);
//////////check for input//////////
if (Serial.available() >= 2 )
{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;

//////camera triger stage//////
if (val == 99)
{
int camb1 = camb * 475;
digitalWrite(relay, LOW);
delay(500);
digitalWrite(camt, HIGH); //open camera shutter
delay(250);
tone(3, 500, 1000);
for (int x = 0; x < camb1; x++) // hold for ir threshold to be triggered
{
delay(2);
irt = analogRead(A0); //read ir transistor
if (irt < irTrigger) // triger the flash
{
delay(fdel);
digitalWrite(flash, HIGH);
delay(5);
digitalWrite(flash, LOW);
delay(100);
digitalWrite(camt, LOW);
delay(1000);
digitalWrite(relay, HIGH);
return;
}
}
}

////////// changing variables//////////
/////flash delay/////
else if (val <= 3000 && val >= 2000)
{
fdel = val – 2000;

}

/////camera bulb time/////
else if (val >= 10 && val <= 60)
{

camb = val;
}
/////IR TRIGGER/////
else if (val >= 100 && val <= 999)
{
irTrigger = val;

}
////ir trigger monitor////
else if (val == 95)
{
x = 0;
while (x == 0)
{
if (Serial.available() >= 2 )

{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;
if (val == 90)
{

x = 1;
}
}
irt = analogRead(A0); //read ir transistor
Serial.println(irt);
delay(250);
}
}
}
}