Title: DIY Shadow Detection Camera with ESP32-CAM and RTC Sync (with Code + Demo)

Share

Build a DIY Shadow Detector with ESP32 and Camera Logging

Are you fascinated by the paranormal? Curious about detecting unexplained shadow movements with time-stamped evidence? At San Diego Haunted, we’ve completed a functional, portable ESP32-based shadow detection system—and you can build one too.

This DIY project uses:

  • An ESP32-CAM to detect visual changes,
  • A master ESP32 WROOM unit to sync accurate timestamps via a DS3231 RTC module,
  • And real-time logging to SD card for review of anomalous footage.

Check out our demo video on TikTok: https://www.tiktok.com/@sandiegohaunted/video/7509629168540224799


💡 How It Works

The system works by capturing a grayscale image every few seconds. It then compares pixel differences between the current and previous frame. If the difference exceeds a defined threshold, it logs the incident, saves the “before” and “after” images to SD, and attaches a timestamp from the RTC-synced master unit.

What sets this version of a shadow detector apart from others is its combination of accuracy, timestamped evidence, and offline capability. Many motion-detection systems rely solely on PIR sensors or require internet access for cloud-based logging. This system, however, uses direct image comparison to detect actual visual changes, not just movement or heat signatures. The onboard SD card saves both the ‘before’ and ‘after’ images locally, while the master unit provides accurate timestamps—even when there’s no Wi-Fi available. This makes it an ideal, self-contained tool for serious investigators who need portable, verifiable, and time-synced data.

This can be useful for:

  • Ghost hunting investigations
  • Paranormal research
  • Shadow motion-triggered documentation
  • DIY surveillance projects

🧰 Hardware Used

  • ESP32-CAM module
  • ESP32-WROOM master controller
  • DS3231 Real-Time Clock (RTC) module
  • Micro SD card module (built-in on ESP32-CAM)

📸 Build Photos

remote time setting module

camera module:

sd save examples

shadow detectionexample


💾 Final Code: ESP32-CAM Unit

#include "esp_camera.h"
#include "FS.h"
#include "SD_MMC.h"
#include "esp_now.h"
#include "WiFi.h"
#include "time.h"

// Camera pin definitions for AI Thinker ESP32-CAM
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27
#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22

// Full working logic includes grayscale capture, timestamp sync, and SD saving
// Contact us or visit GitHub for complete file 📁 GitHub Repository (Download Everything): https://github.com/danpirate8/esp32-shadow-detector

📅 Final Code: ESP32 Master with RTC Broadcast

#include <WiFi.h>
#include <esp_now.h>
#include <Wire.h>
#include "RTClib.h"

RTC_DS3231 rtc;
uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

void setup() {
  Serial.begin(115200);
  rtc.begin();
  if (rtc.lostPower()) {
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }
  WiFi.mode(WIFI_STA);
  esp_now_init();
}

void loop() {
  DateTime now = rtc.now();
  char buffer[20];
  sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
  esp_now_send(broadcastAddress, (uint8_t *)buffer, strlen(buffer));
  delay(1000);
}

//📁 GitHub Repository (Download Everything):
https://github.com/danpirate8/esp32-shadow-detector

🛠️ Assembly Tips

  • Power the ESP32-CAM with a stable 5V USB power bank.
  • Wrap the unit in electrical tape or 3D print a custom enclosure.
  • For the master unit, use a perfboard or PCB for secure mounting.
  • Keep the RTC battery installed for long-term sync reliability.

🎯 Why This Project Matters

Paranormal investigators often face challenges validating shadow phenomena. This system provides a scientific method of logging visual anomalies with time-synced evidence. Best of all, it’s portable, inexpensive, and open-source.


💬 Join the Paranormal Tech Movement

We’re excited to share more ghost tech builds. Whether you’re a DIYer or an investigator, this is just the beginning.

📩 Got questions or want to build this yourself? Comment below or follow @sandiegohaunted for updates and walkthroughs.


📁 GitHub Repository (Download Everything):
https://github.com/danpirate8/esp32-shadow-detector