{"id":82354,"date":"2025-01-07T08:56:49","date_gmt":"2025-01-07T13:56:49","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=82354"},"modified":"2025-01-07T08:56:49","modified_gmt":"2025-01-07T13:56:49","slug":"arduino-esp32-cam-image-storage-sd-card","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/","title":{"rendered":"How to capture images using ESP32-CAM and an SD card"},"content":{"rendered":"<p>The ESP32-CAM is a widely used development board for embedded vision applications. It combines the ESP32 microcontroller with an OV2620 camera module, and the ESP32 itself comes with built-in Wi-Fi and Bluetooth capabilities. Previously, we created a <a href=\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-face-recognition\/\">video streaming server<\/a> using the <a href=\"https:\/\/www.engineersgarage.com\/esp32-cam-errors-and-solutions\/\">ESP32-CAM<\/a> to troubleshoot potential operational issues with the module.<\/p>\n<p>In this project, we&#8217;ll program the ESP32-CAM to capture still images and store them on a MicroSD card. The module will capture live images whenever the reset button is pressed, offering a simple yet effective solution for capturing images.<\/p>\n<h3><strong>Components<\/strong><\/h3>\n<ol>\n<li>ESP32-CAM x1<\/li>\n<li>Arduino UNO or MEGA x1<\/li>\n<li>USB cable (to connect Arduino with your computer)<\/li>\n<li>Jumper wires<\/li>\n<\/ol>\n<h3><strong>Circuit connections<\/strong><\/h3>\n<p>In this project, we use Arduino to upload a sketch to the ESP32-CAM. However, Arduino UNO or MEGA also work.<\/p>\n<p>Begin by connecting ESP32-CAM&#8217;s GPIO1 (U0_TXD) and GPIO3 (U0_RXD) pins to Arduino&#8217;s TX and RX pins, respectively. Next, connect ESP32-CAM&#8217;s 5V and ground pins to Arduino&#8217;s 5V and GND pins. Also, connect Arduino&#8217;s RESET pin to its ground pin.<\/p>\n<p>While uploading the sketch, ensure that ESP32-CAM&#8217;s GPIO0 pin is connected to its ground pin. After successfully uploading the sketch, be sure to remove the connection between ESP32-CAM&#8217;s GPIO0 and ground.<\/p>\n<p>Below is the circuit diagram illustrating the connections between Arduino and the ESP32-CAM for uploading the sketch.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-82357\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch-1024x700.png\" alt=\"\" width=\"740\" height=\"506\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch-1024x700.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch-768x525.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch-348x238.png 348w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-01-ESP32-CAM-Arduino-Circuit-Diagram-Upload-Sketch.png 1356w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p>Next, is a circuit diagram that demonstrates the connections between Arduino and the ESP32-CAM. It relates to the camera after the sketch uploaded. Note that the connection between ESP32-CAM&#8217;d GPIO0 and ground pins is removed.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-82358\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram-1024x700.png\" alt=\"\" width=\"740\" height=\"506\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram-1024x700.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram-300x205.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram-768x525.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram-348x238.png 348w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-02-ESP32-CAM-Arduino-Circuit-Diagram.png 1356w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<h3>The sketch<\/h3>\n<style>\n.gist-data{    height:250px; \/\/ Any height    overflow: auto;<br \/>}<\/style>\n<p><script src=\"https:\/\/gist.github.com\/Ajak58a\/8a463c309eec7f478070d450a500f3e4.js\"><\/script><\/p>\n<h3><strong>Uploading the sketch <\/strong><\/h3>\n<p>Complete the circuit connections as instructed to properly upload the code. Remember to connect ESP32-CAM&#8217;s GPIO0 with its ground pin to do so.<\/p>\n<p>Now, connect Arduino with a computer using a USB cable. Select the &#8220;ESP32 Wrover Module&#8221; as the board to use, and set the following parameters under &#8220;Tools.&#8221;<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-03-ESP32-CAM-Upload-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82359\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-03-ESP32-CAM-Upload-Settings.png\" alt=\"\" width=\"551\" height=\"655\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-03-ESP32-CAM-Upload-Settings.png 551w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-03-ESP32-CAM-Upload-Settings-252x300.png 252w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-03-ESP32-CAM-Upload-Settings-200x238.png 200w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/a><\/p>\n<p>Compile and upload the sketch by clicking on Arduino IDE&#8217;s &#8220;Upload&#8221; button. After the sketch is uploaded, remove the connection between ESP32-CAM&#8217;s GPIO0 and ground pins via Arduino.<\/p>\n<p>Format a MicroSD card to the &#8220;FAT32 file system&#8221; using a suitable SD card formatter. Then, insert the card in ESP32-CAM&#8217;s MicroSD card slot. The development board should be ready to capture still images.<\/p>\n<h3><strong>How it works <\/strong><\/h3>\n<p>In the firmware code that&#8217;s uploaded to the ESP32-CAM, the board is programmed to initialize the camera module and take a picture. This captured image is instantly stored in the attached MicroSD card. The complete code runs in the setup() function and only functions when the module&#8217;s reset button is pressed. After capturing a new image, the module goes in idle mode as the loop() function in the firmware has no code.<\/p>\n<h3>The code<\/h3>\n<p>The sketch begins with importing the libraries required for operating the module. like esp_camera.h,Arduino.h etc. The libraries FS.h and SD_MMC.h are required for working with the SD card. The libraries soc\/soc.h and soc\/rtc_cntl_reg.h are required for handling the brownout problem. The library driver\/rtc_io.h is required for handling RTC input and outputs.<\/p>\n<p>The EEPROM.h is save data in the flash memory. The ESP32-CAM has an EEPROM of size 4 kilobytes available. Out of that storage, one byte is defined as a constant to denote the maximum number of images to be taken. One byte allows up to 256 pictures.<\/p>\n<p>The sketch begins by importing the necessary libraries for operating the ESP32-CAM module, such as esp_camera.h and Arduino.h. Additional libraries, including FS.h and SD_MMC.h, are required to work with the SD card. The soc\/soc.h and soc\/rtc_cntl_reg.h libraries address the brownout detection problem. The driver\/rtc_io.h library manages the RTC input and output functionality, and EEPROM.h is included to enable data storage in the flash memory.<\/p>\n<p>The ESP32-CAM features a four-kilobyte EEPROM, with one byte designated as a constant to define the maximum number of images that can be stored &#8212; allowing up to 256 pictures.<\/p>\n<p>Constants for the pin configuration of the ESP32-CAM module are declared, followed by the initialization of a variable to store the image count, which is set to &#8220;0.&#8221;<\/p>\n<p>In the setup function, the camera module is configured by defining its various settings. If PSRAM is available, specific settings are defined. Otherwise, alternative settings are applied. Both the camera and the MicroSD card are initialized. The subsequent code in the sketch is responsible for capturing and saving images to the MicroSD card.<\/p>\n<p>This code in the sketch captures an image:<\/p>\n<p><span style=\"color: #800000;\"><strong>\u00a0 fb = esp_camera_fb_get(); \u00a0<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0 if(!fb) {<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0 \u00a0 Serial.println(&#8220;Camera capture failed&#8221;);<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0 \u00a0 return;<\/strong><\/span><br \/>\n<span style=\"color: #800000;\"><strong>\u00a0 }<\/strong><\/span><\/p>\n<p>The EEPROM is initialized to retrieve the last stored picture number, and that number variable is incremented by &#8220;1&#8221; for the new capture. A storage path is defined on the MicroSD card, and the captured picture is saved at this specified location.<\/p>\n<p>To maintain continuity, the updated picture number is written back to the EEPROM, allowing the system to track the total number of pictures taken.<\/p>\n<p>To provide user feedback, the onboard LED flashes briefly to indicate that the picture has been successfully captured and stored. Once the process is complete, the ESP32-CAM module enters deep sleep mode to conserve power until the next activation.<\/p>\n<p>All of the code is written in the setup() function, so it runs only once when the reset button is pressed. The development board remains in deep sleep state at all other times. The captured pictures can be viewed and retrieved from the MicroSD card module.<\/p>\n<h3><strong>The results <\/strong><\/h3>\n<p>The development board captures and stores pictures when the reset button is pressed, as shown in the demonstration video.<\/p>\n<h3>Video<\/h3>\n<div style=\"width: 740px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-82354-1\" width=\"740\" height=\"416\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-DV-1.mp4?_=1\" \/><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-DV-1.mp4\">https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-DV-1.mp4<\/a><\/video><\/div>\n<p>The pictures are retrieved by inserting the MicroSD card in your computer.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-04-Captured-Images-from-ESP32-CAM-in-MicroSD-Card.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82360\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-04-Captured-Images-from-ESP32-CAM-in-MicroSD-Card.png\" alt=\"\" width=\"674\" height=\"274\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-04-Captured-Images-from-ESP32-CAM-in-MicroSD-Card.png 674w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-04-Captured-Images-from-ESP32-CAM-in-MicroSD-Card-300x122.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-04-Captured-Images-from-ESP32-CAM-in-MicroSD-Card-368x150.png 368w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/p>\n<p>Some of the pictures we captured from the ESP32-CAM are as follows.<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-82356\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-1024x768.jpg\" alt=\"\" width=\"702\" height=\"526\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-1024x768.jpg 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-300x225.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-768x576.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-1536x1152.jpg 1536w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1-317x238.jpg 317w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-05-picture1.jpg 1600w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/a><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-82361\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-1024x768.jpg\" alt=\"\" width=\"705\" height=\"529\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-1024x768.jpg 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-300x225.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-768x576.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-1536x1152.jpg 1536w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2-317x238.jpg 317w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/P70-06-picture2.jpg 1600w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ESP32-CAM is a widely used development board for embedded vision applications. It combines the ESP32 microcontroller with an OV2620 camera module, and the ESP32 itself comes with built-in Wi-Fi and Bluetooth capabilities. Previously, we created a video streaming server using the ESP32-CAM to troubleshoot potential operational issues with the module. In this project, we&#8217;ll&hellip;<\/p>\n","protected":false},"author":387,"featured_media":82363,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[13,1871],"tags":[1175,4339,3337,4604,3504,660],"class_list":{"2":"type-post","15":"entry","16":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Arduino ESP32-CAM image storage SD card<\/title>\n<meta name=\"description\" content=\"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to capture images using ESP32-CAM and an SD card\" \/>\n<meta property=\"og:description\" content=\"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png\" \/>\n\t<meta property=\"og:image:width\" content=\"816\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Agnihotri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\"},\"author\":{\"name\":\"Nikhil Agnihotri\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\"},\"headline\":\"How to capture images using ESP32-CAM and an SD card\",\"datePublished\":\"2025-01-07T13:56:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\"},\"wordCount\":1029,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png\",\"keywords\":[\"Arduino\",\"electronicproject\",\"ESP32\",\"esp32-cam\",\"images\",\"video\"],\"articleSection\":[\"Electronic Projects\",\"Video\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\",\"url\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\",\"name\":\"Arduino ESP32-CAM image storage SD card\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png\",\"datePublished\":\"2025-01-07T13:56:49+00:00\",\"description\":\"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png\",\"width\":816,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to capture images using ESP32-CAM and an SD card\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\",\"name\":\"Nikhil Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"caption\":\"Nikhil Agnihotri\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Arduino ESP32-CAM image storage SD card","description":"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/","og_locale":"en_US","og_type":"article","og_title":"How to capture images using ESP32-CAM and an SD card","og_description":"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step","og_url":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":816,"height":500,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png","type":"image\/png"}],"author":"Nikhil Agnihotri","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Nikhil Agnihotri","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/"},"author":{"name":"Nikhil Agnihotri","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6"},"headline":"How to capture images using ESP32-CAM and an SD card","datePublished":"2025-01-07T13:56:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/"},"wordCount":1029,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png","keywords":["Arduino","electronicproject","ESP32","esp32-cam","images","video"],"articleSection":["Electronic Projects","Video"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/","url":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/","name":"Arduino ESP32-CAM image storage SD card","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png","datePublished":"2025-01-07T13:56:49+00:00","description":"Learn how to program the ESP32-CAM module to capture and store images on a MicroSD card efficiently, step-by-step","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR.png","width":816,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/arduino-esp32-cam-image-storage-sd-card\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"How to capture images using ESP32-CAM and an SD card"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6","name":"Nikhil Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","caption":"Nikhil Agnihotri"},"url":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2025\/01\/SD-card-ESP32CAM-ROTATOR-600x500.png","author_info":{"display_name":"Nikhil Agnihotri","author_link":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/82354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=82354"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/82354\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/82363"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=82354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=82354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=82354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}