Make an ESP32 WiFi CCTV Camera in 22 Steps (ESP32-CAM) DIY Wireless Security Cam
Introduction: Make an ESP32 WiFi CCTV Camera in 22 Steps (ESP32-CAM) DIY Wireless Security Cam
Hey, fellow makers! I welcome you to my first instructable about this Homemade wireless ESP32-CAM WiFi Surveillance Camera which we're going to make today to monitor our home, environment, or perhaps to even spy on someone ;)
Even though decent commercial WiFi Security Cameras aren't all super expensive, they still cost quite a bit especially when you're wanting to buy several of them for your home security. In this instructable, you will learn how to make your own DIY Surveillance camera for cheap, under $15 depending on the supplies you may already have. This project will be based on the $9 ESP32-CAM AI thinker WiFi camera module, in my opinion, one of the best and cheapest camera development boards out there.
With this security camera, you can log into the web server by typing in its unique IP address into your web browser, and view what the camera sees along with being able to change things around on the side control panels. The camera with its current code can save recorded .MJPEG video files to an SD card when something/someone moves in front of the camera triggering it to start recording. The Security camera comes loaded with even more features which will be mentioned below.
So without taking up any more of your time, let's prepare to make this CCTV cam!
You may also want to watch the project's YouTube video. 375
Link:
https://youtu.be/0uz-YrfaSO8
Supplies
• ESP32-CAM with OV2640 2MP camera sensor
• FTDI USB to Serial converter (for programming) + Female-to-female jumper wires
• 4GB MicroSD card (TF Card)
• Clip-on antenna
• TP4056 1-cell Li-Ion Charging module
• (x2) 18650 3.7V 2600mAh battery
• Mini SPDT sliding switch (3A toggle switch is recommended)
• Some 24-gauge electrical wire
• 3mm Red LED
• 220 Ohm resistor
• Cylindrical plastic container (choice of camera's enclosure is optional)
• GoPro mount accessories (if you want your camera to be attached to a wall)
Step 1: Programming ESP32-CAM
First, let's upload the ESP32-CAM_MJPEG2SD code to the ESP32-CAM (credits to GitHub user "s60sc" for making their code available for anyone to download) please visit https://github.com/s60sc/ESP32-CAM_MJPEG2SD for more information and specs about the code, as well as the code itself.
To program the camera module, connect the camera module to a USB-to-serial converter "FTDI" like in the diagram seen above, with GPIO pin 0 connecting to GND allowing you to program the ESP. Don't forget to press the onboard reset button on the back of the camera module to set it into flash mode before uploading.
Step 2: Making Sure You've Got the "ESP32 .json Link"
Before we move on to the actual code, check that you have the ESP32 .json link from this website linked below pasted in the preferences tab of the Arduino IDE. This link gives you access to example codes, all of the needed libraries, etc...
https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
Make sure your ESP32 board library version is at 2.0.2 or higher.
Step 3: In the Code: Filling in Necessary Parameters
Open the Security Camera's code which you've downloaded (ESP32-CAM_MJPEG2SD) and fill in the necessary params such as selecting your camera model (uncomment "CAMERA_MODEL_AI_THINKER" if that's your board), enter your WiFi credentials, and lastly, FTP credentials (optional) if you're into getting hold of recorded footage remotely.
This now has to be done in the "utils.cpp" tab. Please don't get it confused for the "myConfig" tab, as that's what has been leading to many errors.
Step 4: Uploading Code to Board
Make sure you select "ESP32 Dev Module" with partition scheme "Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)", enable PSRAM, and select your COM port. Then hit upload. Do know that uploading to the board may take a while, it's totally normal, please be a bit patient :)
Code: https://github. 977