{"id":85920,"date":"2019-12-10T11:06:00","date_gmt":"2019-12-10T11:06:00","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=85920"},"modified":"2024-06-16T15:14:51","modified_gmt":"2024-06-16T15:14:51","slug":"esp32-cam-take-photo-save-microsd-card","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-save-microsd-card\/","title":{"rendered":"ESP32-CAM Take Photo and Save to MicroSD Card"},"content":{"rendered":"\n<p>Learn how to take photos with the ESP32-CAM board and save them to a microSD card using Arduino IDE. When you press the ESP32-CAM RESET button, it wakes up, takes a photo and saves it in the microSD card.<\/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\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM: Take Photo and Save to MicroSD Card\" class=\"wp-image-86296\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.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>We&#8217;ll be using the ESP32-CAM board labelled as AI-Thinker module, but other modules should also work by making the correct pin assignment in the code.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">ESP32-CAM board<\/a> is a $9 device (or less) that combines an ESP32-S chip, an OV2640 camera, a microSD card slot and several GPIO pins.<\/p>\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=\"ESP32-CAM board is a $9 device with an OV2640 camera, microSD card slot and several GPIO pins\" 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>For an introduction to the ESP32-CAM, you can follow the next tutorials:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">ESP32-CAM Video Streaming and Face Recognition with Arduino IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">ESP32-CAM Video Streaming Web Server (works with Home Assistant, Node-RED, etc&#8230;)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-troubleshooting-guide\/\">ESP32-CAM Troubleshooting Guide<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Watch the Video Tutorial<\/h2>\n\n\n\n<p>To learn how to take photos with the ESP32-CAM and save them in the microSD card, you can watch the following video tutorial or keep reading this page for the written instructions and all the resources. <\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/eot6COwCPF0?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=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/microsd-card-raspberry-pi-16gb-class-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">MicroSD card<\/a><\/li>\n\n\n\n<li><a aria-label=\" (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\n\n\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-power-supply\/\" target=\"_blank\" rel=\"noreferrer noopener\">5V power supply for ESP32-CAM<\/a> or power bank (optional)<\/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\">Project Overview<\/h2>\n\n\n\n<p>Here is a quick overview on how the project works.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"712\" height=\"346\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp32-cam-take-photo-save-micro-sd-card.png?resize=712%2C346&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"take photo save to micro sd card ESP32-CAM\" class=\"wp-image-86267\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp32-cam-take-photo-save-micro-sd-card.png?w=712&amp;quality=100&amp;strip=all&amp;ssl=1 712w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp32-cam-take-photo-save-micro-sd-card.png?resize=300%2C146&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>The ESP32-CAM is in deep sleep mode<\/li>\n\n\n\n<li>Press the RESET button to wake up the board<\/li>\n\n\n\n<li>The camera takes a photo<\/li>\n\n\n\n<li>The photo is saved in the microSD card with the name: pictureX.jpg, where X corresponds to the picture number<\/li>\n\n\n\n<li>The picture number will be saved in the ESP32 flash memory so that it is not erased during RESET and we can keep track of the number of photos taken.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Formatting MicroSD Card<\/h2>\n\n\n\n<p>The first thing we recommend doing is formatting your microSD card. You can use the Windows formatter tool or any other microSD formatter software.<\/p>\n\n\n\n<p><strong>1.<\/strong>&nbsp;Insert the microSD card in your computer. Go to&nbsp;<strong>My Computer<\/strong>&nbsp;and right click in the SD card. Select&nbsp;<strong>Format<\/strong>&nbsp;as shown in figure below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/05\/format-SD-card-1.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Formatting your microSD card Windows\" class=\"wp-image-11805\"\/><\/figure><\/div>\n\n\n<p><strong>2.&nbsp;<\/strong>A new window pops up. Select&nbsp;<strong>FAT32<\/strong>, press&nbsp;<strong>Start<\/strong>&nbsp;to initialize the formatting process and follow the onscreen instructions.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/rntlab.com\/wp-content\/uploads\/2018\/05\/format-SD-card-2.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Formatting your microSD card Windows\" class=\"wp-image-11806\"\/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> according to the product specifications, the ESP32-CAM should only support 4 GB SD cards. However, we\u2019ve tested with 16 GB SD card and it works well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the ESP32 add-on<\/h2>\n\n\n\n<p>We&#8217;ll program the ESP32 board using Arduino IDE. So you need the Arduino IDE installed as well as the ESP32 add-on. You can follow the next tutorial to install the ESP32 add-on, if you haven\u2019t 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<h2 class=\"wp-block-heading\">Take and Save Photo Sketch<\/h2>\n\n\n\n<p>Copy the following code to your Arduino IDE. <\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-cam-take-photo-save-microsd-card\n  \n  IMPORTANT!!! \n   - Select Board &quot;AI Thinker ESP32-CAM&quot;\n   - GPIO 0 must be connected to GND to upload a sketch\n   - After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode\n  \n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files.\n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n*********\/\n\n#include &quot;esp_camera.h&quot;\n#include &quot;Arduino.h&quot;\n#include &quot;FS.h&quot;                \/\/ SD Card ESP32\n#include &quot;SD_MMC.h&quot;            \/\/ SD Card ESP32\n#include &quot;soc\/soc.h&quot;           \/\/ Disable brownour problems\n#include &quot;soc\/rtc_cntl_reg.h&quot;  \/\/ Disable brownour problems\n#include &quot;driver\/rtc_io.h&quot;\n#include &lt;EEPROM.h&gt;            \/\/ read and write from flash memory\n\n\/\/ define the number of bytes you want to access\n#define EEPROM_SIZE 1\n\n\/\/ Pin definition for CAMERA_MODEL_AI_THINKER\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM      0\n#define SIOD_GPIO_NUM     26\n#define SIOC_GPIO_NUM     27\n\n#define Y9_GPIO_NUM       35\n#define Y8_GPIO_NUM       34\n#define Y7_GPIO_NUM       39\n#define Y6_GPIO_NUM       36\n#define Y5_GPIO_NUM       21\n#define Y4_GPIO_NUM       19\n#define Y3_GPIO_NUM       18\n#define Y2_GPIO_NUM        5\n#define VSYNC_GPIO_NUM    25\n#define HREF_GPIO_NUM     23\n#define PCLK_GPIO_NUM     22\n\nint pictureNumber = 0;\n\nvoid setup() {\n  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); \/\/disable brownout detector\n \n  Serial.begin(115200);\n  \/\/Serial.setDebugOutput(true);\n  \/\/Serial.println();\n  \n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sccb_sda = SIOD_GPIO_NUM;\n  config.pin_sccb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 20000000;\n  config.pixel_format = PIXFORMAT_JPEG; \n  \n  if(psramFound()){\n    config.frame_size = FRAMESIZE_UXGA; \/\/ FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA\n    config.jpeg_quality = 10;\n    config.fb_count = 2;\n  } else {\n    config.frame_size = FRAMESIZE_SVGA;\n    config.jpeg_quality = 12;\n    config.fb_count = 1;\n  }\n  \n  \/\/ Init Camera\n  esp_err_t err = esp_camera_init(&amp;config);\n  if (err != ESP_OK) {\n    Serial.printf(&quot;Camera init failed with error 0x%x&quot;, err);\n    return;\n  }\n  \n  \/\/Serial.println(&quot;Starting SD Card&quot;);\n  if(!SD_MMC.begin()){\n    Serial.println(&quot;SD Card Mount Failed&quot;);\n    return;\n  }\n  \n  uint8_t cardType = SD_MMC.cardType();\n  if(cardType == CARD_NONE){\n    Serial.println(&quot;No SD Card attached&quot;);\n    return;\n  }\n    \n  camera_fb_t * fb = NULL;\n  \n  \/\/ Take Picture with Camera\n  fb = esp_camera_fb_get();  \n  if(!fb) {\n    Serial.println(&quot;Camera capture failed&quot;);\n    return;\n  }\n  \/\/ initialize EEPROM with predefined size\n  EEPROM.begin(EEPROM_SIZE);\n  pictureNumber = EEPROM.read(0) + 1;\n\n  \/\/ Path where new picture will be saved in SD Card\n  String path = &quot;\/picture&quot; + String(pictureNumber) +&quot;.jpg&quot;;\n\n  fs::FS &amp;fs = SD_MMC; \n  Serial.printf(&quot;Picture file name: %s\\n&quot;, path.c_str());\n  \n  File file = fs.open(path.c_str(), FILE_WRITE);\n  if(!file){\n    Serial.println(&quot;Failed to open file in writing mode&quot;);\n  } \n  else {\n    file.write(fb-&gt;buf, fb-&gt;len); \/\/ payload (image), payload length\n    Serial.printf(&quot;Saved file to path: %s\\n&quot;, path.c_str());\n    EEPROM.write(0, pictureNumber);\n    EEPROM.commit();\n  }\n  file.close();\n  esp_camera_fb_return(fb); \n  \n  \/\/ Turns off the ESP32-CAM white on-board LED (flash) connected to GPIO 4\n  pinMode(4, OUTPUT);\n  digitalWrite(4, LOW);\n  rtc_gpio_hold_en(GPIO_NUM_4);\n  \n  delay(2000);\n  Serial.println(&quot;Going to sleep now&quot;);\n  delay(2000);\n  esp_deep_sleep_start();\n  Serial.println(&quot;This will never be printed&quot;);\n}\n\nvoid loop() {\n  \n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/ESP32-CAM-Take-Photo-Save-MicroSD-Card\/ESP32-CAM-Take-Photo-Save-MicroSD-Card.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>The code starts by including the necessary libraries to use the camera. We also include the libraries needed to interact with the microSD card: <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include \"esp_camera.h\"\n#include \"Arduino.h\"\n#include \"FS.h\"                \/\/ SD Card ESP32\n#include \"SD_MMC.h\"            \/\/ SD Card ESP32\n#include \"soc\/soc.h\"           \/\/ Disable brownour problems\n#include \"soc\/rtc_cntl_reg.h\"  \/\/ Disable brownour problems\n#include \"driver\/rtc_io.h\"\n#include &lt;EEPROM.h&gt;            \/\/ read and write from flash memory<\/code><\/pre>\n\n\n\n<p>And the <span class=\"rnthl rntliteral\">EEPROM<\/span> library to save permanent data in the flash memory.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include &lt;EEPROM.h&gt;<\/code><\/pre>\n\n\n\n<p>If you want to learn more about how to read and write data to the flash memory, you can follow the next tutorial: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-flash-memory\/\">ESP32 Flash Memory \u2013 Store Permanent Data (Write and Read)<\/a><\/li>\n<\/ul>\n\n\n\n<p>Define the number of bytes you want to access in the flash memory. Here, we\u2019ll only use one byte that allows us to generate up to 256 picture numbers.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define EEPROM_SIZE 1<\/code><\/pre>\n\n\n\n<p>Then, define the pins for the AI-THINKER camera module.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Pin definition for CAMERA_MODEL_AI_THINKER \n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM      0\n#define SIOD_GPIO_NUM     26\n#define SIOC_GPIO_NUM     27\n  \n#define Y9_GPIO_NUM       35\n#define Y8_GPIO_NUM       34\n#define Y7_GPIO_NUM       39\n#define Y6_GPIO_NUM       36\n#define Y5_GPIO_NUM       21\n#define Y4_GPIO_NUM       19\n#define Y3_GPIO_NUM       18\n#define Y2_GPIO_NUM        5\n#define VSYNC_GPIO_NUM    25\n#define HREF_GPIO_NUM     23\n#define PCLK_GPIO_NUM     22<\/code><\/pre>\n\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> you might need to change the pin definition depending on the board you\u2019re using. Wrong pin assignment will result in a failure to init the camera.<\/p>\n\n\n\n<p>Initialize an int variable called <span class=\"rnthl rntliteral\">pictureNumber<\/span> that that will generate the photo name: picture1.jpg, picture2.jpg, and so on.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>int pictureNumber = 0;<\/code><\/pre>\n\n\n\n<p>All our code is in the <span class=\"rnthl rntliteral\">setup()<\/span>. The code only runs once when the ESP32 wakes up (in this case when you press the on-board RESET button).<\/p>\n\n\n\n<p>Define the camera settings:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>camera_config_t config;\nconfig.ledc_channel = LEDC_CHANNEL_0;\nconfig.ledc_timer = LEDC_TIMER_0;\nconfig.pin_d0 = Y2_GPIO_NUM;\nconfig.pin_d1 = Y3_GPIO_NUM;\nconfig.pin_d2 = Y4_GPIO_NUM;\nconfig.pin_d3 = Y5_GPIO_NUM;\nconfig.pin_d4 = Y6_GPIO_NUM;\nconfig.pin_d5 = Y7_GPIO_NUM;\nconfig.pin_d6 = Y8_GPIO_NUM;\nconfig.pin_d7 = Y9_GPIO_NUM;\nconfig.pin_xclk = XCLK_GPIO_NUM;\nconfig.pin_pclk = PCLK_GPIO_NUM;\nconfig.pin_vsync = VSYNC_GPIO_NUM;\nconfig.pin_href = HREF_GPIO_NUM;\nconfig.pin_sscb_sda = SIOD_GPIO_NUM;\nconfig.pin_sscb_scl = SIOC_GPIO_NUM;\nconfig.pin_pwdn = PWDN_GPIO_NUM;\nconfig.pin_reset = RESET_GPIO_NUM;\nconfig.xclk_freq_hz = 20000000;\nconfig.pixel_format = PIXFORMAT_JPEG; <\/code><\/pre>\n\n\n\n<p>Use the following settings for a camera with PSRAM (like the one we\u2019re using in this tutorial).<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if(psramFound()){\n  config.frame_size = FRAMESIZE_UXGA; \/\/ FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA\n  config.jpeg_quality = 10;\n  config.fb_count = 2;\n}<\/code><\/pre>\n\n\n\n<p>If the board doesn&#8217;t have PSRAM, set the following:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>else {\n  config.frame_size = FRAMESIZE_SVGA;\n  config.jpeg_quality = 12;\n  config.fb_count = 1;\n}<\/code><\/pre>\n\n\n\n<p>Initialize the camera:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Init Camera\nesp_err_t err = esp_camera_init(&amp;config);\nif (err != ESP_OK) {\n  Serial.printf(\"Camera init failed with error 0x%x\", err);\n  return;\n}<\/code><\/pre>\n\n\n\n<p>Initialize the microSD card:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/Serial.println(\"Starting SD Card\");\nif(!SD_MMC.begin()){\n  Serial.println(\"SD Card Mount Failed\");\n  return;\n}\n \nuint8_t cardType = SD_MMC.cardType();\nif(cardType == CARD_NONE){\n  Serial.println(\"No SD Card attached\");\n  return;\n}<\/code><\/pre>\n\n\n\n<p>More information about how to use the microSD card can be found in the following project:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-data-logging-temperature-to-microsd-card\/\">ESP32 Data Logging Temperature to MicroSD Card<\/a><\/li>\n<\/ul>\n\n\n\n<p>The following lines take a photo with the camera:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>camera_fb_t * fb = NULL;\n\n\/\/ Take Picture with Camera\nfb = esp_camera_fb_get();  \nif(!fb) {\n  Serial.println(\"Camera capture failed\");\n  return;\n}<\/code><\/pre>\n\n\n\n<p>After that, initialize the EEPROM with the size defined earlier:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>EEPROM.begin(EEPROM_SIZE);<\/code><\/pre>\n\n\n\n<p>The picture number is generated by adding 1 to the current number saved in the flash memory.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>pictureNumber = EEPROM.read(0) + 1;<\/code><\/pre>\n\n\n\n<p>To save the photo in the microSD card, create a path to your file. We\u2019ll save the photo in the main directory of the microSD card and the file name is going to be (picture1.jpg, picture2.jpg, picture3.jpg, etc\u2026).<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String path = \"\/picture\" + String(pictureNumber) +\".jpg\";<\/code><\/pre>\n\n\n\n<p>These next lines save the photo in the microSD card:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>fs::FS &amp;fs = SD_MMC; \nSerial.printf(\"Picture file name: %s\\n\", path.c_str());\n\nFile file = fs.open(path.c_str(), FILE_WRITE);\nif(!file){\n  Serial.println(\"Failed to open file in writing mode\");\n} \nelse {\n  file.write(fb-&gt;buf, fb-&gt;len); \/\/ payload (image), payload length\n  Serial.printf(\"Saved file to path: %s\\n\", path.c_str());\n  EEPROM.write(0, pictureNumber);\n  EEPROM.commit();\n}\nfile.close();<\/code><\/pre>\n\n\n\n<p>After saving a photo, we save the current picture number in the flash memory to keep track of the number of photos taken.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>EEPROM.write(0, pictureNumber);\nEEPROM.commit();<\/code><\/pre>\n\n\n\n<p>When the ESP32-CAM takes a photo, it flashes the on-board LED. After taking the photo, the LED remains on, so we send instructions to turn it off. The LED is connected to GPIO 4.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>pinMode(4, OUTPUT);\ndigitalWrite(4, LOW);\nrtc_gpio_hold_en(GPIO_NUM_4);<\/code><\/pre>\n\n\n\n<p>Finally, we put the ESP32 in deep sleep.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>esp_deep_sleep_start();<\/code><\/pre>\n\n\n\n<p>Because we don\u2019t pass any argument to the deep sleep function, the ESP32 board will be sleeping indefinitely until RESET.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ESP32-CAM Upload Code <\/h2>\n\n\n\n<p>To upload code to the ESP32-CAM board, connect it 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-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"32\" height=\"32\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/upload-button-arduino-ide.png?resize=32%2C32&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-91745\"\/><\/figure><\/div>\n\n\n<p>4) When you start to see these dots on the debugging window as shown below, press the ESP32-CAM on-board RST button.   <\/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\n<h2 class=\"wp-block-heading\">Demonstration<\/h2>\n\n\n\n<p>After uploading the code, remove the jumper that connects GPIO 0 from GND.<\/p>\n\n\n\n<p>Open the Serial Monitor at a baud rate of 115200. Press the ESP32-CAM reset button. It should initialize and take a photo. When it takes a photo it turns on the flash (GPIO 4).<\/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\/06\/flash-esp32-cam.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM Take Photo and Save to MicroSD Card Demonstration\" class=\"wp-image-86263\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/flash-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\/06\/flash-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<p>Check the Arduino IDE Serial Monitor window to see if everything is working as expected. As you can see, the picture was successfully saved in the microSD card. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"523\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Serial-Monitor-Take-Photo-Save-to-Micro-SD-Card.png?resize=890%2C523&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM Take Photo and Save to MicroSD Card Arduino IDE Serial Monitor Demonstration\" class=\"wp-image-86264\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Serial-Monitor-Take-Photo-Save-to-Micro-SD-Card.png?w=890&amp;quality=100&amp;strip=all&amp;ssl=1 890w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Serial-Monitor-Take-Photo-Save-to-Micro-SD-Card.png?resize=300%2C176&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Serial-Monitor-Take-Photo-Save-to-Micro-SD-Card.png?resize=768%2C451&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 890px) 100vw, 890px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> if you&#8217;re having issues with the ESP32-CAM, take a look at our troubleshooting guide and see if it helps: <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-troubleshooting-guide\/\">ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed<\/a><\/p>\n\n\n\n<p>After making sure that everything is working as expected, you can disconnect the ESP32-CAM from the FTDI programmer and power it using an independent power supply.<\/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\/06\/power-esp32-cam-power-bank.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM powered with powerbank \/ independent power supply\" class=\"wp-image-86265\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/power-esp32-cam-power-bank.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/power-esp32-cam-power-bank.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>To see the photos taken, remove the microSD card from the microSD card slot and insert it into your computer. You should have all the photos saved.<\/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=\"369\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/photos-saved-esp32-cam-sd-card.jpg?resize=750%2C369&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM photo pictures examples saved in MicroSD Card\" class=\"wp-image-86266\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/photos-saved-esp32-cam-sd-card.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/photos-saved-esp32-cam-sd-card.jpg?resize=300%2C148&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>The quality of your photo depends on your lighting conditions. Too much light can ruin your photos and dark environments will result in many black pixels.<\/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>We hope you&#8217;ve found this tutorial useful and you are able to use it in your projects. If you don&#8217;t have an ESP32-CAM board, you can <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">click here to get one<\/a>.<\/p>\n\n\n\n<p>As mentioned previously, we have other tutorials about the ESP32-CAM that you may like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">ESP32-CAM Video Streaming and Face Recognition with Arduino IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">ESP32-CAM Video Streaming Web Server (works with Home Assistant)<\/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 aria-label=\"Quick Overview: ESP32-CAM with OV2640 Camera (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-cam-ov2640-camera\/\" target=\"_blank\" rel=\"noreferrer noopener\">Quick Overview: ESP32-CAM with OV2640 Camera<\/a><\/li>\n\n\n\n<li><a aria-label=\"Where to buy the ESP32-CAM (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\">Where to buy the ESP32-CAM<\/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\n\n\n<p>Thank you for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to take photos with the ESP32-CAM board and save them to a microSD card using Arduino IDE. When you press the ESP32-CAM RESET button, it wakes up, takes &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32-CAM Take Photo and Save to MicroSD Card\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-save-microsd-card\/#more-85920\" aria-label=\"Read more about ESP32-CAM Take Photo and Save to MicroSD Card\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":86296,"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":[276,281,277,319,264],"tags":[],"class_list":["post-85920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-esp32-project","category-esp32-arduino-ide","category-esp32-cam","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/ESP32-CAM-Take-Photo-Save-to-MicroSD-Card.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\/85920","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=85920"}],"version-history":[{"count":1,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/85920\/revisions"}],"predecessor-version":[{"id":159119,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/85920\/revisions\/159119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/86296"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=85920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=85920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=85920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}