Good afternoon. Are there any passive and active ir sensor experts that could help me with understanding the codes that are required to build a remote system for my DSLR camera trap? Any help would be much appreciated as I'm a total beginner at this and I'm struggling with the codes, building the camera set up, waterproof housing, remote flashes is not a problem but I'm pulling my hair out with the arduino uno r3!
start at the Project Hub
I can't find anything in there sadly.
Do you have any idea what sensors you want to use? What have other similar projects used?
wildbill:
Do you have any idea what sensors you want to use? What have other similar projects used?
Will the code have to be different depending on what sensor you use? I was thinking it would be reading the signal from a sensor sent to a pin and then sending it on to another pin to operate the camera shutter? I have set up a quick wiring loop including a shutter release with a code from the Internet that works but the ir remains active which sets the camera off continuously, what I want is a delay of 1 to 2 minutes between each possible triggering so the camera goes to sleep.
mattgoodlife:
Will the code have to be different depending on what sensor you use?
Perhaps.
I was thinking it would be reading the signal from a sensor sent to a pin and then sending it on to another pin to operate the camera shutter?
It might well be that simple.
I have set up a quick wiring loop including a shutter release with a code from the Internet that works but the ir remains active which sets the camera off continuously, what I want is a delay of 1 to 2 minutes between each possible triggering so the camera goes to sleep.
The easy and dirty way is to use the delay function. Timing using millis is slightly more complex and may not be necessary here. Does the IR sensor eventually go inactive?
Post the code you have so far.
led is obviously my shutter.
int led = 13; // Define the LED as Pin 13
int sensor = 2; // Define the Sensor Connected to Pin 4
int state = LOW; // Motion Detection
int val = 0; // Store the value of sensor
void setup() {
pinMode(led, OUTPUT); // initialize the LED as the output
pinMode(sensor, INPUT); // initialize the sensor as the input
Serial.begin(9600); // Define the serial communication
}
void loop(){
val = digitalRead(sensor); // Reading the sensor value
if (val == HIGH) { // if sensor is high
digitalWrite(led, HIGH); // switch on the LED
delay(100); // 100 milliseconds delay
if (state == LOW) {
Serial.println("Motion was detected");
state = HIGH; // Update the variable state in to HIGH
}
}
else {
digitalWrite(led, LOW); // Turning off the LED
delay(200); // 200 milliseconds delay
if (state == HIGH){
Serial.println("Motion stopped!");
state = LOW; // update the variable state into LOW
}
}
}
wildbill:
Does the IR sensor eventually go inactive?
Yes but only for a matter of seconds.
mattgoodlife:
Yes but only for a matter of seconds.
It sounds like that's the first thing to solve then.
wildbill:
It sounds like that's the first thing to solve then.
Ok and how do I go about doing this?
What sensor do you have?
It looks like the jumper that sets trigger mode can help with repeated detection. How are you testing it? What do you think it's detecting - you?
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.