ESP32Cam for projects
By Andy Yeh (2025-2026)
By Andy Yeh (2025-2026)
The ESP32 Camera Board has been around since 2019 and was made popular with the model built by AI-Thinker. Since then, there were many clones available on Aliexpress, with price went as low as AUD$9 (normally at about AUD$15) for a complete set, which includes an ESP32Cam board with OV2640 camera or compatible camera, a shield or mainboard, and an external antenna.
The ESP32Cam board itself could be programmed for different applications, such as the ESP32-Cam Car project. With the main board or shield, it is much easier to program and deploy. Since its release, there has been a few projects on GitHub. Unfortunately, many have stopped developing and with the updated ESP32 boards library, applications such as visial recognition and AI have become absolete due to the demand of computing, and this early ESP32 board is now considerred not powerful enough to do visual recognition tasks. However, it is still a very affordable solution if your project requires wireless visual monitoring. In this project, we will be turning this ESP32Cam into a IP Camera. We will start setting up without using its external antenna. So in this case, you may need to get closer to your home router for better Wifi signal for the ESP32Cam.
You should have the ESP32Cam, a micro SD card (up to 32GB only formated as FAT32 file system) ready, and have Arduino IDE installed with ESP32 board manager added first.
To make a security/monitoring camera, we will use this GitHub repository at https://github.com/s60sc/ESP32-CAM_MJPEG2SD.
1. Download the Zipped codes
2. Unzip and rename the folder
3. Enter the folder and open the .ino into Arduino IDE
You can now connect ESP32Cam to computer. It should show up in a COM port (windows) or a device as /dev/cu.usbmodemxxxxx (masOS) In Arduino IDE.
If your computer cannot recognise the ESP32Cam connected through USB, then you may need to install the official CH340 driver.
If your computer recognised the ESP32Cam board on the connected USB port, then in the Arduino IDE, you should choose the Board "AI Thinker ESP32-Cam" and the COM serial port of the ESP32-Cam board, such as in the image on the right.
In the appGlobals.h file, change the INCLUDE_PERIPH to true. This will enable the onboard LED (Lamp) control.
Before compiling and uploading the program (sketch), we suggest that you enable the peripheral (1 & 2) as show in the image on the left. Then you can click on the Upload button (3) to compile and upload the program.
Compiling and uploading the program may take some time between 10 seconds to over a minute depending on the speed of your computer. You should be seeing the progress in the Output panel in Arduino IDE. Once compiled, it will start uploading and again showing progress. When done uploading, the output message will prompt you to press reset key on the ESP32Cam board to run the camera program.
Before pressing the reset key (on the main board or on ESP32Cam board), you need to have a SD card inserted (under and up to 32GB should work but needs to format as FAT32). You could also open the Serial Monitor so you could get the ESP32Cam starting message and instructions on how to do initial setup.
When boot-up, the ESP32Cam will start a Wifi access point (AP) as ESP32-Cam_XXXXXX and a web server. You can use your laptop or PC if it has Wifi network, or simply use your mobile phone to search the camera's AP and connect. There is no password required. Once connected, open a browser and type in IP address: 192.168.4.1 to connect to its website, where you can provide your home Wifi network to the camera.
Note that the Wifi network needs to be 2.4GHz with security up to WPA2-Person/AES. Higher security setting will not work for the ESP32Cam.
Once SSID and Password are provided, click/tap on Connect button to proceed. The web page will prompt that it is going to restart. Click/Tap Ok to proceed.
You can then see in the Serial Monitor in Arduino IDE that the ESP32Cam is restarting, and eventually it will show you a local IP it acquired from your home router. Congrats if you are up to this step. You can now on your computer, open a browser to point to the IP address of the camera to see the full user interface of the ESP32Cam. If the ESP32Cam did not connect to local network, you can always join its AP and visit 192.168.4.1 to change its settings.
When this page was writtem, I have also updated my ESP32Cam to version 10.9.3 of this GitHub repository at https://github.com/s60sc/ESP32-CAM_MJPEG2SD. This repository is updating frequently so if you are following the instructions in this page, you may have downloaded a new version of the camera program.
From the camera's web interface, you will find that this camera program is multi-functional. There are so many settings and functions to try, but we suggest some critiical settings and key functions to try as below.
Trouble shooting: If connecting to a guest network, some routers may prevent guest devices to ping the router but the camera program has the default behaviour to ping the router to confirm netowrk connection is successful. So if connecting to a guest network caused ping issue, you need to connect to just local network first, then you can turn off the ping and return to guest network later.
The first setting to change is to turn off Motion Detect as it will slow down the web interface when recording detected motion. Remember to Save Settings and you could change it back when you need motion detection.
Next, you could try camera streaming, get still, or recording, when in the Camera Control menu. The Lamp slider could turn the onboard LED on/off with different level of brightness. You could also try different resolutions of the camera. The microphone, volume and tilt/pan will have no effect as we have no such connections to speakers, microphone, and servo motors in this bare setting.
Note: At the bottom of screen you could see Wifi Signal Strength. Good signal is between -20 dBm to -60 dBm. Up to -70 dBm may still be OK but over -70 dBm would cause slow video streaming and connection issue.
You could also play with the third icon "Playback & File Transfers", and the fourth icon "Picture Settings". Then we can move to the fifth icon "Access Settings" for some important settings.
In Access Settings, give the camera a Host Name, and Time Zone by selecting Region and Location.
We can skip the FTP and SMTP settings for now.
The Authentication settings are highly recommended. Provide a web login name and password so the camera's web UI will only be accessible by those who know the login name and password. The Use HTTPS is recommended when later if you wish to expose the camera to the Internet.
Remember to click on Save Settings after you provided those information but no need to Reboot ESP yet. We still have some important settings to do in the Edit Config.
Before Edit Config, you could click on Show Log to see camera logs. The logs are the same as seen in the Serial Monitor in Arduino IDE.
There are so many functions to try, but two (Network and Streaming) are essential to try.
In Network, you can set the AP SSID name and password of the ESP32Cam. It is important to have a strong password to protect access. The Use ping should be disabled if your ESP32Cam is connecting to a network (e.g., guest wifi) that cannot ping the router. Disable the Use ping before changing to the Guest Wifi SSID and Password in Access Settings.
In the Streaming settings, the Enable NVR Video stream: /sustain?video=1 is very useful for video feed into Thingsboard dashboard and Home Assistant. Once enabled, the camera can stream in browsers from its IP address http://192.168.1.xxx/sustain?video=1. When done, click on Save then Reboot ESP to apply.
Now, you should have a working ESP32-Camera accessible through browsers. To make it more practical, using an external antenna to extend its Wifi range and applying a case could better protect the camera. To use the external antenna, please see the explanation in this video, then the method 2 soldering iron in this video.
For the casing, I remixed the ESP32-CAM Enclosure project on Thingiverse to add the ears for screws and a bottom hole for fixing a M6 gooseneck stick. You can download the STL files from my Tinkercad remix here. Below are some photos of 3D printed casing and assembly.
So far I have deployed two ESP32-Cams for the IoT: Plant Environment Monitoring project and Shed IoT project at home. Because I have set user name and password to access the camera, so you won't be able to turn on the camera feed. I have captured two images of viewing the camera feed in the Thingsboard dashboards for the two projects below.
As seen in the images above, I created two widgets in the dashboard. The Camera View widget and Export Telemetry Data widget. I will report them in another project. The telemetry data are useful for data literacy and weather science investigations in integrated STEM education, which are my main purpose of creating maker projects.
Please leave a comment or ask questions if any below.