Shoot 500...Keep 5 - The Hardpan Blog

DIY Pentax Wireless IR Lightning Activated Trigger Version 4 – Compact

DIY Pentax Wireless IR Lightning Activated Trigger Version 4 – Compact

 

 

This is a description of how I made my updated (version 4)  Compact Wireless Infrared Lightning Activated Trigger for a Pentax Digital SLR camera.


The majority of this lightning trigger is similar to the information on my earlier version (located here) .  This version is just much more compact, and there are no wires (completely contained).  This lightning activated trigger will easily fit into most camera bags, and will be easy to have with you for any storms that pop up, no matter where you might be.

This version includes 2 buttons to adjust the light sensitivity that activates the trigger.  As with my previous version, I built this for my Pentax camera that does not have a remote shutter trigger connection, so I needed to trigger the camera using an infrared (IR) signal.

 

 

Arduino -( The brain inside the machine)

For this project I am using a much smaller version of the Arduino board.  The smaller version is called Nano.  Below is a comparison image showing the standard size board on the left, and the smaller Nano on the right.

This smaller size allows me to build the entire trigger into a much smaller box.

Below is a comparison of two lightning activated triggers I have built.  On the left is the older version (3) and on the right is the new version (4) that uses the smaller board.

 

The program that Arduino runs on is open source and can be found here.  There is a great group of people sharing information in the Arduino forums, as well as a ton of information for other Arduino based controllers all over the internet. The program can be written using Windows, Mac OS X or Linux and is easily sent to the board using a USB cable.
Here is the basic setup showing the wiring from the Arduino board to both the input (I am using a photo transistor but you could use a photoresistor as well) and output (I am using an Infrared LED).

*** NOTES  – I am adding this note about the Input sensor and output LED, after I received a question from someone building this trigger:

If you are using the photo transistor from the link on my page (or an equivalent) for the light sensor, you will need to wire it backwards from a standard LED.  The shorter leg should connect to positive (+5v), and the longer leg should connect to 2 resistors that lead to: 1 (10k) to Ground & 1(100k) to senor pin 2.   You can change the value of the resistors to adjust the sensitivity as needed.  The original work, that lead me to build this, used 10k as the resistance for both connections to ground and pin 2.  Upping the resistance to pin 2 has increased the sensitivity for me.

 

For the output,  I use an LED as a test as well.  You may have to use a smaller resistor on the IR LED to get a stronger output signal if it isn’t working.  Just make sure to use at least enough resistance to keep from blowing the LED.  For the IR LED I used the longer leg to +, and the shorter leg to ground.

*********************************************

 

The code I used to activate the shutter is based on information I found on two web pages:

The input code is based on information from Maurice Ribble who makes the CameraAxe (a wonderful camera trigger for anyone who has a wired connection for the shutter trigger, and would rather purchase a complete trigger mechanism). The page I found that contained his early lightning trigger using Arduino is here.

For the output code, I needed to find someone with the IR signal information. I found a great site made by Sebastian Setz that contained IR signal code for several different camera brands. That site is here.

I took parts from both and combined them to make my Pentax version.

 

Code for Pentax.pde

/*******************************************
    *
    * Name.......: PentaxIRControl Lightning Activated Trigger
    * Description: A Lightning Activated Trigger to control Pentax cameras
    * via infrared (IR) wireless remote.
    * Author.....: Marc Kohlbauer
    * Version....: 4.0
    * Date.......: 2012-03-19
    * Project....: http://www.hardpan.com/category/arduino/
    * Contact....: marc@hardpan.com
    * License....: This work is licensed under the Creative Commons
    * Attribution-NonCommercial-ShareAlike 3.0 Unported License.
    * Keywords...: Arduino, library, camera, infrared, control,
    * Pentax, lightning, trigger, wireless, IR, sensor, adjustable
    * History....: 201-03-24 V1.0 - Pentax IR Control
    *
    ********************************************/

#define SHUTTER_PIN 9        //set the pin for ir signal to camera
#define LIGHTNING_TRIGGER_ANALOG_PIN 2        //set pin for sensor
#include <PentaxIRControl.h>

Pentax kr(9);    //rename ir signal pin to Pentax for program

int lightningVal;    //reading from sensor
int switchPin = 3;   // reduce sensitivity switch is connected to pin 3
int buttonState;     // variable to hold the button state
int val;             // variable for reading the pin status
int switch2Pin = 4;  // increase sensitivity switch is connected to pin 4
int button2State;    // variable to hold the button state
int val2;            //variable for reading the pin status

int TRIGGER_THRESHOLD = 20;  // base sensor adjustment after reset or power up

void setup()
{
pinMode(switchPin, INPUT);   //set the switch pin as input
pinMode(switch2Pin, INPUT);   //set the switch pin as input
pinMode(SHUTTER_PIN, OUTPUT);      //set the ir pin as output
digitalWrite(SHUTTER_PIN, LOW); //set the inital state of camera pin as off
buttonState = digitalRead(switchPin);   // read the initial state of reduce sensitivity button
button2State = digitalRead(switch2Pin);   // read the initial state of increase sensitivity button
lightningVal = analogRead(LIGHTNING_TRIGGER_ANALOG_PIN);  //read the initial state of light sensor
}

void loop()
{
val = digitalRead(switchPin);      // read input value and store it in val
val2 = digitalRead(switch2Pin);      // read input value and store it in val2

if (val != buttonState) {          // the decrease sensitivity button state has changed!
if (val == LOW) {                // check if the decrease sensitivity button is pressed
TRIGGER_THRESHOLD=TRIGGER_THRESHOLD+2;      // increment the decrease sensitivity variable for every time button is pushed
if (TRIGGER_THRESHOLD>150) TRIGGER_THRESHOLD=150;  // Set the maximum sensitivity value

}
}
buttonState = val;     // save the new state in our variable

if (val2 != button2State) {  // the increase sensitivity button state has changed!
if (val2 == LOW) {        // check if the increase sensitivity button is pressed
TRIGGER_THRESHOLD–;   // increment the increase sensitivity variable – one for every button push
if (TRIGGER_THRESHOLD<1) TRIGGER_THRESHOLD=1;  // Set the minimum sensitivity value of sensor
}
}
button2State = val2;   // save the new state in our variable

int cmd;
int newLightningVal = analogRead(LIGHTNING_TRIGGER_ANALOG_PIN);  //read the light sensor value

if ((newLightningVal – lightningVal) > TRIGGER_THRESHOLD) //if the new value of the light sensor is changed by more than the threshhold
{
kr.shutterNow();  //activate the camera
delay(500);

}

lightningVal = newLightningVal;  //reset the light sensitivity
}

============================================================================

end of code

 

The entire code I am using (base shown above) is here. It will work for any Pentax DSLR not just the K-r. All Pentax DSLR cameras use the same IR signal. You could also use this code and the information on the pages above to make an IR trigger for other brands of cameras. Please feel free to use and modify my code if it will work for you.

To use this code for your Pentax camera you will need to extract the PentaxLTv4.zip file and place the folder named PentaxLTv4 in the Libraries folder in your Arduino folder.

Building this on a breadboard is very easy. It isn’t much more work to solder the parts together and put it in a case that you can take with you. I was able to do this in an afternoon. If you can’t solder, find a friend that has some experience or practice until you are able to work with small components like these. Most of these parts are not expensive, but if you overheat them you will end up buying more replacement parts and it isn’t fun waiting for more parts to arrive.

I built mine into a small box I purchased at Radio Shack, and many small project boxes will work with a board this small.

 

Parts I used in this version are as follows:

(1) Arduino Nano – source

(1) photo transistor – source

(1) Infrared LED – source

(1) 9V Battery Connector – source – Also a 9V Battery for power when not connected to USB cable

(1) Blank Circuit Board for Input and Output Connections (Cut to size needed) – source

(1) On/Off Switch – source

(2) Push Buttons – source (several for $1.00)

(1) Project Box – source

(X) 47 Ohm Resistors – source

(X) 10k Ohm Resistors – source

(X) 100k Ohm Resistors – source

(X) Wire -Scraps recycled from old electronics – for this project I used some wires I took out of an old fax machine.

I also use a this piece of foam that I recycled from some packaging to keep the parts from moving inside the case, and keep the battery from making contact with the pins on the Arduino Nano board.

 

Here are some photos of the build:

 

I used a hot melt glue gun to mount the small piece of PCB board with the push buttons to the case.

 

I used epoxy to glue a small piece of aluminum to the bottom so the complete trigger can be mounted into the camera’s flash shoe.

 

And a few pictures of the lightning activated trigger mounted on my Pentax K100D:

 

And an example of why I built this trigger:

 

3

Discussion

  1. Brad  May 14, 2013

    Hi, I think there is a bug in the code above?
    if (TRIGGER_THRESHOLD int cmd;

    it looks as though the int cmd; should have been on the next line down, and that line should have read if (TRIGGER_THRESHOLD<0) //Guessing here, but it doesn't look right?

    (reply)
    • admin  May 14, 2013

      I think it was a bug in the HTML display on the page. Please download the actual program file to use for your trigger. The HTML version may not display correctly because of the way special characters change when entered as text. I have reset the page, and now I hope it will display the code correctly.

      (reply)

Add a Comment


+ six = 11