I couldn't think of the right title to call this...sorry..but I'll try to explain. I have a video camera connected to a RF video unit. I have a RF remote PIR that, when motion is seen, sends a signal to a receiver connected to a Picaxe 08M. This 08M turns on the camera and transmitter, sending the video to my house. This has been working very well, and I owe that to the Picaxe... and to you guys for all the help educating me on its use. This camera set-up is battery powered, and until now, a 5 watt solar panel was enough to keep its battery up.
But....I moved the camera to another location, watching over a deer feeder filled with corn. I'm thinking I will get to watch turkeys...wild hog...maybe even a deer. NOPE...not so far...so far, I have been getting tons of bird videos, and squirrels attacking the feeder motor to make more corn fall out. At night I'm getting probably 6 hours of raccoons camping under the feeder. OH....I had always blamed feeder damage on squirrels. They do hang on the timer/motor, but that's not what keeps messing them up I bet. These coons must weigh 20~30 lbs, and they hang on the motor two at a time sometimes!
Anyway, I want/need to limit the time the camera is on....over a certain period of time. I know a little more now, so I can do the simple stuff, but I'm looking for ideas on something that seems more of a challenge. I don't want to change the code too much, because I like the way it is working, but I want to have it where it will keep from running the battery down in one night.
Here is what I have in mind to do, but haven't come up with the HOW. I think I would keep track of the events received from the remote PIR unit, and if it exceeds soooo many in, maybe, 30 minutes, then I need to give the battery a break.
Here is what I have so far, please excuse the lack of comments for now, but it is pretty simple. I can also turn the camera on with my hand held,that part is fine.
But....I moved the camera to another location, watching over a deer feeder filled with corn. I'm thinking I will get to watch turkeys...wild hog...maybe even a deer. NOPE...not so far...so far, I have been getting tons of bird videos, and squirrels attacking the feeder motor to make more corn fall out. At night I'm getting probably 6 hours of raccoons camping under the feeder. OH....I had always blamed feeder damage on squirrels. They do hang on the timer/motor, but that's not what keeps messing them up I bet. These coons must weigh 20~30 lbs, and they hang on the motor two at a time sometimes!
Anyway, I want/need to limit the time the camera is on....over a certain period of time. I know a little more now, so I can do the simple stuff, but I'm looking for ideas on something that seems more of a challenge. I don't want to change the code too much, because I like the way it is working, but I want to have it where it will keep from running the battery down in one night.
Here is what I have in mind to do, but haven't come up with the HOW. I think I would keep track of the events received from the remote PIR unit, and if it exceeds soooo many in, maybe, 30 minutes, then I need to give the battery a break.
Here is what I have so far, please excuse the lack of comments for now, but it is pretty simple. I can also turn the camera on with my hand held,that part is fine.
Code:
low 0 'transmitter relay mosfet (npn)
input 1 'normally low...goes high when relay turns on...not used for this unit
input 2 'normally high..goes low when remote PIR is triggered
high 4 'grounds call button on a hand held radio to send call
disablebod
pause 2000
'-----------------------------------------------------------------------------------
'this part is for testing the sensor placement and aligning camera
'the camera is turned on for this 5 minutes, and every time remote sensor
'is triggered, the "call" is sounded to let me know it has seen me move in front of the PIR
start_up:
w1 = 4000 'about 5 minutes with no interruption
high 0 'turn on camera and transmitter relay
Do While w1 > 0
if pin2 = 0 then 'pin2 goes low when remote PIR receiver is active
low 4 ' this grounds the call button on my hand held to send the "call"
pause 100
high 4
pause 5000
else 'if no remote PIR event is seen, count down the time anyway
nap 2
w1 = w1 - 1
endif
Loop
w1 = 0
low 0 'turn off camera...wait 10 seconds and go to main
pause 10000
goto main
'---------------------------------------------------------------------------------
'this is where the camera is off and waiting for something to happen
Main:
if pin3 = 0 then turn_camera_on 'if remote call is pushed on my hand held radio
if pin2 = 0 then remote_trigger_seen 'if motion is seen by remote PIR
nap 2`
goto main
'----------------------------------------------------------------------
'this is what happens if I press the call button on my hand held
turn_camera_on:
high 0 'turn on camera and transmitter so I can see what is going on
pause 3000
low 4 'press call button on radio inside case with the video transmitter>>
pause 100 '>>this just verifies it is working still I guess
high 4
for b1 = 1 to 5 'I wanted to watch the scene for 5 minutes
pause 60000
next b1
low 0
pause 10000
goto main
'---------------------------------------------------------------------------
'this happens when remote PIR detects motion
remote_trigger_seen:
b2 = 0
b3 = 0
high 0 'turn on the camera and transmitter
pause 3000
low 4 'send the call to my hand held to let me know I'm receiving video
pause 100
high 4
Do While b2 < 3 and b3 < 10 'I'm leaving the camera on for 3 minutes at a time, up to 10
Setint %00000000,%00000100 'watch for another PIR event even while camera is on
pause 60000
b2 = b2 + 1
b3 = b3 + 1
loop
setint off
low 0
goto check_timer
interrupt:
pause 60000
b2 = 1
b3 = b3 + 1
Setint %00000000,%00000100
return
'---------------------------------------------------------------------------------
'this is the part that I'm using to limit the "on time"
'right now, it limits the time to about 10 minutes total
'if it has been on 10 minutes, I wait 5 minutes before returning to main
'if it has been less than 10, I wait 10 seconds before going to main
'the 10 second wait is to let my recording device stop and
'get ready for another event to record
check_timer:
if b3 = 10 then 'been on for 10 minutes solid, so wait 5 minutes before going to main
for b4 = 1 to 5
pause 60000
next b4
endif
pause 10000 'if on for less than 10 minutes, wait just 10 seconds
goto main
Last edited: