Jump to content
mattpatt

Timelapse Camera With Picaxe

Recommended Posts

Just thinking about the pix every 10 seconds:

 

How many pix's can you get on your memory card? 10 seconds is 360 pix's per hour. If there are about 10 hours of daylight, that's 3600 pixs per day!

 

a pix per minute is still 600 pixs in the 10 hours of daylight we ahve this time of year

 

just some thoughts

 

That's what I've been thinking about too. Not sure what the optimal interval between pics are for timelapse. But I see your point about the 10 second deal. Would be nice to be able to change the rate to several different ones out in the field instead of having to reprogram every time I want to change something.

If you run a push button with power to an input and during warmup "first 30 seconds cam is turned on" and press the button 1 2 or 3 times that increments a variable. Then just run three different if statements in your code like

warmup:

w1=300

do while w1<0

if pin3=1 then inc b1

w1=w1-1

loop

goto standby

 

standby:

if b1=1 then pause 10000 endif

if b1=2 then pause 30000 endif

if b1=3 then pause 50000 endif

then take pic

 

Thats the joy of picaxe you can really make it custom

Share this post


Link to post
Share on other sites
 

okay, I've done a little calculating and researching on the internet. Most movies are shot at 24-30fps. Here's the formula for determining what the timelapse interval should be so that your movie is smooth and not too choppy.

 

24fps * how long you want the movie to be in seconds = The number of frames you will need to capture

 

length of actual event DIVIDED by the number of frames needed = interval between shots in seconds.

 

 

Basically what it boils down to is that 10 second intervals will give me about a 2.5 minute finished timelapse movie for a 10 hour period. The problem here is the amount of frames needed is more than can be stored on a 4gb card @ 6 megapixels.

Share this post


Link to post
Share on other sites
 

2.5 minute move will require 3600 frames or pics

 

This is not doable on a 4gb card @ 6 megapixel however @ 3 megapixel it would work.

Share this post


Link to post
Share on other sites
 

another idea is to use a dip switch and have two modes. One mode could be scouting mode and you could have the cam turn on for the first four hours of light then turn off and turn back on for the last four hours of light. Obviously you could play around with these times as needed. Since deer are most active during the morning and evening hours you probably wouldn't miss much by not recording during the middle of the day. Then you could have another mode that would just do a set timelapse interval. Anyone else have ideas?

Share this post


Link to post
Share on other sites
 

OKay, I think I've settled down on the idea of recording just the morning and afternoon hours but I'm havin a hard time getting started on the code changes. I'm pretty sure I can do it with a do...loop and just have it count the number of times the loop executes to determine when to turn off. Let say I want to record for 4 hours in the morning, sleep 4 hours then record until dark. Taking pictures every 10 seconds would result in the loop needing to execute 1440 times in the morning. My brain is scrambled right now. Can someone point me in the right direction on this? Here's the code that I'm working with now...

 

'              SS Day Only Code Using LED for Light Detection
'        Original code by TCSCOUT modified my mattpatt for Time Lapse

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

'Walk test light will come on first, then the camera will power on for 5 seconds
'and turn off.  The Walk test light will turn off too. Then it will go to standby
'and wait for sufficient light to take a picture.  If it is dark (night) it 
'will pause for 5 minutes then go back to standby.  If it is light (day) it will go to 
'take_picture. There it will turn on the camera and check to see if the switch 
'is in Trail or Feeder Mode.  If in Trail it will take a picture and wait for 10 
'seconds then take anoter picture without powering off, It will keep doing this 
'until there is insufficient light then the camera will power off.  If in feeder 
'mode it will take a picture. power off and wait 60 second. After pausing it will 
'go back to standy to check to see if there is sufficient light.  If there is then it will go
'back to timelapse.  If there isn't enough light standby will loop.


'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

'disablebod...Disable brownout detection. see manual 2 for more details.
'.............This lets the chip run using less power for better battery life.

'high.........When you see this, it tells the editor we want the pin number
'.............that follows, to be an output pin, and we want it to be "on"

'low 0........This command tells the editor that we want this pin...pin 0
'.............to become an output, and we want it "off"

'pause........The lines below use the "pause" command.  This is a command
'............ that you will use a lot.  It simply tells the program to pause
'.............for a set amount of time. It is measured in thousands of a second.
'.............so, the "pause 1000 command below tells the program to pause for
'.............one second.  If you want it to pause for say 1/10th of a second,
'.............then you would use "pause 100",
'.............1/2 second would be "pause 500",
'.............1 minute would be "pause 60000" etc.
'.............You can use a number up to 65535 with the pause command;
'.............which would amount to 65.535 seconds.

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

  'These next few lines are just initially setting the pins how we want them.
low 4                'set the pin that controls the camera shutter to low
low 0                'set the pin that controls the camera power to low
'input 2              'let the picaxe chip know that pin2 (for the switch) will need'
                     'to be an input so we'll be able to  see if the switch is set to'
                     'trail or feeder.
input 3              'Pin 3 is kind of special and can only be used as an input,
                     'The picaxe chip knows that, so we don't really need to set it up,
                     'but we will anyway, just to help new guys know what is going on.
low 2                'set the LED pin to low to make sure the LED is OFF.
disablebod           'remember, this lets the chip run using less power (see above)
pause 3000           'wait for 3 seconds

'xxxxxxxxxxxxxxxxxxxxxxx WARM UP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

warmup:
high 2               'turn on LED to indicate warm-up mode
high 0               'push power on 
pause 1200           'holding power button for 1.2 seconds
low 0                'release power button
pause 3000
high 0
pause 1200
low 0
pause 3000            'pause 3 seconds
low 2                'turn LED off indicating warm-up has timed out
goto standby

'xxxxxxxxxxxxxxxxxxxxxxxxx CHECK LIGHT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

check_light:
Input 2            'set pin4 as input
Nap 4                'nap 4 seconds
Readadc 2 , B1        
Low 2
Poke $1f , 0
If B1 < 3 Then
pause 3000    
goto standby
Else 
high 0
pause 1200
low 0
pause 1000
goto take_picture                      
End If

'xxxxxxxxxxxxxxxxxxxxxxxxxx DARK xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

dark:
Input 2            'set pin4 as input
Nap 4                'nap 4 seconds
Readadc 2 , B1        
Low 2
Poke $1f , 0
If B1 < 3 Then
high 0
pause 1000
low 0
goto standby
Else 
goto take_picture                          
End If

'xxxxxxxxxxxxxxxxxxxxxxxxxxx STAND BY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

standby:
sleep 10
goto check_light

'xxxxxxxxxxxxxxxxxxxxxxxxxx TAKE PICTURE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

take_picture:
high 4              'push shutter
pause 1000          'holding the shutter button down for 1 second
low 4               'releasing the shutter button
goto time_delay     'goto time_delay

'xxxxxxxxxxxxxxxxxxxxxxxxx TIME DELAY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

time_delay:
wait 10              'wait for 10 seconds
goto dark            ' if dark camera will power off to save battery

Edited by mattpatt

Share this post


Link to post
Share on other sites
 

You may try this if your sequence would start in the morning you could do this, you need to know how long your day will be for proper sleep number, and you would need to reset b2 to 0 where ever you are waiting for daylight. You may also want to start using a CDS or LDR to get a more precise light level reading to start as soon as sun is rising, I do not know how accurate the led is? You will have to tweak code a bit but maybe this will give you a general idea to do what you wanted.

 

take_picture:
w1=0' reset pic count
do while w1<1440
high 4 'push shutter
pause 1000 'holding the shutter button down for 1 second
low 4 'releasing the shutter button
pause 10000' pause 10 seconds
inc w1'increments pic count
loop
turn cam off
if b2=1 then standby endif' stand by is where you are waiting for next morning
sleep 4260
turn cam on
b2=0'use b2 to know daylight sequence ran
inc b2
goto take_picture

Share this post


Link to post
Share on other sites
 
You may try this if your sequence would start in the morning you could do this, you need to know how long your day will be for proper sleep number, and you would need to reset b2 to 0 where ever you are waiting for daylight. You may also want to start using a CDS or LDR to get a more precise light level reading to start as soon as sun is rising, I do not know how accurate the led is? You will have to tweak code a bit but maybe this will give you a general idea to do what you wanted.

 

take_picture:
w1=0' reset pic count
do while w1<1440
high 4 'push shutter
pause 1000 'holding the shutter button down for 1 second
low 4 'releasing the shutter button
pause 10000' pause 10 seconds
inc w1'increments pic count
loop
turn cam off
if b2=1 then standby endif' stand by is where you are waiting for next morning
sleep 4260
turn cam on
b2=0'use b2 to know daylight sequence ran
inc b2
goto take_picture

 

Thanks! That should get me going in the right direction. I was just setting here thinking about something else though. This isn't going to be something I'm going to be able to leave out at a weeks time no matter how we do the programming. The biggest limitation is the Nikon L11 that I'm using only accepts up to 4GB SD cards. If it would take a 8GB card all this would be a mute point and you could let it run all day then go retrieve the camera. As it is right now I could set it to 3mp and get a whole days worth of pics on a 4gb SD card assuming a 10 hour record window. The plot I am planning on watching isn't that big so 3mp would probably suffice plus when doing this type of scouting you're not really looking for high resolution detail of the deer. To me, where something like this shines is its ability to identfy where the deer are entering the exiting the area so you can determine the best strategy for stand placement.

 

Share this post


Link to post
Share on other sites
 

I recently purchased one of these ChronoDot for a different project I'm working on. It's an accurate real time clock that interfaces with the 20x2 using 2 pins. It might be a little overkill, but would allow you to take pics at a specific time rather than relying on the picaxe timer or a day/night sensing circuit.

Edited by smclark

Share this post


Link to post
Share on other sites
 
I recently purchased one of these ChronoDot for a different project I'm working on. It's an accurate real time clock that interfaces with the 20x2 using 2 pins. It might be a little overkill, but would allow you to take pics at a specific time rather than relying on the picaxe timer or a day/night sensing circuit.

 

At this point I don't think anything is overkill. :-) Thanks for letting me know about this. Is there some documentation somewhere that explains more how it interfaces with the 20x2?

Share this post


Link to post
Share on other sites
 
 

Thanks guys. Looks like I have alot of reading to do. On a side note... I put the cam out in the back yard this morning. This will be the first time I've tested it for an extended period of time. Maybe I'll have some sort of video to show this afternoon.

Share this post


Link to post
Share on other sites
 

Here is a link to the picaxe I2C tutorial pdf Link The clock uses this interface. Look at the info for the DS1307 which works identical to the chip on the chronodot.

Share this post


Link to post
Share on other sites
 

I just did some reading on that link scott and thats pretty slick. I may have to order me in one of those to play with.

Edited by bowgod02

Share this post


Link to post
Share on other sites
 
Here is a link to the picaxe I2C tutorial pdf Link The clock uses this interface. Look at the info for the DS1307 which works identical to the chip on the chronodot.

 

 

WOW! That's pretty neat and would make for a very accurate and adjustable time source.

Share this post


Link to post
Share on other sites
 
Here is a link to the picaxe I2C tutorial pdf Link The clock uses this interface. Look at the info for the DS1307 which works identical to the chip on the chronodot.

 

Scott,

 

Would there be a way to adapt a chronodot to work with your AIO board? :-)

Share this post


Link to post
Share on other sites
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×