The ESP32-CAM is a small board that features a chip paired with a camera, suitable for a project tasks. It shoots and retain high-quality images is of the utmost importance in a particular situation. Combined with PIR motion detector, it can detect movement and then automatically take pictures. It directly saved onto a SD card.
The primary function of your system is to capture images using the ESP32-CAM. This is triggered by specific events. The system uses the camera module to capture images in JPEG format, which are then ready to be processed or saved. After capturing the images, the system saves them onto an SD card. This is critical for applications where the images need to be reviewed later, such as in security systems, wildlife monitoring, or any form of remote observation. The SD card integration ensures that large amounts of data can be stored without relying on continuous connectivity to offload the data.

Components:

Connections:
ESP32 CAM – UART CP2102

ESP32 CAM – PIR Motion Sensor
ESP 32 CAM | PIR Motion Sensor |
3.3V | VCC |
GND | GND |
GPIO 13 | OUT |
Note:
- To upload the code, Go to Tools > Board and select AI-Thinker ESP32-CAM.
- Go to Tools > Port and select the COM port the ESP32 is connected to.
- Go to Files > Examples > ESP32 CAM > Camera > and select the CameraWebServer.

- Go to CameraWebServer.ino. Remove the default code and copy the code below.
- 100 and GND need to connect to successfully upload.
- Upon upload the code, remove 100 pins and GND pins. To successfully start the system restart the ESP32 CAM.
Code:
Troubleshooting:
- Upon upload the code, remove 100 pins and GND pins. To successfully start the system restart the ESP32 CAM.
- Use the serial monitor to watch for debug prints and errors during testing. This will provide insights if something goes wrong.
- Make sure the SD card is formatted correctly (typically FAT32) and ensure that the card is not corrupted. This is important for successful mounting and file operations.
QUICK LINKS
Reference Tutorial : Credits to the code provided by Rui Santos