Go Down

Topic: Solenoid and Camera Shutter (Read 435 times) previous topic - next topic

bharadwajrv

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


Code: [Select]

#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]

travis_farmer

#1
Jun 19, 2018, 12:45 am Last Edit: Jun 19, 2018, 12:48 am by travis_farmer
what kind of camera? some have a two-stage remote input. first stage to trigger focus, second to trigger shutter. I know if i want to trigger my Cannon T2i/550D, it must have the two-stage input.

also, pictures of a breadboard circuit are hard to decipher. perhaps at least a hand-drawn schematic?

~Travis

ChrisTenone

#2
Jun 19, 2018, 09:43 am Last Edit: Jun 19, 2018, 09:45 am by ChrisTenone
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?
I don't got to show you no stinkin' signature.

MorganS

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.
"The problem is in the code you didn't post."

bharadwajrv

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

MorganS

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.
"The problem is in the code you didn't post."

el_supremo

#6
Jun 19, 2018, 10:36 pm Last Edit: Jun 19, 2018, 10:40 pm by el_supremo
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
Don't send me technical questions via Private Message.

bharadwajrv

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)



 

ChrisTenone

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.
I don't got to show you no stinkin' signature.

travis_farmer

are you triggering the focus and shutter at the same time? try connecting the focus right to ground, and trigger just the shutter.

i can't find it, but somewhere i found a DIY tip for my Cannon T2i that stated the focus must connect before the shutter, in order for the camera to work.
as for the 3 volt supply for the camera, not sure about yours, but mine is active low signals.



the remote inputs should already be pulled high internally with pull-up resistors. without the arduino, try holding the focus to the remote connector ground (shield), then momentarily touch the shutter to ground (shield).

~Travis

bharadwajrv

Hi.

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

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
Code: [Select]

//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
Code: [Select]

//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]

el_supremo

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
Don't send me technical questions via Private Message.

bharadwajrv

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

el_supremo

Quote
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
Don't send me technical questions via Private Message.

el_supremo

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
Don't send me technical questions via Private Message.

Go Up