DIY Home Surveillance System Using ESP32 and Camera

DIY Home Surveillance System Using ESP32 and Camera

“Great, no one has written a tutorial, so I will write one!”This article is from the Breadboard Community DIY Contest. If you have a DIY project, feel free to share your electronic design and take home a DJI drone!
DIY Home Surveillance System Using ESP32 and Camera
Project Origin
I saw a video where someone used only an ESP32 development board and a camera to create a home surveillance camera that allows viewing through the network. Such a cool thing! I wanted to learn more but found out that it was either a paid course or I had to buy their products… Great, no one has written a tutorial, so I will write one! I happen to have a test development board, so why not arrange it?
Preparation
  • Use an ESP32 development board;
  • Use an FPC camera model OV2640;
  • Install Arduino IDE on the computer for programming the ESP32 development board;
  • Use Peanut Shell on the computer to penetrate the intranet, allowing external access to the camera data;
Project Execution
The execution of this project will be divided into two parts: hardware and software.
Hardware Part
Development Board Introduction
My development board is the Lichuang ESP32S3 development board currently under review.
DIY Home Surveillance System Using ESP32 and Camera
Camera Introduction
The camera uses an FPC OV2640 camera.
DIY Home Surveillance System Using ESP32 and Camera
Connecting the Development Board and Camera
Since the camera is in FPC form, we also need to consider how to drive it, so I designed a peripheral circuit specifically for driving this camera with the development board. I won’t elaborate on the principles here; just copy it.DIY Home Surveillance System Using ESP32 and Camera DIY Home Surveillance System Using ESP32 and Camera
Software Part
Install Arduino IDE for programming.
Arduino Introduction
Arduino is an open-source hardware and software platform used to build and control various physical devices and interactive projects. It consists of an open-source software development environment. The Arduino programming language is a simple, easy-to-understand language based on C/C++. The simplicity, flexibility, and readily available resources of Arduino, along with its rich application areas, make it a popular and widely used development platform. Both beginners and professional developers can quickly develop and innovate using it.
Installing Arduino IDE
1. Open the Arduino IDE official website download page, select the corresponding system and system bit to download. Here I choose the latest Windows 10 64-bit environment.DIY Home Surveillance System Using ESP32 and Camera
2. In the pop-up new interface, you can choose to download directly or choose to donate and download.DIY Home Surveillance System Using ESP32 and Camera
3. Run the installer, just keep clicking next. (It is recommended not to save it on the C drive when setting the installation path)
Installing the ESP32 Package
1. Download the ESP32 offline installation tool. Link:https://pan.baidu.com/s/1zocFRBlMveMA00QhmzkKKA?pwd=1234 Extraction code: 1234
2. Choose the installation path. Note that it should be placed in the corresponding user’s Arduino device package directory. The following is the installation path for Arduino IDE V2.2.1:
C:\Users\{username}\AppData\Local\Arduino15\packages\
For example, if the username is win:
C:\Users\win\AppData\Local\Arduino15\packages
DIY Home Surveillance System Using ESP32 and Camera
After installation, close all Arduino windows to ensure Arduino is closed.
4. Restart Arduino and open the board manager to see that esp32-arduino has been installed successfully.
DIY Home Surveillance System Using ESP32 and Camera
5. Modify the display language to Chinese
Open the Arduino IDE preferences. 【File】->【Preferences】.
DIY Home Surveillance System Using ESP32 and Camera
In the preferences interface, select Chinese (Simplified) in the language.
DIY Home Surveillance System Using ESP32 and Camera
If the IDE hasn’t been updated, close and reopen it.
Source Code Introduction
I have uploaded the source code to Baidu Cloud, feel free to take it:
Link: https://pan.baidu.com/s/1QEUrwIl7IBxbApNx-Ka9qg?pwd=1234 Extraction code: 1234
Workflow
Initialize debug serial port -> Initialize camera -> Initialize WIFI -> Output the IP address displaying image data
1. Initializing the debug serial port is very common and important in embedded systems, as our bug debugging will rely on the data output to analyze.
2. Initialize the camera
The source code includes the settings for the camera pins. If the pins in your camera’s schematic differ from mine, you can switch any pins by modifying the code. However, note that I found that GPIO45 and GPIO46 on the ESP32S3 development board cannot be used where there are pull-up resistors; otherwise, the development board will not work properly!
DIY Home Surveillance System Using ESP32 and Camera
3. Initialize WIFI
The source code includes the settings for WIFI. This WIFI allows the ESP32S3 development board to connect to it, enabling the board to output image data to the network. Later, we just need to copy the IP address output during serial debugging into the browser to see the camera’s view.
Please input the WIFI account and password that the development board will connect to in the source code, ensuring that this WIFI has internet access.
DIY Home Surveillance System Using ESP32 and Camera
4. Compile and download
After modifying the WIFI and camera settings, connect the development board with the following parameters:
Select our board as ESP32S3 Dev Module;
DIY Home Surveillance System Using ESP32 and Camera
Select our port number; here we choose COM36 for CH340K;
Each computer’s port may differ; you can determine which port is for the ESP32S3 development board by plugging and unplugging the board.
DIY Home Surveillance System Using ESP32 and Camera
Click the download button, which will automatically compile and download;
DIY Home Surveillance System Using ESP32 and Camera
If the image below appears, it indicates that the download was successful. If the download fails, please ensure that the correct download port is selected.
DIY Home Surveillance System Using ESP32 and Camera
Camera Verification Test
1. Open the serial debugging assistant. If you don’t have a debugging assistant, you can use the built-in serial assistant in Arduino. However, ensure that you select the correct port.
DIY Home Surveillance System Using ESP32 and Camera
2. After downloading the code, press the RESET button on the development board once to reset it. If there is no button, power cycle the development board.
3. If everything goes smoothly, the serial debugging assistant will display an IP address. (The disconnection here is because I unplugged the development board to take pictures.)
DIY Home Surveillance System Using ESP32 and Camera
4. Use your phone or computer to connect to the WIFI set in the code. You must connect! After connecting, open the browser and enter this IP address to access it. Each person’s IP address should be different. If successful, you will enter the webpage shown below. (Note! This is a test; it is in the local area network. If you disconnect from this WIFI, you will not be able to access it.)DIY Home Surveillance System Using ESP32 and Camera Click on Start Stream on the page to start image transmission. If everything goes well, you should see the camera interface.DIY Home Surveillance System Using ESP32 and CameraPhysical AppearanceDIY Home Surveillance System Using ESP32 and Camera
Intranet Penetration
Intranet penetration allows our local area network (intranet) to become the internet (external network), so as long as we have a URL, we can view the camera’s image anytime and anywhere. You can use a software called Peanut Shell on your computer. Download link:https://hsk.oray.com/.
This software requires payment to unlock the intranet penetration feature. I just learned this. If any expert knows free resources, please let me know (covers mouth and cries).
Add intranet penetration mapping. (A webpage will pop up)DIY Home Surveillance System Using ESP32 and Camera
In the pop-up window, enter the following parameters.DIY Home Surveillance System Using ESP32 and Camera
Once completed, power on the development board. Note! Do not connect to other WIFI; otherwise, the IP address will change. After powering on, click on diagnostics to see if the intranet penetration was successful. If successful, it will look like this:
DIY Home Surveillance System Using ESP32 and Camera
If there are no issues, we can proceed to the external network test. Click on the external network domain name.
DIY Home Surveillance System Using ESP32 and Camera
Or enter the domain name in the browser. If the following interface appears, it indicates that our surveillance camera is complete!DIY Home Surveillance System Using ESP32 and Camera
Authora老怪, Source: Breadboard Community
This article is from the Breadboard Community DIY Contest. If you have a DIY project, feel free to share your electronic design and take home a DJI drone!
END

DIY Home Surveillance System Using ESP32 and Camera

Exciting DIY Articles
1、Hardcore! From schematic to BOM list, recording the birth of an air wave pressure therapy device
2For embedded systems, mastering MATLAB is a piece of cake!

3、Older hardware is indeed more valuable!

4、So crowded, how many layers of boards? Check out the logic level tester designed by the expert

Leave a Comment

Your email address will not be published. Required fields are marked *