Shop OBEX P1 Docs P2 Docs Learn Events
Camera Control Box — Parallax Forums

Camera Control Box

RagtopRagtop Posts: 406
edited 2012-03-09 07:34 in Robotics
Project purpose: To create a 9v battery device to plug into my Canon Rebel digital camera's remote port that will allow me to take
pictures in a variety of ways 1) with a wireless remote control 2) Time Lapse 3) triggered by motion sensor 4) triggered by photo cell/laser

The device will have two buttons. One button to move through the four modes and the other button to select the mode.

I explain the project out in this video I had already put up: http://www.youtube.com/watch?v=90qQb9NTVjc

This new video mainly involves the mechanics of getting the buttons added.

[video=youtube_share;jXJJFb6-YR0]

Comments

  • RagtopRagtop Posts: 406
    edited 2012-02-10 09:09
    Had a question on the main part of this project "How to trigger the camera with a micro-controller".

    [video=youtube_share;nt1xeagTRLI]
  • RagtopRagtop Posts: 406
    edited 2012-02-13 11:34
    Adding LEDs for showing menu selections and a laser trip line trigger.

    [video=youtube_share;5nHTcrCmQfY]
  • RagtopRagtop Posts: 406
    edited 2012-02-23 09:02
    Well, this is one finished project out of a half dozen other unfinished projects.

    [video=youtube_share;eELvj2Cuc2Y]
  • RagtopRagtop Posts: 406
    edited 2012-02-23 09:05
    Here is the code. I doubt I will do a complete schematic but will upload the ones from the various parts that I used.

    {{
    *****************************************
    Uses one COG to check the D button on remote control
    and take a picture if the state of that D pin has changed
    or if it has been commanded to by command := 1
    *****************************************
    }}
    
    CON
             _clkmode        = xtal1 + pll16x
             _xinfreq        = 5_000_000
    'Pin Assignments
        remote =  15       'RF keyfob remote. Pin changes state each time remote button D is pressed.
        focus =   16       'camera control  high triggers opto which connects focus wire to ground wire
        shutter = 17       'camera control  high triggers opto which connects shutter wire to ground wire
        
        yellowbutton =  0   'menu navigator   
        redbutton    = 14   'selector 
    
        LEDmotion   =  8    'indicator LEDs to show menu items 
        LEDTrip     =  9
        LEDTime     = 10
        LEDremote   = 11
        LEDMinute   = 12
        LEDmins     = 13
        LEDhour     = 18
        LEDday      = 19
        
        photocell   = 27         'higher RC value darker.
        motion      =  7         'Epir motion sensor.  Pin goes low when motion detected.
    VAR
    
       byte d,dlast      'remote button old and new state
       long Stack[16]    'to run TakePicture in another cog
       byte command      'used to tell TakePicture to ... take picture
       byte menu,submenu 'to hold the current positions in mode selections
    
      long tripValue     'to hold the RC Time value for the photo cell.
      long x,n             'counter for time delay
    OBJ
    
      RC    : "RCTIME"  'used to determine if laser is hitting photocell for tripwire
      'debug  : "FullDuplexSerialExtended"
     
    Pub Start
       tripValue := 0
       RC.start(photocell,1,@tripvalue )
       command:=0
       cognew(TakePicture,@Stack) 'allows for remote taking of photos even when other modes selected.
    
    
       'debug.start(31, 30, 0, 19200)
    
       'input pins
       '---------------  
       dira[redbutton]~
       dira[yellowbutton]~
       dira[motion]~
       
       'output pins
       '----------------
       dira[LEDremote]~~
       dira[LEDtime]~~
       dira[LEDtrip]~~
       dira[LEDmotion]~~
       dira[LEDminute]~~
       dira[LEDmins]~~
       dira[LEDhour]~~
       dira[LEDday]~~
       
       menu := 1
       submenu := 1
       outa[LEDremote]:=1
       repeat
          'debug.dec(tripvalue)
          'debug.str(string(13))
          if ina[yellowbutton] == 1    'move to next menu item
             outa[LEDremote]:= 0
             outa[LEDtime]:= 0
             outa[LEDtrip]:= 0
             outa[LEDmotion]:= 0
             outa[LEDminute]:= 0
             outa[LEDmins]:= 0
             outa[LEDhour]:= 0
             outa[LEDday] := 0  
            menu++
            if menu == 5
               menu := 1
            case menu
              1:  outa[LEDremote] := 1
              2:  outa[LEDtime] := 1
              3:  outa[LEDtrip] := 1
              4:  outa[LEDmotion] := 1  
          if ina[redbutton] == 1   'then enter into that menu item, else just repeat looking 
              
             case menu       'each one needs to listen to yellow button to return back to selecting mode
              1:  'do nothing already set for remote control
              2:  TimeDelay'have sub-menu selection of time delay: 1 minute, 15 minutes, 1 hour, 1 day                        
              3:  'listen to tripwire
                  repeat while ina[yellowbutton] == 0    'break out to choose other menu item
                    if tripvalue > 70
                      command := 1     'take picture
              4:  'listen to motion sensor.
                  repeat while ina[yellowbutton] == 0    'break out to choose other menu item
                    if ina[motion] == 0
                      command := 1     'take picture
              
         waitcnt(clkfreq/7+cnt)   'to give button enough time to go back to zero     
    
    PUB TimeDelay
        outa[LEDminute]:=1
        outa[LEDmins]:= 0
        outa[LEDhour]:= 0
        outa[LEDday] := 0
        waitcnt(clkfreq/7+cnt)   'to give button enough time to go back to zero   
        repeat while ina[redbutton] == 0  
          if ina[yellowbutton] == 1     'move through sub menu
             outa[LEDminute]:= 0
             outa[LEDmins]:= 0
             outa[LEDhour]:= 0
             outa[LEDday] := 0
             submenu++
             if submenu == 5
                submenu := 1
          case submenu
                1:  outa[LEDminute] := 1
                    n:= 60
                2:  outa[LEDmins] := 1
                    n:=900
                3:  outa[LEDhour] := 1
                    n:=3600
                4:  outa[LEDday] := 1
                    n:=86400
          waitcnt(clkfreq/7+cnt)    'to give button enough time to go back to zero          
         
        repeat while ina[yellowbutton] == 0           'time loops with a yellow button break out
                    x:=1
                    command := 1    'take picture 
                    repeat while (x < n) and (ina[yellowbutton] == 0)
                       x++
                       waitcnt(clkfreq+cnt)
        outa[LEDminute]:= 0
        outa[LEDmins]:= 0
        outa[LEDhour]:= 0
        outa[LEDday] := 0                   
        waitcnt(clkfreq/7+cnt)    'to give button enough time to go back to zero
    
    PUB TakePicture
    
       dira[remote]~  'sets d pin from remote to input
    
       d := dlast := 0    'button d not pressed
       repeat
          dira[focus]~~     'outputs to opto
          dira[shutter]~~   'outputs to opto
          if RemoteDtest == 1 or command == 1
             outa[focus]~~    'set pin high causing opto to connect focus to ground
             outa[shutter]~~  'set pin high causing opto to connect shutter to ground 
             waitcnt(clkfreq/2+cnt)
             outa[focus]~
             outa[shutter]~
             command := 0
    
       
    
    Pub RemoteDtest        'used because the remote does not operate as a momentary button
        d := ina[remote]   'instead it changes state each press and stays in that state
        if d == dlast      'so instead of looking for high or low you have to look for a
          result := 0      'change of state
        else   
          result := 1
        dlast := d
    
    
        
    
    DAT
    {{
    &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
    &#9474;                                                   TERMS OF USE: MIT License                                                  &#9474;
    &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
    &#9474;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation    &#9474;
    &#9474;files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,    &#9474;
    &#9474;modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software&#9474;
    &#9474;is furnished to do so, subject to the following conditions:                                                                   &#9474;
    &#9474;                                                                                                                              &#9474;
    &#9474;The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.&#9474;
    &#9474;                                                                                                                              &#9474;
    &#9474;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE          &#9474;
    &#9474;WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR         &#9474;
    &#9474;COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,   &#9474;
    &#9474;ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                         &#9474;
    &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
    }}
    
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-02-23 09:31
    Ragtop,

    This is a great project! A box like this has been on my list for a while. Hopefully, your success can lead to some motivation for me to get moving on it!

    Thank you for taking the time to document the process and provide code (and soon to be coming partial schematics?)

    Well done!
  • RagtopRagtop Posts: 406
    edited 2012-02-26 11:16
    I think this is all the major schematics for this project....not as nice as having them in one muddled mess, but just remember all roads lead to the propeller.

    Just used the basic set-up for the propeller and power supply minus a reset button.
    The motion sensor is an EPIR. There were some pins on it I did not use as explained in it's attached picture
    The RF remote I got off ebay. RF controller

    img006.jpg
    img002.jpg
    img011.jpg
    img009.jpg
    img007.jpg
    img008.jpg
    618 x 432 - 230K
    284 x 288 - 61K
    940 x 490 - 149K
    482 x 338 - 101K
    385 x 504 - 199K
    398 x 576 - 134K
  • RagtopRagtop Posts: 406
    edited 2012-03-05 05:44
    I used the box in my first attempt at taking time delay (1 minute) photos of the night sky with an open shutter of 20 seconds
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-05 07:03
    Thank you for the schematics. Every little bit helps!

    Nice time delay sequence! Long enough to get the exposure but not long enough to start seeing trails.

    How did you piece the single frames together into a movie?
  • RagtopRagtop Posts: 406
    edited 2012-03-05 07:28
    I used the program Power Directer. It lets you set the duration of all pictures before dragging them to the timeline then It is just select all and drag down. It can post to both youtube and facebook.

    I was hoping to get the Milky Way, but my lack of astronomy background had me pointing to the wrong part of the sky (north). If I had thought about it, the solar system
    rotates on about the same plane as the galaxy so I should have been pointing east or west. Still don't know if I can get pictures of the milky way with my camera
    here in Florida with light pollution, but going to try again.
  • RagtopRagtop Posts: 406
    edited 2012-03-08 14:40
    I put out bird seed hoping to capture pictures of birds with my motion sensor part of the camera control box. Instead I got hundreds of pictures of this guy.

    IMG_3066.jpg
    957 x 1014 - 701K
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-08 17:26
    Um, Tweet?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-08 18:08
    Ragtop wrote: »
    I put out bird seed hoping to capture pictures of birds with my motion sensor part of the camera control box. Instead I got hundreds of pictures of this guy.

    That's still a great picture. Man, I've got to build one of these.
  • RagtopRagtop Posts: 406
    edited 2012-03-09 05:41
    Of course, now I am thinking of a "Wipeout" inspired squirrel discourager as a next project.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-09 06:38
    Consider making your "discourager" scalable.......

    bear feeder.png


    Regardless of the outcome, this is a great project. Thank you for sharing!
    718 x 556 - 505K
  • RagtopRagtop Posts: 406
    edited 2012-03-09 07:34
    I live next to the Ocala National Forest so I am hoping for some black bear photos in the future.
Sign In or Register to comment.