Intro: Outdoor DSLR Timelapse and Sensor Raspberry Pi Project
This project enables your smart phone to remotely control your DSLR using a raspberry pi. With your smart phone you will be able to control your DSLR to do the following:
- Connect your phone to the DSLR through the raspberry pi using a wifi hotspot on the pi
- Run a timelapse program which can be configured with start settings, change settings based on light for day, dusk, night. Interval time.
- Timelapse has 2 separate modes: landscape and macro which can be configured completely independent of each other.
- Sensor program mode for proximity sensor and vibration sensor. Take photos when something is triggered by a proximity sensor or vibration sensor. This program also has its own start settings and day, dusk, night settings that change as the light changes.
- Take a photo from your phone
- View photos on your DSLR from your phone
- Test sensors and LED if connected
Building this project involves 2 main parts: building the raspberry pi, and constructing a camouflage case.
Step 1: Materials Needed for Raspberry Pi
You will need the following materials for setting up the raspberry Pi:
- Raspberry Pi 2 or 3
- Raspberry Pi clear case
- Wifi Dongle to set up wifi (I used a Realtek RTL8188CUS but any wifi dongle should do)
- Jumper cables to connect to GPIO pins
- DSLR camera
- USB cable from DSLR camera to Pi
- Portable power source to power Pi (5V)
- cable for mini USB (Pi) to power source
- Proximity Sensor (optional)
- Vibration Sensor (optional)
- LED and 270 Ohm resistor (optional)
Temporary parts to communicate with the Raspberry Pi:
- HDMI cable for Pi to Monitor
- Ethernet cable for internet connection
Step 2: Prepare Pi for Software Installing
Connect all parts and cables to the Raspberry Pi
- Place Pi in clear case
- Connect wifi dongle to a USB port on Pi
- Connect HDMI cable from Pi to Monitor
- Connect keyboard to USB port on Pi
- Connect mouse to USB port on Pi
- Connect ethernet cable from Pi to your home router
- Connect USB cable from DSLR to Pi
- Connect power source to Pi
- Turn Pi on
Ignore extra wires, switch and button on my photo. These wires for my first attempt to configure the Pi, but I found using my smart phone a lot easier. We will cover hardware parts of Pi later.
Step 3: Install Software on Pi
Follow my github software project to install the software on the Pi here. I used the standard Raspian as my Pi OS.
This github project shows screen shots of what you can expect to see when done. Be patient, this step takes time, especially if your not that familiar with the Pi.
Follow the steps on the ocpic github project to test your installation.
If you have it all working you can power down and disconnect:
- ethernet cable
- HDMI cable
Step 4: Attach LED (optional)
The LED can help you determine in the Pi is working. I do not use the LED in the project other than for testing. You can miss this step if you want.
See the photo above for the circuit diagram for building the LED on the Pi.
- Connect the short end of the LED to the 270 Ohm resistor. You can solder this or twist wires together.
- Connect the other end of the resistor to a jumper cable.
- Plug that jumper cable into a Ground PIN on the GPIO connectors
- Connect the long end of the LED to a jumper cable.
- Plug that jumper cable into GPIO PIN 18
Step 5: Add Proximity Sensor (optional)
This project works great with a proximity sensor. You can set the program to take a photo when something moves in front of the sensor. There are various settings for the sensor program such as separate camera settings for light conditions (day/dusk/night). As the light changes from one light mode to another, the program will slowly change camera settings from one light mode to another.
This is easy to setup. Take note of the voltage requirements of the sensor. My proximity sensor requires 5V. It also has variable resistors to control the sensitivity of the sensor.
There are no resistors needed for this.
- Connect a jumper from the power terminal of the sensor to the 5V or 3.3V GPIO pin (depending on your sensor requirements).
- Connect a jumper from the ground terminal of the sensor to the GPIO Ground pin.
- Connect a jumper from the out terminal of the sensor to GPIO pin 7.
The OCPIC program has a page for testing the sensors.
- On the home page press the sensor icon.
- Press the "Poll" button
- Wave your hands in front of the sensor and you should see the badge number increment
Step 6: Add Vibration Sensor (optional)
This is almost identical to adding the proximity sensor on the previous step. Once again take note of the voltage of the sensor. My vibration sensor requires 3.3V.
Connect the out terminal of the sensor to GPIO pin 23.
All the other steps are same.
Step 7: Materials for Covering the Pi
Once the Pi is working, we need to get it ready for taking outside. We need to protect it from the elements and some time of camouflage from animals and people. I decided to use a standard 5 gallon bucket. These last steps are relatively easy when compared with the steps of setting up the Pi.
- 5 gallon White or Black bucket. Try to avoid bright colors like orange.
- Thin wooden or plastic sheet around 1/2 inch thick. Used for bucket base and internal layers.
- 5/16" threaded bar
- 8 x 5/16" Hex nuts
- 25 x 5/16" wing nuts
- 24 x 5/16" washers
- Small tub of Oil Paint medium to dark brown. I used Burnt Umber
- Clear silicone glue
- about 3 feet of wire about the same gauge as jumper wire
- small piece of clear plastic about 4" x 2"
- end part of a stump about the width of the bucket and an inch or two thick
- 2 x sets of plastic clips to fasten bucket to base board
- Quick release plate adapter for the DSLR. To mount your camera.
Step 8: Make Base Board
- Place your thin wooden or plastic sheet on the ground.
- Put your bucket upside down on the board
- Using a pencil mark around the bucket
- We want about a 2 inch gap all around that line for cutting
- Using a jig-saw, cut on the 2 inch gap past the bucket outline
Step 9: Make 2 Internal Layer Boards
One layer will be used to store the Pi and power supply. The top layer will be used to hold the camera mount.
The two layers must easily fit in the bucket. One end of my bucket was wider than the other. So I used the thinner end of the bucket to use as an outline.
- Place thin wooden or plastic board on ground
- Place smaller end of bucket on board
- Use a pencil to mark an outline of the bucket on board. If your bucket is the same width on both ends you will want to cut it a bit thinner
- Use a jig saw to cut board
- Optionally you can cut the sides of the board, as we dont need the full surface area. See photo for an idea of how much to cut. Dont cut too much off.
Repeat again for second layer
Step 10: Drill Holes in Boards
- Place smaller boards on top of each other and on top of larger board.
- Clamp together so they wont move
- You want to keep these holes fairly straight. So use a drill drop tool if you have one or a drill guide.
- I choose a spot about an inch from the corner of the smaller boards. I used a measuring tape to make sure both ends matched.
- Use a 5/16" drill to drill the holes through all 3 boards.
Step 11: Bracket Boards
The bracket boards are used to mount 2 steel rods to hold up camera mount board.
- Using about a 1/2" x 1" board place on top of one of the smaller layers. Once side in parallel with the flat side.
- Cut the board the width of the flat sides on the board
- Repeat for second
Now you want to drill 2 holes matching the holes on one side of the smaller layered board into the bracket standing up. Try to get in center of bracket
- Place bracket board on ground standing up
- Place small layer board on top of bracket board with holes on top of bracket board
- Use a drill guide to drill through small layer board and through bracket board
- Repeat for both holes and both bracket boards
You will need to drill 2 holes in the sides of the bracket board to insert steel rods for mount board. We will do this task after we create the mount board.
Step 12: Mount Board
This piece of wood is used to add the quick release plate adapter for your DSLR camera.
Use a 1.5" x 2.5". It basically just needs to be about the same size as your quick release plate.
- Mark and cut the 1.5" x 2.5" board about the same size as the plate
- Now we need to drill two holes through the board to run the steel rods through. We really need to make sure these holes are as straight as possible to align up with bracket boards
- Place a bracket board on side and on a sacrifice board on ground
- Place mount board on top of bracket board.
- Make sure mount board is slightly inline on one side from bracket board about 2-5mm. We want a gap between mount board and small layer board so mount board can slide easily.
- Place a bracket board on side and on top of mount board
- Use a drill guide to drill 2 holes through all 3 boards. Try to keep as straight as possible
- When done, mark with a pencil a side A on both mount board and bracket board, and a side B on other side of mount board and bracket board. This will help with aligning rods and boards later
Step 13: Threaded Rods
We need 6 pieces of 5/16" threaded rods.
- With a hack saw cut 4 pieces of threaded rod about 9 inches (23 cm). These are used to hold jig together
- Cut 2 pieces of threaded rod a little less than the length of the small boards measured from the center of the round end to the other round end. These are used to hold mount board
Step 14: Assemble Jig
At this point we want to make sure the jig fits together. If some holes are a tight fit, you will want to widen holes a little by drilling in hole again and moving drill around.
- One the 4 long threaded rods add a washer and a hex nut. Threaded rod can match the hex nut.
- Thread though base board
- On other side of base board add a washer and a nut. Hand tighten lightly
- On each threaded rod, add a wing nut upside down about a couple inches from bottom
- Place one smaller layer board through threaded rods and sit on top of wing nuts
- Add another set of wing nuts on top of layer
- Add another set of wing nuts upside down about 4 inches from top of small layer board
- Place second small layer board on top of wing nuts
- Thread bracket boards through rods on top of small layer board
- Place mount board on top of small layer board
- Thread 2 small rods through bracket board and mount board. When threading though add a wing nut on each rod and each side of the mount board
- Add 2 sets of wing nuts on each end of the threaded rod outside of bracket boards
- Add wing nuts on top of bracket boards
Step 15: Place Bucket Over Jig
Make sure the bucket fits over the jig. The jig should reach about halfway up the bucket, but the height is adjustable with the wing nuts.
Step 16: More Holes in Base Board
To keep the bucket from tipping over, we want to add holes for pegs, and clips to attach board to bucket.
Clips are added to bucket and base board to prevent the bucket flying away on windy days.
Any clip you have will do, or even velcro. I had an old hiking bag with clips which I removed for this project.
- Drill about 8 holes around the edge of the base board, about a half an inch from edge. These holes will be for the pegs into the ground
- Drill 2 holes for the 2 clips to attach board to bucket. The hole size should be the size of the clip material only to pass through.
Step 17: Waterproof Wood
If you are using wood you will want to waterproof the wood. Add a few layers of lacquer or similar to all the wood.
Let it completly dry
Step 18: Add Quick Release Plate to Mount Board
The quick release plate adapter can be attached to the mount board. The camera lens should be pointing towards the round edges of the small layer boards so the camera can move back and forth.
- Place quick release plate adapter on top of mount board and align them up
- Mark with a pencil hole for a screw to secure plate adapter to mount board
- A second screw if you can to ensure the plate adapter doesnt move
- Pre drill holes for screws
- Screw in
Step 19: Cutting Holes in Bucket
Assemble the jig once again. Make sure the layers are the height you want them. Ideally we want enough room for raspberry pi and power source on bottom layer, and camera on top layer about half way up bucket.
- Attach camera to jig with lens attached to camera
- Place bucket upside down and outside and touching jig
- With a pencil mark about where the lens with come out of the bucket
- Use lens cap to mark hole better
- Cut hole out of bucket. I used a drill first, then used jig-saw with metal blade to cut around hole.
We want cut a hole for the sensor next.
- Place sensor at top middle of bucket about camera hole. Slightly to one side
- Mark with a pencil size of hole and cut hole for sensor
We want to cut a hole for flash next
- The flash should also go above camera hole and next to sensor hole
- Mark with a pencil size of hole for flash and cut hole
We want to cut 2 holes for clips
- You want to make sure you choose the correct location for these holes. To do this assemble the jig with the camera attached and place bucket over jig with camera coming out the camera hole. So basically its all aligned as you would expect.
- Mark the hole to cut on the bucket with the hole in the base board
- If you have a ridge at the bottom of the bucket, cut a hole for the clip material just under that ridge. This is to prevent water from going in the bucket. The hole should only allow the material to pass through.
Step 20: Secure Clips
You want to secure the clips in the baseboard and bucket. For my clips I sewed the backs tight by folded over the material, and sewing all together. Do this for all clips in baseboard and bucket
Step 21: Camouflaging Bucket
Now we want to camouflage the bucket. You maybe more creative than me on this step, and I would love to hear any better ideas. Basically our aim is to make the bucket looks like it fits into the environment you put it, so people do not steal it, and animals aren't deterred. I am trying to make the bucket look like an old tree stump.
For this step I used a technique I saw on instructables to make a PVC pipe look like wood.
- If there are any ridges on the bucket, carefully remove them with a sharp chisel or knife
- Use a wooden file and scrap lines going up and down the bucket
- Use a brown oil paint to paint the bucket on the top and sides
- Let it dry
I had an old log that I cut the end off and glues on top of the bucket. I drilled holes on the bottom of the log so it grips better with the glue.
Step 22: Glue Flash Plate and Sensor
For the flash hole, cut a clear plastic piece which covers hole at least a couple of cms. Any clear plastic will do.
Using some clear silicone, glue the plastic on the inside of the bucket. Make sure it is completely sealed and waterproof.
Before glueing the sensor, attach jumper wires to sensor. Wires should be able to connect and disconnect, so you want a male or female connection at the end of the wire.
Glue to proximity sensor to the inside of the bucket. Make sure the variable resistors which control the sensitivity are pointing down so you can easily adjust them.
You may need to glue outside of bucket around sensor to make sure its sealed.
I also glues a line around the camera hole so any water would drip around the hole.
Step 23: Extending the Wires for Sensor
We want to be able to easily remove the bucket, but still the sensor attached to the pi. To do this we are going to cut the jumper wire and extend it.
- Cut a female to female jumper cable in half (one end will attach to GPIO pin on pi, the other to the sensor)
- Cut some wire about the same gauge as the jumper wire 24" (64cm) long
- Strip the wire ends.
- Join wires together. If you have a soldering iron use that with heat shrink. You will need to this this on both ends of the wire with both halves.
- Attach wires to sensor and Pi (Sorry for extra wires on Pi, ignore those. You are just connecting the 3 sensor wires: red, black, green)
- Proximity sensor uses GPIO pin 7
- Vibration sensor uses GPIO pin 23
Step 24: Final Assemble and Test
Well done. You are now ready for the final assembly and test
- Assemble jig together again
- Make sure you attach camera, turn camera on, the power supply for pi
- On your smart phone set your wifi to the "camera_pi"
- On your phone open your web browser to http://192.168.42.1
- It may take a couple minutes to connect, but if you see the OCPIC screen its working!
- Follow the instructions on the ocpic github page to configure and setup
Hope it works well for you, this has been a great project for me. Let me know if you have some improvements or other related ideas.
Step 25: Improvements and Extra Tasks
I did not include the vibration sensor in this instructable, but it should be pretty straight forward. Just connect vibration sensor out to the GPIO pin 23, GND and PWR, and add extra wire. You may want to attach to a board or something so when something steps on the board it will trigger the vibration sensor.
Attaching the flash. To attach the flash I use a Off-Camera shoe cord. Use velcro on the flash and inside the bucket over the flash hole.
Reduce Noise. The sound of the camera taking the photo is already reduced when in the bucket, but it can be improved even more by adding a sound barrier inside the bucket like attaching foam.
For the Pi software part and alternative solution is you can upload the whole SD card at once. I have not found a place to put my large 3G file yet, but if you don't want to go through all the steps of software installation its a quicker solution.