ESP32-CAM Take Photo and Save to MicroSD Card

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.

ESP32-CAM: Take Photo and Save to MicroSD Card

We’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.

The ESP32-CAM board is a $9 device (or less) that combines an ESP32-S chip, an OV2640 camera, a microSD card slot and several GPIO pins.

ESP32-CAM board is a $9 device with an OV2640 camera, microSD card slot and several GPIO pins

For an introduction to the ESP32-CAM, you can follow the next tutorials:

Watch the Video Tutorial

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.

Parts Required

To follow this tutorial you need the following components:

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Project Overview

Here is a quick overview on how the project works.

take photo save to micro sd card ESP32-CAM
  • The ESP32-CAM is in deep sleep mode
  • Press the RESET button to wake up the board
  • The camera takes a photo
  • The photo is saved in the microSD card with the name: pictureX.jpg, where X corresponds to the picture number
  • 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.

Formatting MicroSD Card

The first thing we recommend doing is formatting your microSD card. You can use the Windows formatter tool or any other microSD formatter software.

1. Insert the microSD card in your computer. Go to My Computer and right click in the SD card. Select Format as shown in figure below.

Formatting your microSD card Windows

2. A new window pops up. Select FAT32, press Start to initialize the formatting process and follow the onscreen instructions.

Formatting your microSD card Windows

Note: according to the product specifications, the ESP32-CAM should only support 4 GB SD cards. However, we’ve tested with 16 GB SD card and it works well.

Installing the ESP32 add-on

We’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 one of the next tutorials to install the ESP32 add-on, if you haven’t already:

Take and Save Photo Sketch

Copy the following code to your Arduino IDE.

/*********
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/esp32-cam-take-photo-save-microsd-card
  
  IMPORTANT!!! 
   - Select Board "ESP32 Wrover Module"
   - Select the Partion Scheme "Huge APP (3MB No OTA)
   - GPIO 0 must be connected to GND to upload a sketch
   - After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*********/

#include "esp_camera.h"
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "fd_forward.h"
#include "fr_forward.h"
#include "FS.h"                // SD Card ESP32
#include "SD_MMC.h"            // SD Card ESP32
#include "soc/soc.h"           // Disable brownour problems
#include "soc/rtc_cntl_reg.h"  // Disable brownour problems
#include "dl_lib.h"
#include "driver/rtc_io.h"
#include <EEPROM.h>            // read and write from flash memory

// define the number of bytes you want to access
#define EEPROM_SIZE 1

// Pin definition for CAMERA_MODEL_AI_THINKER
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27

#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22

int pictureNumber = 0;

void setup() {
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
 
  Serial.begin(115200);
  //Serial.setDebugOutput(true);
  //Serial.println();
  
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG; 
  
  if(psramFound()){
    config.frame_size = FRAMESIZE_UXGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }
  
  // Init Camera
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }
  
  //Serial.println("Starting SD Card");
  if(!SD_MMC.begin()){
    Serial.println("SD Card Mount Failed");
    return;
  }
  
  uint8_t cardType = SD_MMC.cardType();
  if(cardType == CARD_NONE){
    Serial.println("No SD Card attached");
    return;
  }
    
  camera_fb_t * fb = NULL;
  
  // Take Picture with Camera
  fb = esp_camera_fb_get();  
  if(!fb) {
    Serial.println("Camera capture failed");
    return;
  }
  // initialize EEPROM with predefined size
  EEPROM.begin(EEPROM_SIZE);
  pictureNumber = EEPROM.read(0) + 1;

  // Path where new picture will be saved in SD Card
  String path = "/picture" + String(pictureNumber) +".jpg";

  fs::FS &fs = SD_MMC; 
  Serial.printf("Picture file name: %s\n", path.c_str());
  
  File file = fs.open(path.c_str(), FILE_WRITE);
  if(!file){
    Serial.println("Failed to open file in writing mode");
  } 
  else {
    file.write(fb->buf, fb->len); // payload (image), payload length
    Serial.printf("Saved file to path: %s\n", path.c_str());
    EEPROM.write(0, pictureNumber);
    EEPROM.commit();
  }
  file.close();
  
  // Turns off the ESP32-CAM white on-board LED (flash) connected to GPIO 4
  pinMode(4, OUTPUT);
  digitalWrite(4, LOW);
  rtc_gpio_hold_en(GPIO_NUM_4);
  
  delay(2000);
  Serial.println("Going to sleep now");
  delay(2000);
  esp_deep_sleep_start();
  Serial.println("This will never be printed");
}

void loop() {
  
}

View raw code

The code starts by including the necessary libraries to use the camera. We also include the libraries needed to interact with the microSD card:

#include "esp_camera.h"
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
#include "fd_forward.h"
#include "fr_forward.h"
#include "FS.h"                // SD Card ESP32
#include "SD_MMC.h"            // SD Card ESP32
#include "soc/soc.h"           // Disable brownour problems
#include "soc/rtc_cntl_reg.h"  // Disable brownour problems
#include "dl_lib.h"
#include "driver/rtc_io.h"

And the EEPROM library to save permanent data in the flash memory.

#include <EEPROM.h>

If you want to learn more about how to read and write data to the flash memory, you can follow the next tutorial:

Define the number of bytes you want to access in the flash memory. Here, we’ll only use one byte that allows us to generate up to 256 picture numbers.

#define EEPROM_SIZE 1

Then, define the pins for the AI-THINKER camera module.

// Pin definition for CAMERA_MODEL_AI_THINKER 
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27
  
#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22

Note: you might need to change the pin definition depending on the board you’re using. Wrong pin assignment will result in a failure to init the camera.

Initialize an int variable called pictureNumber that that will generate the photo name: picture1.jpg, picture2.jpg, and so on.

int pictureNumber = 0;

All our code is in the setup(). The code only runs once when the ESP32 wakes up (in this case when you press the on-board RESET button).

Define the camera settings:

camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.pixel_format = PIXFORMAT_JPEG; 

Use the following settings for a camera with PSRAM (like the one we’re using in this tutorial).

if(psramFound()){
  config.frame_size = FRAMESIZE_UXGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA
  config.jpeg_quality = 10;
  config.fb_count = 2;
}

If the board doesn’t have PSRAM, set the following:

else {
  config.frame_size = FRAMESIZE_SVGA;
  config.jpeg_quality = 12;
  config.fb_count = 1;
}

Initialize the camera:

// Init Camera
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
  Serial.printf("Camera init failed with error 0x%x", err);
  return;
}

Initialize the microSD card:

//Serial.println("Starting SD Card");
if(!SD_MMC.begin()){
  Serial.println("SD Card Mount Failed");
  return;
}
 
uint8_t cardType = SD_MMC.cardType();
if(cardType == CARD_NONE){
  Serial.println("No SD Card attached");
  return;
}

More information about how to use the microSD card can be found in the following project:

The following lines take a photo with the camera:

camera_fb_t * fb = NULL;

// Take Picture with Camera
fb = esp_camera_fb_get();  
if(!fb) {
  Serial.println("Camera capture failed");
  return;
}

After that, initialize the EEPROM with the size defined earlier:

EEPROM.begin(EEPROM_SIZE);

The picture number is generated by adding 1 to the current number saved in the flash memory.

pictureNumber = EEPROM.read(0) + 1;

To save the photo in the microSD card, create a path to your file. We’ll 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…).

String path = "/picture" + String(pictureNumber) +".jpg";

These next lines save the photo in the microSD card:

fs::FS &fs = SD_MMC; 
Serial.printf("Picture file name: %s\n", path.c_str());

File file = fs.open(path.c_str(), FILE_WRITE);
if(!file){
  Serial.println("Failed to open file in writing mode");
} 
else {
  file.write(fb->buf, fb->len); // payload (image), payload length
  Serial.printf("Saved file to path: %s\n", path.c_str());
  EEPROM.write(0, pictureNumber);
  EEPROM.commit();
}
file.close();

After saving a photo, we save the current picture number in the flash memory to keep track of the number of photos taken.

EEPROM.write(0, pictureNumber);
EEPROM.commit();

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.

pinMode(4, OUTPUT);
digitalWrite(4, LOW);
rtc_gpio_hold_en(GPIO_NUM_4);

Finally, we put the ESP32 in deep sleep.

esp_deep_sleep_start();

Because we don’t pass any argument to the deep sleep function, the ESP32 board will be sleeping indefinitely until RESET.

ESP32-CAM Upload Code

To upload code to the ESP32-CAM board, connect it to your computer using an FTDI programmer. Follow the next schematic diagram:

Important: GPIO 0 needs to be connected to GND so that you’re able to upload code.

Important: some ESP32-CAM boards operate at 5V, so if you can’t upload code, you may need to power with 5V to make it work.

To upload the code, follow the next steps:

  1. Go to Tools > Board and select ESP32 Wrover Module
  2. Go to Tools > Port and select the COM port the ESP32 is connected to
  3. In Tools > Partition Scheme, select “Huge APP (3MB No OTA)
  4. Press the ESP32-CAM on-board RESET button
  5. Then, click the upload button to upload the code
ESP32-CAM Uploading Code Arduino Sketch Settings

Important: if you can’t upload the code, double-check that GPIO 0 is connected to GND and that you selected the right settings in the Tools menu. You should also press the on-board Reset button to restart your ESP32 in flashing mode.

Demonstration

After uploading the code, remove the jumper that connects GPIO 0 from GND.

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).

ESP32-CAM Take Photo and Save to MicroSD Card Demonstration

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.

ESP32-CAM Take Photo and Save to MicroSD Card Arduino IDE Serial Monitor Demonstration

Note: if you’re having issues with the ESP32-CAM, take a look at our troubleshooting guide and see if it helps: ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed

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.

ESP32-CAM powered with powerbank / independent power supply

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.

ESP32-CAM photo pictures examples saved in MicroSD Card

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.

Troubleshooting

If you’re getting any of the following errors, read our ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed

  • Failed to connect to ESP32: Timed out waiting for packet header
  • Camera init failed with error 0x20001 or similar
  • Brownout detector or Guru meditation error
  • Sketch too big error – Wrong partition scheme selected
  • Board at COMX is not available – COM Port Not Selected
  • Psram error: GPIO isr service is not installed
  • Weak Wi-Fi Signal
  • No IP Address in Arduino IDE Serial Monitor
  • Can’t open web server
  • The image lags/shows lots of latency

Wrapping Up

We hope you’ve found this tutorial useful and you are able to use it in your projects. If you don’t have an ESP32-CAM board, you can click here to get one.

As mentioned previously, we have other tutorials about the ESP32-CAM that you may like:

Learn more about the ESP32 with our “Learn ESP32 with Arduino IDE” course or check our ESP32 free resources.

Thank you for reading.


Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our weekly newsletter!

44 thoughts on “ESP32-CAM Take Photo and Save to MicroSD Card”

  1. Good! Congratulations!!
    I’m findig how to make this but instead using reset to take photo, program a time lapse photo, from 5 to 60 sec, storaging them in SDcard.
    Can you think about it?
    Thanks!

    • Hi Frank.
      That’s a very interesting project.
      I think you just need to create a timer that triggers a function that takes the photo and saves to the microSD card. And put everything in the loop.
      I’ll think about your project, and maybe create a tutorial in the future.
      REgards,
      Sara

  2. Rui,i m so sorry ,i m radio man no digital 🙂 when i try to compile this sketch ,arduino 1.8.5 tell me :
    Board esp32wrover (platform esp32, package esp32) is unknown

    Error compiling for board ESP32 Wrover Module.

    • Hi Mikele.
      I’m sorry for the delay in my response.
      Were you able to fix this issue?
      What other information do you get in the serial monitor?
      Regards,
      Sara

  3. Hello Rui,
    I’m a great fan of your blog, and bought several of your books and courses.
    I found this post if this can help for shutting down the LED :
    https://www.esp32.com/viewtopic.php?t=4040

    Also I would like to build a system that takes a picture of animal passing by a path. I was thinking to add an IR motion sensor or an external command by a light barrier to the SD card recording system you described.
    Could you please make a post of such a system ?
    Thanks in advance,
    Claude

    • Thank you for sharing that solution.
      At the moment, we weren’t able to interface the PIR sensor with the EPS32-CAM. But we’ll try again and create a new tutorial about that if we succeed.
      Regards,
      Sara

  4. LED pin output needs to be set LOW then HOLD to keep it off during sleep. Disable HOLD after wakeup to use the pin again.

    pinMode(4, OUTPUT);
    digitalWrite(4, LOW);
    rtc_gpio_hold_en(GPIO_NUM_4);
    delay(500);
    esp_deep_sleep_start();

  5. rtc & digital io pin state can be maintained during hibernation with these two functions:
    rtc_gpio_hold_en
    rtc_cntl_dg_pad_force_hold

    More info:
    esp32.com/viewtopic.php?t=1966

    • Thanks for sharing.
      I’ve included the following:
      #include “driver/rtc_io.h”

      Then, used:
      rtc_gpio_hold_en(GPIO_NUM_4);

      To keep GPIO LOW during deep sleep as you suggested in your previous comment.

      It worked! So, I updated the code!

      Thank you 😀

  6. Very nice! Could the sketch be modified to be triggered by connecting one of the gpio pins to ground instead of pressing the reset button? This would make it useful in an application in which a remote switch is used to trigger.

  7. I am struggling getting a PIR sensor to wake the esp32 from deep sleep. Is it possible the camera configuration is interfering with it?

    • Thank you for your comment.
      We’ve tried interfacing the camera with the PIR motion sensor. But when using the SD card, there are almost no pins left to connect the PIR motion sensor. The pins left didn’t work with the sensor: the ESP-CAM crashed.
      So, we weren’t successful yet to interface a PIR. But will try again.
      Regards,
      Sara

  8. Instead of pressing the reset button’ I owuld like to activate the camera by a movement sensor for example in order to watch the house…
    Thanks for an interesting project.

  9. Good afternoon. Excellent example. But the author did not adjust the matrix OV2640. I added this code:

    // Set camera sensor
    sensor_t * s = esp_camera_sensor_get();

    s->set_framesize(s, MY_FRAMESIZE);
    s->set_quality(s, MY_QUALITY);
    s->set_contrast(s, 0);
    s->set_brightness(s, 0);
    s->set_saturation(s, 0);
    s->set_gainceiling(s, GAINCEILING_16X);
    s->set_colorbar(s, 0);
    s->set_whitebal(s, 0);
    s->set_hmirror(s, 0);
    s->set_vflip(s, 0);
    s->set_ae_level(s, 0);
    s->set_special_effect(s, 0);
    s->set_wb_mode(s, 2);
    s->set_awb_gain(s, 1);
    s->set_bpc(s, 1);
    s->set_wpc(s, 1);
    s->set_raw_gma(s, 1);
    s->set_lenc(s, 0);
    s->set_agc_gain(s, 1);
    s->set_aec_value(s, 600);
    s->set_gain_ctrl(s, 0);
    s->set_exposure_ctrl(s, 0);
    s->set_aec2(s, 1);
    s->set_dcw(s, 0);

  10. Thanks for this great tutorial.
    Could you explain how to connect external spi device (ex: tft ST7735)
    I have tryied multiple pin conbinaison without success.

    • Hi.
      You need to check what pins are being used by the camera. You can’t use those.
      Then, if you’re using the microSD card, you can’t also use those pins. So, there are little pins left to connect an external SPI device.
      Take a look at the pins used by the board and see if you have some left that can be used with your peripherals. Here are the pins (page 3): loboris.eu/ESP32/ESP32-CAM%20Product%20Specification.pdf
      Regards,
      Sara

    • Please let me know if you figure out what pins to use that dont cause a crash. I am having trouble getting the SD card to mount after deep sleep.

  11. Hello, very cool the design of the camera. Thank you for sharing another project and increasing our field of knowledge.

  12. In regards to waking after deep sleep and the SD card not mounting:

    The code you have posted forces GPIO4 to hold its value in this line:

    rtc_gpio_hold_en(GPIO_NUM_4);

    This pin is used for SD card interface. You need to un-hold it after deep sleep wakeup if you want to use the pin again.

    • I used gpio 13 pin D3 to make the PIR sensor work. I also removed the light hold.. I would like the light to be off during deep sleep. When I figure it out I will post some pictures of what I rigged up if people want. Thanks again.

      • Hi David.
        Yes, please share your results with us.
        Were you able to use GPIO 13 as an interrupt without the ESP crashing?
        Regards,
        Sara

        • bit.ly/2IZ7Kjz
          here is a schematic of what I did. I am new to schematics so I hope everything is right. Anyway, the board pin is pulled low instead of floating by this circuit. Although I’ve been told this is not a good pin to use because it is HIGH on boot. However it seems to work OK for me.

          then ofcourse I use this code before deep sleep:
          esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);

          cheers,
          David

        • bit.ly/2IZ7Kjz
          here is a schematic of what I did. I am new to schematics so I hope everything is right. Anyway, the board pin is pulled low instead of floating by this circuit. Although I’ve been told this is not a good pin to use because it is HIGH on boot. However it seems to work OK for me.

          then of course I use this code before deep sleep:
          esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);

          cheers,
          David

          • looking at it now I am not sure what the 10k resistor does. I have tested it multiple times and it is definitely how i have it wired up though…

          • Hi David.
            Thank you so much for sharing.
            I would like to give it a try and maybe create a tutorial about that.
            Can you share the code that you are running on the ESP32-CAM? You can use pastebin for example to share your code.
            Would you mind if we used that information to create a new tutorial?
            Regards,
            Sara

          • yes ofcourse make a tutorial if you want. Honestly though I was unable to get the PIR sensor to work well in sunlight but that may not be a problem for your project.

            Unfortunately I do not have the exact code on hand right now, but it is simply your code without the LED hold and with:
            esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);

            I will make double sure that is right when I get home tomorrow morning. I was thinking of testing it again with a simple push button on the same pin just to be sure.

            Thanks,
            David

  13. Hello,
    I’ve succeed to compile successfuly the sketch in IDE following your instructions but I’m confused about loading in ESP32.
    How to power the ESP32 module please, because with the FTDI connected alone to USB, back pin 3.3V is around 4V and 5.0V is around 6V , Is the FTDI defective ?
    Or should the ESP32 powered with a separate power supply ?
    thanks for claryfying this point,
    Rgds,

    • Hi.
      In our example, we’re powering the ESP32 using the 3.3V from the FTDI programmer connected to the 3.3V of the ESP32-CAM and it works well.
      Some people reported that the ESP32-CAM only worked well when powering with 5V through the 5V pin.
      You can also use a separated power supply up to 5V.
      Regards,
      Sara

  14. Hi.. can you helpme? SD 2G . Fat32 formated. like tutorial. the board works ok with the proyect (ESP32-CAM Video Streaming and Face Recognition)

    18:57:51.475 -> Picture file name: /picture1.jpg
    18:57:51.475 -> E (2403) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0xffffffff
    18:57:51.475 -> E (2404) diskio_sdmmc: sdmmc_read_blocks failed (-1)
    18:57:52.500 -> E (3409) sdmmc_req: sdmmc_host_wait_for_event returned 0x107
    18:57:52.500 -> E (3409) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
    18:57:52.500 -> E (3410) diskio_sdmmc: sdmmc_read_blocks failed (263)

    Thanks.

Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.