ESP32-based camera trap with PIR sensor.
The project aimed to create a cameratrap system. It uses a PIR motion sensor along with the ESP32-CAM microcontroller equipped with an OV2640 camera and a microSD card reader. The camera captures images in response to the PIR motion sensor signal and saves them on the microSD card. Additionally, the ESP32 enables remote access to the system via WiFi, allowing for viewing of captured photos and live view from the camera through a web browser.
The functionalities of the project include:
- Motion Detection: The device can detect motion using a PIR sensor.
- Instant Photo Capture: Upon detecting motion, the camera immediately captures a photo.
- Storage: Captured photos are saved onto a microSD card for storage.
- Remote Photo Browsing: User can remotely browse through a list of all photos taken by the camera.
- Photo Preview: The system enables user to select a specific photo from the list and view its preview in full resolution.
- Real-time Camera Stream: Users can remotely access and stream live camera footage.
The picture below illustrates the real system setup on a breadboard.
Below is a demonstration of live video streaming and viewing it in a web browser at /stream.
A demonstration of the list of photos taken by the camera and saved on the microSD card at /view.
When motion is detected by the PIR sensor, a photo is automatically taken.
Special thanks to the me-no-dev.
Thanks to his code from one of his GitHub gists, I was able to add functionality to the application for streaming live view from the camera.
The gist I mentioned: https://gist.github.com/me-no-dev/d34fba51a8f059ac559bf62002e61aa3
Another thanks to me-no-dev for the library ESPAsyncWebServer which I used to run the server on my ESP32.
GitHub Repository of the library: https://github.com/me-no-dev/ESPAsyncWebServer