Motion Triggered Camera With Raspberry Pi

Introduction: Motion Triggered Camera With Raspberry Pi

Raspberry Pi with HC-SR501 Passive Infrared Sensor to detect squirrel's appearance, and then trigger SONY A6300 to record the video at the best angle and distance.

Step 1: What You Need:

  • A camera, I used SONY A6300
  • Raspberry Pi, mine is version 2 model B
  • HC-SR501 motion sensor, with some cables

For a list of supported camera, please check here:

Step 2: Connect the Sensor to the Pi

5V, GND, and any GPIO pin

Remember the pin number, you will need it in the python script.

Step 3: Connect the Rest

  1. Make sure the camera is in PC Remote mode (SONY A6300)
  2. Connect the Raspberry Pi to the camera
  3. Connect the power source to the Raspberry Pi

For a list of supported camera, please check here:

Step 4: Setup the Raspberry Pi

Please follow the steps at my GitHub:

Then you can do some tests.

Step 5: Do Something Fun

You can use this setup to capture some wild animals you couldn't do before.

Step 6: Some Sample Videos. Enjoy!

1 Person Made This Project!


  • Build a Tool Contest

    Build a Tool Contest
  • Fandom Contest

    Fandom Contest
  • Eggs Challenge

    Eggs Challenge



Question 2 years ago on Step 6

Thanks for the information on turning a camera into a wildlife trap. Can the camera be triggered to take a photo rather than start filming video?


Answer 2 years ago

To answer my own question, I guess just need to change the subprocess call in the python script to replace "--set-config", "movie=1", "--wait-event="+str(movie_length) +"s", "--set-config", "movie=0"] with --capture-image

I'll order the bits needed and will give it a try.


Reply 2 years ago

Yes! Thanks