Pages: [1]   Go Down
Author Topic: Timelapse with Arduino? (several days)  (Read 2569 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I want to make a timelapse Video of a growing Plant in the forest.
Therefore I wanted to hack a cheap (Foto-)Camera to control it with the Arduino.
All in all I would leave the whole stuff three days in the forest.

Has anybody experience with timelapse videos (and Arduino)?

Thank you for your answers!

Ps: I haven't workt with a microcontroller yet.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sounds like very doable:

point of attention is moisture, and do you want to make pictures in the dark? Flash?

What is the time between two photos you have in mind?

The "blink without delay" example gives you the framework of the code you need.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to take pictures in the dark with a led-light.
I thought of a picture every 30min.
Maybe shorter.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Here some code to get started. It has 2 constants the PHOTOINTERVAL and PULSELENGTH.
PHOTOINTERVAL  is the time between snapshots.
PULSELENGTH is the time defining the length of the pulse for the camera.

You can test the sketch by connecting a LED to pin 7
Code:
unsigned long time = 0;
unsigned long lastpulse = 0;
unsigned long lastblink = 0;

#define PULSEPIN  7
#define PHOTOINTERVAL (30 * 60 * 1000UL)    // 30 minutes in milliseconds
#define PULSELENGTH 100UL                        // pulse for camera, in milliseconds, must be shorter than PHOTOINTERVAL

void setup()
{
  // serial is not really needed but always handy while tinkering :)
  Serial.begin(9600);
  Serial.println("Photo interval 0.1");

  pinMode(PULSEPIN, OUTPUT);
  pinMode(13, OUTPUT);                 // on board led for "alive" blink
}

void loop()
{
  time = millis();
  // time to start a new photo?
  if (time - lastpulse > PHOTOINTERVAL)
  {
    lastpulse = time;
    digitalWrite(PULSEPIN, HIGH);
  }
  if ((time - lastpulse >= PULSELENGTH) && (digitalRead(PULSEPIN) == HIGH))
  {
    digitalWrite(PULSEPIN, LOW);
  }

  // blink onboard led to show sketch is still alive
  if (time - lastblink > 1000)  // fixed interval
  {
    lastblink = time;
    digitalWrite(13, !digitalRead(13));
  }
}
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the code!

In a few days I'll get my own Arduino.
Then I'll look for your code and test it.
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 50
Posts: 2217
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A frame every 30 mins = 48 shots per day at normal play back of 24 frames per sec that's only 2 secs worth per day.

Mark
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

indeed 2 seconds,
One could also do a sort of auto-morphing between the images like some screen savers do. Or just increase the #shots smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Haverhill, Ma
Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hacked a Vivicam 46 camera for a motion sensor camera project. I picked it up at walmart for $19. The only drawback is it doesnt have a flash. If you can solder, it's an easy hack. Here's a pic and some instructions to help.



Uploaded with ImageShack.us

Open the camera and locate the power and shutter buttons. The board should look similar to the image above. You will be soldering wires to the solder points labeled A,B,C, and D. Unforunately, I dont remember which solder point controls which button but I do remember "A" and "B" were one button and "C" and "D" was the other button. To figure out which is which, with the batteries out of the camera, place a continuity meter on points "A" and "B" and press one of the buttons. Do the same for points "C" and "D".

I used a couple opto-isolators to trigger the buttons.

Hope this helped.
Logged

Pages: [1]   Go Up
Jump to: