Time Lapse Camera Using the ESP32-CAM Board




Introduction: Time Lapse Camera Using the ESP32-CAM Board

#BnBe is a platform to help teach electronics no matter what the age or skill level. We’re currentl…

This project builds upon the previous digital image camera project and we build a time-lapse camera using the ESP32-CAM board. All the images are saved to the microSD card in sequence and the board goes to sleep after taking an image to help save power. This is handy if you power it using a battery.

The video above covers everything you need to know and also explains how the sketch is put together.

Step 1: Gather the Parts

The ESP32-CAM board already contains the camera module, and microSD card slot that we need for this sketch. In addition to this, you will need a microSD card, a 5V power source and also a USB to serial converter to upload the sketch.

Step 2: Wire Up the Board

The ESP32-CAM board does not have an onboard USB connector so you need to use an external USB to serial converter to upload the sketch. You can use the wiring connections shown above but make sure that the USB to serial converter is connected in the 3.3V mode.

It is recommended to use an external 5V supply to power the board, particularly if you are using an FTDI breakout board. For the external 5V supply, a simple USB breakout board will do just fine. There has been some success in powering the board directly from the CP2102 breakout board so you can try that first. The board also has a 3.3V power pin if needed.

The jumper is needed to put the board in the download mode. Once you have everything connected, power up the board, open a serial terminal (Tools->Serial Monitor) with a baud rate of 115,200 and press the reset button. You should obtain an output as shown in the image and this will indicate that everything is working as expected.

Step 3: Download the Sketch & Format SD Card

Download the sketch using the following link: https://github.com/bnbe-club/time-lapse-camera-esp32-cam-diy-8

The sketch requires that the microSD card be formatted in the FAT32 file format which is usually the default file system. In windows, you can do this by right-clicking the microSD card, selecting format, then the correct settings and hitting start. Once this is done, insert the microSD card into the ESP32-CAM board.

Step 4: Upload & Test

Power up the board in the sketch upload mode and hit the upload button. Wait for it to complete. Once done, remove the boot jumper and press the reset button. The board will take an image, save it to the microSD card and go to sleep. The serial terminal will give you the board status along with any errors or warnings. Wait for sufficient time to lapse and the board will wake up again to repeat the cycle.

The second last line in the setup() function specifies the time-lapse and you can update this by changing the pre-processor directive located at the top of the sketch. The images will be stored in the microSD card and can be used as needed.

Step 5: Print the Enclosure

An enclosure greatly helps in taking steady images and I found a nice little enclosure the works great for this build.

Link to 3D model: https://www.thingiverse.com/thing:3652452

You can add a microUSB breakout board to power the ESP32-CAM board but since I only had one board with me, I decided to solder wires to the 5V and ground pin and use an external breakout board. The back cover was flipped to support this. The 3D model also contains several stands that allow for versatile mounting.

Step 6: Share Your Time Lapse Videos

It's amazing what this little board can do and the images produce some interesting results once color corrected. Do check out the video for a sample clip.

If you've liked this post, then don't forget to follow us using the links below as we will be building many more projects like this one:

Be the First to Share


    • Arduino Contest

      Arduino Contest
    • Furniture Contest

      Furniture Contest
    • Home Decor Challenge

      Home Decor Challenge



    Question 5 months ago

    Hi, Tried all I can but have come against brick wall. Wired exactly as plan. On upload getting the fatal error message: Failed to connect to ESP32:Timed out waiting for Packet header.
    Have tried all camera models but have gone back to WROVER_KIT. Help please


    9 months ago

    What happens when the SD card gets full?


    11 months ago

    Thank you so much!!! llevo 2 horas buscando un buen tutorial con un sketch que funcione y este me ha funcionado a la primera, ademas muy facil, Agusto!

    Amal M.K
    Amal M.K

    1 year ago

    hi! i tried to make the project but i gives me sd error. "Booting...
    E (2125) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
    Card Mount Failed"