Xiao esp32s3 sense camera sleep current

I re-tried the light sleep modification I had added to the ‘take_photos.ino’ example with an OV3660 camera.

I set it to take 4 pictures at every wake;

#define uS_TO_S_FACTOR 1000000ULL                 //Conversion factor for micro seconds to seconds

void loop()
{
  uint8_t index;
  sensor_t* sensor = esp_camera_sensor_get();

  if (camera_sign && sd_sign)
  {
    char filename[32];
    for (index = 1; index <= pictures; index++)
    {
      sprintf(filename, "/image%d.jpg", imageCount);
      photo_save(filename);
      Serial.printf("Saved picture: %s\r\n", filename);
      imageCount++;
      delay(500);
    }
  }

  sensor->set_reg(sensor, 0x3008, 0xFF, 0x42);   //camera to standby
  delay(1000);
  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
  esp_light_sleep_start();
  Serial.println();
  Serial.println();
  Serial.println(F("Awake !"));
  sensor->set_reg(sensor, 0x3008, 0xFF, 0x02);   //camera to ready
  delay(2000);
}

I let it run a while, it took over 100 pictures, all were fine.

Light sleep current was 4mA.

2 Likes