{"id":82418,"date":"2019-12-10T07:08:00","date_gmt":"2019-12-10T07:08:00","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=82418"},"modified":"2025-04-12T16:43:03","modified_gmt":"2025-04-12T16:43:03","slug":"esp32-cam-video-streaming-face-recognition-arduino-ide","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/","title":{"rendered":"ESP32-CAM Video Streaming and Face Recognition with Arduino IDE"},"content":{"rendered":"\n<p>This article is a quick getting started guide for the ESP32-CAM board. We\u2019ll show you how to setup a video streaming web server with face recognition and detection in less than 5 minutes with Arduino IDE. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82419\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclgreen\"><strong>Note: <\/strong> in this tutorial we use the example from the arduino-esp32 library. This tutorial doesn\u2019t cover how to modify the example. <\/p>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> Unfortunately, the latest version of the example no longer covers face detection and recognition.<\/p>\n\n\n\n<p><strong>Related project:<\/strong> <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">ESP32-CAM Video Streaming Web Server<\/a> (works with Home Assistant and Node-Red)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Watch the Video Tutorial<\/h2>\n\n\n\n<p>You can watch the video tutorial or keep reading this page for the written instructions.<\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/MicAM_A0_lU?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>To follow this tutorial you need the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32-CAM with OV2640<\/a><\/strong> &#8211; read <a aria-label=\"Best ESP32-CAM Dev Boards (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-camera-cam-boards-review-comparison\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best ESP32-CAM Dev Boards<\/a><\/li>\n\n\n\n<li><a aria-label=\"FTDI programmer (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">FTDI programmer<\/a><\/li>\n\n\n\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\">Female-to-female jumper wires<\/a><\/li>\n<\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing the ESP32-CAM<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82440\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>The <a rel=\"noreferrer noopener\" aria-label=\"ESP32-CAM (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\">ESP32-CAM<\/a> is a very small camera module with the ESP32-S chip that costs approximately $10. Besides the OV2640 camera, and several GPIOs to connect peripherals, it also features a microSD card slot that can be useful to store images taken with the camera or to store files to serve to clients.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"627\" height=\"350\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-can-labeled.jpeg?resize=627%2C350&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82439\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-can-labeled.jpeg?w=627&amp;quality=100&amp;strip=all&amp;ssl=1 627w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-can-labeled.jpeg?resize=300%2C167&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/www.seeedstudio.com\/media\/catalog\/product\/cache\/ef3164306500b1080e8560b2e8b5cc0f\/b\/a\/bazaar1003542_esp32cam2.jpg\" target=\"_blank\" rel=\"noreferrer noopener nofollow\" aria-label=\"Image source (opens in a new tab)\">Image source &#8211; Seeed Studio<\/a><\/figcaption><\/figure><\/div>\n\n\n<p>The <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"ESP32-CAM (opens in a new tab)\">ESP32-CAM<\/a> doesn\u2019t come with a USB connector, so you need an <a rel=\"noreferrer noopener\" aria-label=\"FTDI programmer (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\">FTDI programmer<\/a> to upload code through the <span class=\"rnthl rntclgreen\">U0R<\/span> and <span class=\"rnthl rntclblue\">U0T<\/span> pins (serial pins).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/FTDI-programmer-ESP32-CAM.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82422\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/FTDI-programmer-ESP32-CAM.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/FTDI-programmer-ESP32-CAM.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Features<\/h2>\n\n\n\n<p>Here is a list with the ESP32-CAM features:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The smallest 802.11b\/g\/n Wi-Fi BT SoC module<\/li>\n\n\n\n<li>Low power 32-bit CPU,can also serve the application processor<\/li>\n\n\n\n<li>Up to 160MHz clock speed, summary computing power up to 600 DMIPS<\/li>\n\n\n\n<li>Built-in 520 KB SRAM, external 4MPSRAM<\/li>\n\n\n\n<li>Supports UART\/SPI\/I2C\/PWM\/ADC\/DAC<\/li>\n\n\n\n<li>Support OV2640 and OV7670 cameras, built-in flash lamp<\/li>\n\n\n\n<li>Support image WiFI upload<\/li>\n\n\n\n<li>Support TF card<\/li>\n\n\n\n<li>Supports multiple sleep modes<\/li>\n\n\n\n<li>Embedded Lwip and FreeRTOS<\/li>\n\n\n\n<li>Supports STA\/AP\/STA+AP operation mode<\/li>\n\n\n\n<li>Support Smart Config\/AirKiss technology<\/li>\n\n\n\n<li>Support for serial port local and remote firmware upgrades (FOTA)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">ESP32-CAM Pinout<\/h2>\n\n\n\n<p>The following figure shows the ESP32-CAM pinout (AI-Thinker module).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-pinout-1.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"235\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-pinout-1.png?resize=547%2C235&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp32-cam pinout ai-thinker module \" class=\"wp-image-82424\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-pinout-1.png?w=547&amp;quality=100&amp;strip=all&amp;ssl=1 547w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-pinout-1.png?resize=300%2C129&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/><\/a><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/www.seeedstudio.com\/media\/catalog\/product\/cache\/ef3164306500b1080e8560b2e8b5cc0f\/b\/a\/bazaar1003541_esp32cam3.jpg\" target=\"_blank\" rel=\"noreferrer noopener nofollow\" aria-label=\"Image source (opens in a new tab)\">Image source &#8211; Seeed Studio<\/a><\/figcaption><\/figure><\/div>\n\n\n<p>There are three <span class=\"rnthl rntcblack\">GND<\/span> pins and two pins for power: either <span class=\"rnthl rntcred\">3.3V<\/span> or <span class=\"rnthl rntcred\">5V<\/span>. <\/p>\n\n\n\n<p><span class=\"rnthl rntclblue\">GPIO 1<\/span> and <span class=\"rnthl rntclgreen\">GPIO 3<\/span> are the serial pins. You need these pins to upload code to your board. Additionally, <span class=\"rnthl rntclgray\">GPIO 0<\/span> also plays an important role, since it determines whether the ESP32 is in flashing mode or not. When <span class=\"rnthl rntclgray\">GPIO 0<\/span> is connected to <span class=\"rnthl rntcblack\">GND<\/span>, the ESP32 is in flashing mode. <\/p>\n\n\n\n<p>The following pins are internally connected to the microSD card reader:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GPIO 14: CLK<\/li>\n\n\n\n<li>GPIO 15: CMD<\/li>\n\n\n\n<li>GPIO 2: Data 0<\/li>\n\n\n\n<li>GPIO 4: Data 1 (also connected to the on-board LED)<\/li>\n\n\n\n<li>GPIO 12: Data 2<\/li>\n\n\n\n<li>GPIO 13: Data 3<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Video Streaming Server<\/h2>\n\n\n\n<p>Follow the next steps to build a video streaming web server with the ESP32-CAM that you can access on your local network. <\/p>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> Make sure you have your Arduino IDE updated as well as the latest version of the ESP32 add-on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install the ESP32 add-on<\/h3>\n\n\n\n<p>In this example, we use Arduino IDE to program the ESP32-CAM board. So, you need to have Arduino IDE installed as well as the ESP32 add-on. Follow the next tutorial to install the ESP32 add-on, if you haven&#8217;t already:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/installing-esp32-arduino-ide-2-0\/\" title=\"\">Installing ESP32 Board in Arduino IDE 2 (Windows, Mac OS X, Linux)<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. CameraWebServer Example Code<\/h3>\n\n\n\n<p>In your Arduino IDE, go to <strong>File <\/strong>&gt; <strong>Examples <\/strong>&gt; <strong>ESP32 <\/strong>&gt; <strong>Camera <\/strong>and open the <strong>CameraWebServer<\/strong> example.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"713\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/Arduino-ide-esp32-cam-camerawebserver-example.png?resize=823%2C713&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM in Arduino IDE CameraWebServer example\" class=\"wp-image-159070\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/Arduino-ide-esp32-cam-camerawebserver-example.png?w=823&amp;quality=100&amp;strip=all&amp;ssl=1 823w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/Arduino-ide-esp32-cam-camerawebserver-example.png?resize=300%2C260&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/Arduino-ide-esp32-cam-camerawebserver-example.png?resize=768%2C665&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 823px) 100vw, 823px\" \/><\/figure><\/div>\n\n\n<p>The following code should load.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"610\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/arduino-ide-camerawebserver-example.png?resize=666%2C610&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 CameraWebServer Example\" class=\"wp-image-159071\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/arduino-ide-camerawebserver-example.png?w=666&amp;quality=100&amp;strip=all&amp;ssl=1 666w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/arduino-ide-camerawebserver-example.png?resize=300%2C275&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/figure><\/div>\n\n\n<p>Before uploading the code, you need to insert your network credentials in the following variables:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>const char* ssid = \"REPLACE_WITH_YOUR_SSID\";\nconst char* password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n\n\n\n<p>Then, make sure you select the right camera module. In this case, we\u2019re using the AI-THINKER Model. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82445\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>So, comment all the other models and uncomment the <span class=\"rnthl rntliteral\">CAMERA_MODEL_AI_THINKER<\/span>:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Select camera model\n\/\/#define CAMERA_MODEL_WROVER_KIT\n\/\/#define CAMERA_MODEL_ESP_EYE\n\/\/#define CAMERA_MODEL_M5STACK_PSRAM\n\/\/#define CAMERA_MODEL_M5STACK_WIDE\n#define CAMERA_MODEL_AI_THINKER<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-camera-webserver-select-camera-model.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"493\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-camera-webserver-select-camera-model.png?resize=666%2C493&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-159073\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-camera-webserver-select-camera-model.png?w=666&amp;quality=100&amp;strip=all&amp;ssl=1 666w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-camera-webserver-select-camera-model.png?resize=300%2C222&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/a><\/figure><\/div>\n\n\n<p>If none of the available options correspond to the camera you\u2019re using, you need to add the pin assignment for your specific board in the <em><strong>camera_pins.h<\/strong><\/em> tab.<\/p>\n\n\n\n<p>Now, the code is ready to be uploaded to your ESP32.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mce_111\">3. ESP32-CAM Upload Code<\/h3>\n\n\n\n<p>Connect the ESP32-CAM board to your computer using an FTDI programmer. Follow the next schematic diagram:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"532\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=877%2C532&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM connected to an FTDI Programmer to upload program using Arduino IDE\" class=\"wp-image-159060\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?w=877&amp;quality=100&amp;strip=all&amp;ssl=1 877w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=300%2C182&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=768%2C466&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><\/figure><\/div>\n\n\n<p>Many FTDI programmers have a jumper that allows you to select 3.3V or 5V. Make sure the jumper is in the right place to select 5V.<\/p>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> <span class=\"rnthl rntclgray\">GPIO 0<\/span> needs to be connected to <span class=\"rnthl rntcblack\">GND<\/span> so that you\u2019re able to upload code.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>ESP32-CAM<\/strong><\/td><td><strong>FTDI Programmer<\/strong><\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>5V<\/td><td>VCC (5V)<\/td><\/tr><tr><td>U0R<\/td><td>TX<\/td><\/tr><tr><td>U0T<\/td><td>RX<\/td><\/tr><tr><td>GPIO 0<\/td><td>GND<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>To upload the code, follow the next steps:<\/p>\n\n\n\n<p>1) Go to <strong>Tools <\/strong>&gt; <strong>Board <\/strong>and select <strong>AI-Thinker ESP32-CAM<\/strong>.<\/p>\n\n\n\n<p>2) Go to <strong>Tools <\/strong>&gt; <strong>Port <\/strong>and select the COM port the ESP32 is connected to.<\/p>\n\n\n\n<p>3) Then, click the upload button to upload the code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/05\/arduino-ide-2-upload-button.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"36\" height=\"39\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/05\/arduino-ide-2-upload-button.png?resize=36%2C39&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino IDE 2 Upload Button\" class=\"wp-image-146269\"\/><\/a><\/figure><\/div>\n\n\n<p>4) When you start to see some dots on the debugging window, you may need to press the ESP32-CAM on-board RST button if it doesn\u2019t go automatically into flashing mode.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"91\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=1009%2C91&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-91746\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?w=1009&amp;quality=100&amp;strip=all&amp;ssl=1 1009w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=300%2C27&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=768%2C69&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/figure>\n\n\n\n<p>After a few seconds, the code should be successfully uploaded to your board.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"610\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/upload-camerawebserver-example-arduino-ide.png?resize=666%2C610&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Upload camerawebserver example arduino ide\" class=\"wp-image-159074\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/upload-camerawebserver-example-arduino-ide.png?w=666&amp;quality=100&amp;strip=all&amp;ssl=1 666w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/upload-camerawebserver-example-arduino-ide.png?resize=300%2C275&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Getting the IP address<\/h2>\n\n\n\n<p>After uploading the code, disconnect <span class=\"rnthl rntclgray\">GPIO 0<\/span> from <span class=\"rnthl rntcblack\">GND<\/span>.<\/p>\n\n\n\n<p>Open the Serial Monitor at a baud rate of 115200. Press the ESP32-CAM on-board Reset button.<\/p>\n\n\n\n<p>The ESP32 IP address should be printed in the Serial Monitor.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"692\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/camerawebserver-example-get-ip-address.png?resize=666%2C692&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Camerawebserver example get IP address Arduino IDE ESP32-CAM\" class=\"wp-image-159075\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/camerawebserver-example-get-ip-address.png?w=666&amp;quality=100&amp;strip=all&amp;ssl=1 666w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/camerawebserver-example-get-ip-address.png?resize=289%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 289w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Accessing the Video Streaming Server<\/h2>\n\n\n\n<p>Now, you can access your camera streaming server on your local network. Open a browser and type the ESP32-CAM IP address. Press the <strong>Start Streaming<\/strong> button to start video streaming. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"407\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?resize=750%2C407&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82436\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?resize=300%2C163&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>You also have the option to take photos by clicking the <strong>Get Still<\/strong> button. Unfortunately, this example doesn\u2019t save the photos, but you can modify it to use the on board microSD Card to store the captured photos.<\/p>\n\n\n\n<p>There are also several camera settings that you can play with to adjust the image settings.<\/p>\n\n\n\n<p>Finally, you can do face recognition and detection. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"411\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-cam-intruder-alert.jpg?resize=750%2C411&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82451\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-cam-intruder-alert.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-cam-intruder-alert.jpg?resize=300%2C164&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>First, you need to enroll a new face. It will make several attempts to save the face.  After enrolling a new user, it should detect the face later on (subject 0).  <br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"391\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-face-recognition-detection.jpg?resize=750%2C391&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-82450\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-face-recognition-detection.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-face-recognition-detection.jpg?resize=300%2C156&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>And that\u2019s it. Now you have your video streaming web server up and running with face detection and recognition with the example from the library. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p>If you\u2019re getting any of the following errors, read our&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-troubleshooting-guide\/\"><strong>ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed<\/strong><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Failed to connect to ESP32: Timed out waiting for packet header<\/li>\n\n\n\n<li>Camera init failed with error 0x20001 or similar<\/li>\n\n\n\n<li>Brownout detector or Guru meditation error<\/li>\n\n\n\n<li>Sketch too big error \u2013 Wrong partition scheme selected<\/li>\n\n\n\n<li>Board at COMX is not available \u2013 COM Port Not Selected<\/li>\n\n\n\n<li>Psram error: GPIO isr service is not installed<\/li>\n\n\n\n<li>Weak Wi-Fi Signal<\/li>\n\n\n\n<li>No IP Address in Arduino IDE Serial Monitor<\/li>\n\n\n\n<li>Can\u2019t open web server<\/li>\n\n\n\n<li>The image lags\/shows lots of latency<\/li>\n<\/ul>\n\n\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"94673\" class=\"elementor elementor-94673\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2689e44b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2689e44b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7490d123\" data-id=\"7490d123\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-35934f78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"35934f78\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-3de108d9\" data-id=\"3de108d9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5aca63ab elementor-widget elementor-widget-image\" data-id=\"5aca63ab\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"334\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?fit=334%2C334&amp;quality=100&amp;strip=all&amp;ssl=1\" class=\"attachment-full size-full wp-image-94555\" alt=\"\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?w=334&amp;quality=100&amp;strip=all&amp;ssl=1 334w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 334px) 100vw, 334px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-4bd084e0\" data-id=\"4bd084e0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-517cf0fa elementor-widget elementor-widget-heading\" data-id=\"517cf0fa\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">[eBook] Build ESP32-CAM Projects using Arduino IDE<\/a><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3438ea70 elementor-hidden-phone elementor-widget elementor-widget-text-editor\" data-id=\"3438ea70\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE\u00a0<strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-674524a5 elementor-hidden-desktop elementor-hidden-tablet elementor-widget elementor-widget-text-editor\" data-id=\"674524a5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE <strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>The ESP32-CAM provides an inexpensive way to build more advanced home automation projects that feature video, taking photos, and face recognition. <\/p>\n\n\n\n<p>In this tutorial we&#8217;ve tested the CameraWebServer example to test the camera functionalities. Now, the idea is to modify the example or write a completely new code to build other projects. For example, <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-pir-motion-detector-photo-capture\/\">take photos and save them to the microSD card when motion is detected<\/a>, <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">integrate video streaming in your home automation platform (like Node-RED or Home Assistant)<\/a>, and much more.<\/p>\n\n\n\n<p>We hope you&#8217;ve find this tutorial useful. If you don&#8217;t have an ESP32-CAM yet, you can <a rel=\"noreferrer noopener\" aria-label=\"grab it here (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\">grab it here<\/a>. <\/p>\n\n\n\n<p>If you like this project, you may also like other projects with the ESP32-CAM:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">ESP32-CAM Video Streaming Web Server<\/a> (works with Home Assistant and Node-RED)<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-save-microsd-card\/\">ESP32-CAM Take Photo and Save to MicroSD Card<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-pir-motion-detector-photo-capture\/\">ESP32-CAM PIR Motion Detector with Photo Capture (saves to microSD card)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-display-web-server\/\">ESP32-CAM Take Photo and Display in Web Server<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\"><strong>Build ESP32-CAM Projects (eBook)<\/strong><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32-cam\/\"><strong>Read all our ESP32-CAM Projects, Tutorials and Guides<\/strong><\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This article is a quick getting started guide for the ESP32-CAM board. We\u2019ll show you how to setup a video streaming web server with face recognition and detection in less &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32-CAM Video Streaming and Face Recognition with Arduino IDE\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/#more-82418\" aria-label=\"Read more about ESP32-CAM Video Streaming and Face Recognition with Arduino IDE\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":82419,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[281,276,277,319,264,257],"tags":[],"class_list":["post-82418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp32","category-esp32-arduino-ide","category-esp32-cam","category-project","category-web-server-2"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-getting-started.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/82418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=82418"}],"version-history":[{"count":4,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/82418\/revisions"}],"predecessor-version":[{"id":168884,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/82418\/revisions\/168884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/82419"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=82418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=82418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=82418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}