{"id":4134,"date":"2026-05-09T09:00:00","date_gmt":"2026-05-09T09:00:00","guid":{"rendered":"https:\/\/pirhome.com\/?p=3920"},"modified":"2026-05-09T09:00:00","modified_gmt":"2026-05-09T09:00:00","slug":"pir-wildlife-camera-trigger-2","status":"publish","type":"post","link":"https:\/\/www.pirhome.com\/?p=4134","title":{"rendered":"PIR Sensor for Wildlife Camera Trigger"},"content":{"rendered":"<h2>Project Overview<\/h2>\n<p>This project creates a wildlife camera trigger system that captures photos or videos when animals are detected. A PIR sensor detects animal movement and triggers a camera (GoPro, DSLR, or USB camera) to capture images, perfect for observing wildlife in your backyard or remote locations.<\/p>\n<p><strong>Difficulty:<\/strong> Intermediate<br \/>\n<strong>Estimated time:<\/strong> 2-3 hours<br \/>\n<strong>Estimated cost:<\/strong> $30-50 (plus camera)<\/p>\n<h2>How It Works<\/h2>\n<p>A PIR sensor detects warm, moving animals. When motion is detected, the ESP32 triggers the camera via a shutter control cable (for DSLR) or by activating a USB camera. Images are stored on an SD card or transmitted via Wi-Fi. The system includes a real-time clock to timestamp images.<\/p>\n<h2>Materials Needed<\/h2>\n<ul>\n<li>ESP32-CAM or Arduino + camera module (1)<\/li>\n<li>HC-SR501 PIR sensor (1)<\/li>\n<li>SD card for image storage<\/li>\n<li>Battery pack (18650 lithium cells) or 5V USB power bank<\/li>\n<li>TP4056 charging module (if using rechargeable batteries)<\/li>\n<li>Weatherproof enclosure (IP65 or better)<\/li>\n<li>Jumper wires<\/li>\n<li>IR LED array for night vision (optional)<\/li>\n<\/ul>\n<h2>Circuit Diagram<\/h2>\n<h3>Connection Table (ESP32-CAM + PIR)<\/h3>\n<table border=\"1\">\n<thead>\n<th>Component<\/th>\n<th>Pin<\/th>\n<th>ESP32-CAM Pin<\/th>\n<\/thead>\n<tbody>\n<th>PIR Sensor<\/th>\n<p> VCC<\/th>\n<p> 5V<\/th>\n<th>PIR Sensor<\/th>\n<p> GND<\/th>\n<p> GND<\/th>\n<th>PIR Sensor<\/th>\n<p> OUT<\/th>\n<p> GPIO 13<\/th>\n<th>IR LED Array<\/th>\n<p> Positive<\/th>\n<p> GPIO 4<\/th>\n<\/tbody>\n<p>\u8868<\/p>\n<h2>Arduino Code (ESP32-CAM)<\/h2>\n<pre><code>\/\/ Wildlife Camera Trigger with ESP32-CAM\n#include \"esp_camera.h\"\n#include &lt;FS.h&gt;\n#include &lt;SD_MMC.h&gt;\n#include &lt;time.h&gt;\n\n#define PIR_PIN 13\n#define LED_PIN 4\n\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM      0\n#define SIOD_GPIO_NUM     26\n#define SIOC_GPIO_NUM     27\n#define Y9_GPIO_NUM       35\n#define Y8_GPIO_NUM       34\n#define Y7_GPIO_NUM       39\n#define Y6_GPIO_NUM       36\n#define Y5_GPIO_NUM       21\n#define Y4_GPIO_NUM       19\n#define Y3_GPIO_NUM       18\n#define Y2_GPIO_NUM        5\n#define VSYNC_GPIO_NUM    25\n#define HREF_GPIO_NUM     23\n#define PCLK_GPIO_NUM     22\n\nconst char* ntpServer = \"pool.ntp.org\";\nconst long gmtOffset = 0;\nconst int daylightOffset = 0;\n\nunsigned long lastTriggerTime = 0;\nconst unsigned long triggerCooldown = 10000;\nint imageCount = 0;\n\nvoid setup() {\n  Serial.begin(115200);\n  \n  pinMode(PIR_PIN, INPUT);\n  pinMode(LED_PIN, OUTPUT);\n  digitalWrite(LED_PIN, LOW);\n  \n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sscb_sda = SIOD_GPIO_NUM;\n  config.pin_sscb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 20000000;\n  config.pixel_format = PIXFORMAT_JPEG;\n  config.frame_size = FRAMESIZE_SVGA;\n  config.jpeg_quality = 12;\n  config.fb_count = 1;\n  \n  esp_camera_init(&config);\n  \n  SD_MMC.begin();\n  configTime(gmtOffset, daylightOffset, ntpServer);\n  \n  delay(30000);\n}\n\nString getTimestamp() {\n  struct tm timeinfo;\n  if (!getLocalTime(&timeinfo)) return \"00000000_000000\";\n  char buffer[20];\n  strftime(buffer, sizeof(buffer), \"%Y%m%d_%H%M%S\", &timeinfo);\n  return String(buffer);\n}\n\nvoid captureImage() {\n  if (millis() - lastTriggerTime < triggerCooldown) return;\n  \n  lastTriggerTime = millis();\n  \n  digitalWrite(LED_PIN, HIGH);\n  delay(100);\n  \n  camera_fb_t *fb = esp_camera_fb_get();\n  if (!fb) {\n    digitalWrite(LED_PIN, LOW);\n    return;\n  }\n  \n  String filename = \"\/IMG_\" + getTimestamp() + \".jpg\";\n  File file = SD_MMC.open(filename, FILE_WRITE);\n  if (file) {\n    file.write(fb->buf, fb->len);\n    file.close();\n    imageCount++;\n  }\n  \n  esp_camera_fb_return(fb);\n  digitalWrite(LED_PIN, LOW);\n}\n\nvoid loop() {\n  if (digitalRead(PIR_PIN) == HIGH) {\n    captureImage();\n    delay(2000);\n    captureImage();\n  }\n  \n  delay(100);\n}\n<\/code><\/pre>\n<h2>DSLR Trigger Version<\/h2>\n<pre><code>const int shutterPin = 12;\nconst int focusPin = 14;\n\nvoid triggerCamera() {\n  digitalWrite(focusPin, HIGH);\n  delay(200);\n  digitalWrite(shutterPin, HIGH);\n  delay(100);\n  digitalWrite(shutterPin, LOW);\n  delay(200);\n  digitalWrite(focusPin, LOW);\n}\n<\/code><\/pre>\n<h2>Installation Steps<\/h2>\n<ol>\n<li>Assemble electronics and test indoors<\/li>\n<li>Program ESP32-CAM and verify image capture<\/li>\n<li>Mount components in weatherproof enclosure<\/li>\n<li>Position near animal trails, water sources, or feeding areas<\/li>\n<li>Adjust PIR sensitivity for animals of appropriate size<\/li>\n<li>Connect battery pack (use solar panel for long-term deployment)<\/li>\n<li>Walk in front to verify camera triggers<\/li>\n<\/ol>\n<h2>Project Extensions<\/h2>\n<ul>\n<li>Add IR LED array and remove IR filter for night vision<\/li>\n<li>Add cellular module for remote image transmission<\/li>\n<li>Record video clips instead of still images<\/li>\n<li>Add machine learning to identify species<\/li>\n<li>Add solar panel for indefinite operation<\/li>\n<li>Upload images to cloud when in Wi-Fi range<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>This wildlife camera trigger lets you observe animals in their natural habitat without disturbing them, capturing amazing photos of local wildlife.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project Overview This project creates a wildlife camera trigger system that captures photos or videos when animals are detected. A PIR sensor detects animal movement and triggers a camera (GoPro, DSLR, or USB camera) to capture images, perfect for observing wildlife in your backyard or remote locations. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4134","post","type-post","status-publish","format-standard","hentry","category-projects"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>PIR Sensor for Wildlife Camera Trigger - PIRHOME<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"http:\/\/www.pirhome.com\/?p=4134\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"PIR Sensor for Wildlife Camera Trigger - PIRHOME\" \/>\r\n<meta property=\"og:description\" content=\"Project Overview This project creates a wildlife camera trigger system that captures photos or videos when animals are detected. A PIR sensor detects animal movement and triggers a camera (GoPro, DSLR, or USB camera) to capture images, perfect for observing wildlife in your backyard or remote locations. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/www.pirhome.com\/?p=4134\" \/>\r\n<meta property=\"og:site_name\" content=\"PIRHOME\" \/>\r\n<meta property=\"article:published_time\" content=\"2026-05-09T09:00:00+00:00\" \/>\r\n<meta name=\"author\" content=\"nic@nicsky.com\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"nic@nicsky.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134\"},\"author\":{\"name\":\"nic@nicsky.com\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\"},\"headline\":\"PIR Sensor for Wildlife Camera Trigger\",\"datePublished\":\"2026-05-09T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134\"},\"wordCount\":319,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"articleSection\":[\"Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=4134#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134\",\"name\":\"PIR Sensor for Wildlife Camera Trigger - PIRHOME\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\"},\"datePublished\":\"2026-05-09T09:00:00+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.pirhome.com\\\/?p=4134\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/?p=4134#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.pirhome.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PIR Sensor for Wildlife Camera Trigger\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#website\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"name\":\"PIRHOME\",\"description\":\"PIR &amp; Motion Sensor\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/www.pirhome.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#organization\",\"name\":\"PIRHOME\",\"url\":\"http:\\\/\\\/www.pirhome.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pirhome.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg\",\"width\":512,\"height\":512,\"caption\":\"PIRHOME\"},\"image\":{\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.pirhome.com\\\/#\\\/schema\\\/person\\\/41049b5236f9c77c9314997d070db3e3\",\"name\":\"nic@nicsky.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g\",\"caption\":\"nic@nicsky.com\"},\"sameAs\":[\"http:\\\/\\\/www.pirhome.com\"],\"url\":\"https:\\\/\\\/www.pirhome.com\\\/?author=1\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PIR Sensor for Wildlife Camera Trigger - PIRHOME","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.pirhome.com\/?p=4134","og_locale":"en_US","og_type":"article","og_title":"PIR Sensor for Wildlife Camera Trigger - PIRHOME","og_description":"Project Overview This project creates a wildlife camera trigger system that captures photos or videos when animals are detected. A PIR sensor detects animal movement and triggers a camera (GoPro, DSLR, or USB camera) to capture images, perfect for observing wildlife in your backyard or remote locations. Difficulty: Intermediate Estimated time: 2-3 hours Estimated cost: [&hellip;]","og_url":"http:\/\/www.pirhome.com\/?p=4134","og_site_name":"PIRHOME","article_published_time":"2026-05-09T09:00:00+00:00","author":"nic@nicsky.com","twitter_card":"summary_large_image","twitter_misc":{"Written by":"nic@nicsky.com","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.pirhome.com\/?p=4134#article","isPartOf":{"@id":"http:\/\/www.pirhome.com\/?p=4134"},"author":{"name":"nic@nicsky.com","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3"},"headline":"PIR Sensor for Wildlife Camera Trigger","datePublished":"2026-05-09T09:00:00+00:00","mainEntityOfPage":{"@id":"http:\/\/www.pirhome.com\/?p=4134"},"wordCount":319,"commentCount":0,"publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"articleSection":["Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.pirhome.com\/?p=4134#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.pirhome.com\/?p=4134","url":"http:\/\/www.pirhome.com\/?p=4134","name":"PIR Sensor for Wildlife Camera Trigger - PIRHOME","isPartOf":{"@id":"http:\/\/www.pirhome.com\/#website"},"datePublished":"2026-05-09T09:00:00+00:00","breadcrumb":{"@id":"http:\/\/www.pirhome.com\/?p=4134#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.pirhome.com\/?p=4134"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.pirhome.com\/?p=4134#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.pirhome.com\/"},{"@type":"ListItem","position":2,"name":"PIR Sensor for Wildlife Camera Trigger"}]},{"@type":"WebSite","@id":"http:\/\/www.pirhome.com\/#website","url":"http:\/\/www.pirhome.com\/","name":"PIRHOME","description":"PIR &amp; Motion Sensor","publisher":{"@id":"http:\/\/www.pirhome.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.pirhome.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.pirhome.com\/#organization","name":"PIRHOME","url":"http:\/\/www.pirhome.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","contentUrl":"https:\/\/www.pirhome.com\/wp-content\/uploads\/2026\/02\/cropped-\u5fae\u4fe1\u56fe\u7247_2026-02-19_222409_472.jpg","width":512,"height":512,"caption":"PIRHOME"},"image":{"@id":"http:\/\/www.pirhome.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.pirhome.com\/#\/schema\/person\/41049b5236f9c77c9314997d070db3e3","name":"nic@nicsky.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/271d4eaab48e299e4fce771a8c43c537be3ac77a3115cc7de802a6c8b692d971?s=96&d=mm&r=g","caption":"nic@nicsky.com"},"sameAs":["http:\/\/www.pirhome.com"],"url":"https:\/\/www.pirhome.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4134"}],"version-history":[{"count":1,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4134\/revisions"}],"predecessor-version":[{"id":4656,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=\/wp\/v2\/posts\/4134\/revisions\/4656"}],"wp:attachment":[{"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pirhome.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}