Solenoid and Camera Shutter

Solenoid with Camera trigger

i’m working to build a solenoid control along with camera shutter release control. before i connect camera, i’m using the LED bulb to test the circuit.

I’m using 4n26 optocoupler to isolate the circuit.

Solenoid is working correctly, but not triggering the camera

Error:
When Led bulb is connected, light blinks but when it is replaced with camera shutter cable, no activity in camera - so dont know what/where is wrong - any lead to fix this much appreciate

if i use this cable with shutter release device it is working.. (no cable and camera works !)

things i have tried..

  1. Swapped +/- wires for camera shutter
  2. replaced bulb, optocoupler
  3. checked 3v battery is working and when bulb connected directly it is working
#include <Math.h>

int solenoidPin = 4;    //This is the output pin on the Arduino we are using
int opto = 8;

int drop_duration = 00;
int drop_Interval_delay = 500;

int potPin1 = A0;
int potPin2 = A2;

int PotentioValue = 0;

void setup() {
  pinMode(solenoidPin, OUTPUT);           //Sets the pin as an output
  pinMode(potPin1, INPUT);
  pinMode(potPin2, INPUT);
  pinMode(opto, OUTPUT);
  
  Serial.begin(9600);
}

void loop() {



  int dropValue = analogRead(potPin1);
  drop_duration = ceil(dropValue/ 50) * 50;  //around to multiple of 50
  if (drop_duration == 0)
    drop_duration = 50;

  int IntValue = analogRead(potPin2);
  drop_Interval_delay = ceil(IntValue/ 50) * 50; //around to multiple of 50
  if (drop_Interval_delay==0)
    drop_Interval_delay = 50;

  Serial.print("Drop : ");
  Serial.println(drop_duration);
  
  Serial.print("Interval : ");
  Serial.println(drop_Interval_delay);
  

    
  
/*  Solenoid Code
 *   ================================================================================= */
  
  // put your main code here, to run repeatedly:
  digitalWrite(solenoidPin, HIGH);    //Switch Solenoid ON
  delay(drop_duration);                     
  digitalWrite(opto, HIGH);  //open the shutter
  
  digitalWrite(solenoidPin, LOW);     //Switch Solenoid OFF
  digitalWrite(opto, LOW); //close the shutter
  
  delay(drop_Interval_delay);              
  //================================================================================= 
  
}

[code]

Are you using the solenoid to push a button - either on the camera or on a camera remote device? I suspect that either the connection between the solenoid and the camera is faulty, or that the solenoid is not in fact, working.

Your pictures show neither the camera nor the solenoid, so that part is a mystery. As travis asked, can you provide a schematic of your circuit as well?

How are you powering it? A solenoid needs more current than the USB plug on your computer can provide.

Servos are often better for this than solenoids. You learn about solenoids in physics class at school but it turns out that they are so inefficient that it's rare to see one in real usage, such as pushing a button.

Here is response all above queries and the sketch of the breadboard.

[1] I'm using Canon 5D camera. i have tried in both Autofocus and manual mode.

[2] i have 3.55m jack connect to breadboard and i'm using N3 cable to connect this and camera.

[3] if i replace 3.5mm jack with LED bulb i can see bulb flashing.. (so working as per the code)

[4] There is no push button, i have written basic code to trigger Solenoid valve based on the potentiometer input as soon as it is powered

[5] i have AC to 12V DC convert plug which powers the Arduino board (Solenoid value requires 12v power)

please let me know what is the mistake here. thanks for your time and support

Your F**ing diagram shows a 3V battery and a 12V solenoid. Even worse, you show a TIP120 darlington transistor, which will need almost 3V to turn on, leaving nothing for the solenoid.

What does the solenoid do?

Have you tested the camera shutter works with just a piece of wire jumping the terminals on the 3.5mm plug? You probably need to join the two active pins together - the camera won't take a photo if you ground the shutter wire without also grounding the pre-focus wire.

What is the solenoid supposed to do? As far as I can see, it isn't needed to control the camera at all.
You really need to be careful with the 12V supply. If that is connected to your camera you can kiss the camera goodbye.

As far as the connection to the 5D is concerned, I assume that it is the same as a 50D. In which case, you should have two connections to the 5D, plus ground, on a stereo plug. The tip is the shutter, the ring is the focus, and the barrel is the ground. This page has a couple of good diagrams of the connections.
You do not need the 3V battery - it might even be preventing the focus and shutter from working. All you need to do to fire the shutter or focus is to ground their connection to the barrel.
When you use the N3, as you press the button, a connection inside first grounds the focus connection. As you press further it also grounds the shutter connection. You just need to simulate that with two digital pins.
It's best to have two optocouplers. One for shutter and one for focus. I have (I hope) attached a diagram of how I set up my 50D with two different kinds of optocoupler (which were all I had at the time).


The TIL119 was enough to drive the Focus on its own but the 4N28 couldn't manage it. I added a 2N2222 (Q1) to provide extra drive and that works fine.
A 4N26 will probably be able to drive Focus or Shutter. It appears that you are using 220ohm resistors which ought to be sufficient.

Pete

i'm very new of this area and this is my first project... if there is any school-boy mistake, my apologies.. please let me know

@MorganS, @el_supremo

thanks for your response.

As described in my diagram, there is separate 12V DC connected to board, which will power solenoid. i have tested solenoid connection and it is working as required.

To avoid any power surge and damaging the camera, i'm using optocoupler to separate the solenoid circuit from Shutter release circuit. Shutter release circuit has its own 3V power supply as required for camera.

As soon as Solenoid is powered, it drops water and at the same time, i'm trying to power the optocoupler via Digital Input PIN #8..

Solenoid circuit is working but i shutter release circuit is not working.

Re shutter release circuit, tested independently and not working... if i replace N3 cable connection with a LED bulb, it flashes.. so i reckon connection is ok to bulb, but something missing for camera release.

Also ground the shutter wire and the pre-focus wire - no joy.

if i remove 3V battery from shutter circuit, as there is no power to circuit, no activities there (checked with leb bulb and it is not flashing)

Ah. You are dropping water into a bowl of still water in order to photograph the drop effect. It's a novel approach, I've seen it done with Nikons using a motion sensor and the cls strobe system. But that's off the shelf, and this is ... well, Arduino!

Might it be better if the microprocessor activates the solenoid independent (ieon another pin) of the shutter release? With an adjustable delay, you'd have a lot more control over the final image.

Hi.

to isolate the problem, i created the shutter release circuit only (removed solenoid circuit) - and managed to get this working :slight_smile: and with below code, camera shutter triggered every 0.5sec :slight_smile:

But when both Solenoid circuit and camera shutter circuit is merged, it is not working.. Solenoid is working fine, but camera shutter release is not working..

(camera shutter works on its own, but not when merged with solenoid circuit).

i'm not sure, where i'm going wrong with both solenoid and camera shutter release circuit, any help, direction is really much appreciated

Camera Shutter release

//Camera shutter release
void loop() {

  digitalWrite(opto, HIGH);  //open the shutter
  delay(500);  
  digitalWrite(opto, LOW); //close the shutter
  
  delay(2000);              
  //================================================================
}

Solenoid and Shutter release

//Solenoid and Shutter release code

#include <Math.h>

int solenoidPin = 4;    //This is the output pin on the Arduino we are using
int opto = 8;

int drop_duration = 00;
int drop_Interval_delay = 500;

int potPin1 = A0;
int potPin2 = A2;

int PotentioValue = 0;

void setup() {
  pinMode(solenoidPin, OUTPUT);           //Sets the pin as an output
  pinMode(potPin1, INPUT);
  pinMode(potPin2, INPUT);
  pinMode(opto, OUTPUT);
  
  Serial.begin(9600);
}

void loop() {



  int dropValue = analogRead(potPin1);
  drop_duration = ceil(dropValue/ 50) * 50;  //around to multiple of 50
  if (drop_duration == 0)
    drop_duration = 50;

  int IntValue = analogRead(potPin2);
  drop_Interval_delay = ceil(IntValue/ 50) * 50; //around to multiple of 50
  if (drop_Interval_delay==0)
    drop_Interval_delay = 50;

  Serial.print("Drop : ");
  Serial.println(drop_duration);
  
  Serial.print("Interval : ");
  Serial.println(drop_Interval_delay);
  

    
  
/*  Solenoid Code
 *   ================================================================================= */
  
  // put your main code here, to run repeatedly:
  digitalWrite(solenoidPin, HIGH);    //Switch Solenoid ON
  delay(drop_duration);                     
  digitalWrite(opto, HIGH);  //open the shutter
  
  digitalWrite(solenoidPin, LOW);     //Switch Solenoid OFF
  digitalWrite(opto, LOW); //close the shutter
  
  delay(drop_Interval_delay);              
  //================================================================================= 
  
}

[code]

You still have the 3V battery in the circuit. It shouldn't be there. Wire the stereo plug as I showed in message #6. If you only have one optocoupler, connect the focus to camera ground.

Pete

Hi Pete

i have amended the circuit to ground both focus and shutter - new circuit is detailed in message #10.

if 3v battery is disconnected from optocoupler circuit, then there won't be any power to trigger the shutter which requires 3v

there won't be any power to trigger the shutter which requires 3v

Do you have documentation for your camera which says it requires 3V? All the Canon cameras I have used and read about have an open collector which only requires that the focus or shutter contact be grounded. That is what the N3 does - it does not have a 3V battery in it.

Pete

If I read your fritzing diagram correctly, all your circuit does as far as the 3V battery is concerned is to short it through a 100 ohm resistor. It has absolutely no effect on the camera.
The focus and shutter pins are both connected to the collector of the 4N26 which would try to ground them simultaneously if the 4N26 has enough drive at the input. As has been pointed out, you should ground the focus before the shutter.
The circuit that I made (shown in #6), originally for my 10D and now for my 50D, grounds the focus 25 milliseconds before grounding the shutter.

Pete

Have a look at www.dropcontroller.com. The circuit should give you some pointers.

Thanks Pete. it is fixed now..

i had two issues

[1] As you have rightly said, 3v battery is not required and it just required grounding.

[2] Also, had a code issue, where i was opening and closing the shutter immediately.. but introduced a "delay" after opening the shutter and it is working as required.

thanks for your help.. really appreciate it.

Old code

  digitalWrite(solenoidPin, HIGH);    //Switch Solenoid ON
  delay(drop_duration);                     
  digitalWrite(opto, HIGH);  //open the shutter
  
  digitalWrite(solenoidPin, LOW);     //Switch Solenoid OFF
  digitalWrite(opto, LOW); //close the shutter

new code

   digitalWrite(solenoidPin, HIGH);    //Switch Solenoid ON
   delay(drop_duration);                     
   digitalWrite(opto, HIGH);  //open the shutter
  
   delay(150);  // addicting delay so that, camera shutter is grounded and it fires...

   digitalWrite(solenoidPin, LOW);     //Switch Solenoid OFF
   digitalWrite(opto, LOW); //close the shutter