Capturing the passage of time through time-lapse photography is a brilliant way to showcase dynamic scenes—whether it’s a blooming flower, cityscapes, or even engineering projects. But high-end time-lapse cameras can be expensive.
That’s where a DIY 3D printed mini time-lapse camera comes in—using the Xiao ESP32 S3 and professional-grade 3D printing from JUSTWAY, this compact device will let you shoot impressive time-lapse videos on a budget.
And, if you're looking to save on production costs, JUSTWAY is offering 15% cashback on all orders placed between June 1 and August 31, 2025! More on that later.
Why Use the Xiao ESP32 S3 for Time-Lapse Photography?The Xiao ESP32 S3 is an ultra-compact and efficient microcontroller, making it a perfect fit for a portable time-lapse camera. It boasts:
- ESP32-S3 MCU with dual-core processing for smooth image handling.
- Built-in USB connectivity, making programming hassle-free.
- WiFi integration, allowing remote adjustments of time-lapse settings.
- Low power consumption, extending the operational time significantly.
With its small footprint and powerful capabilities, the Xiao ESP32 S3 is ideal for building an ultra-portable time-lapse rig.
Designing & 3D Printing the Camera HousingOptimizing the 3D Printed Enclosure
A high-quality custom enclosure ensures:
- Protection for internal electronic components.
- Compact & portable design that’s easy to mount.
- Customization options, like tripod mounts or waterproofing.
Instead of using a home 3D printer with potential precision issues, we turned to JUSTWAY’s professional 3D printing services, which offer: ✔ Durable materials (ABS, PETG, Resin) to withstand outdoor conditions. ✔ Precision manufacturing, eliminating inconsistencies in small designs. ✔ Affordable, reliable service, plus SUMMER CASHBACK EVENT to save 15% on your order!
💡 Want to 3D print your enclosure with expert precision? Use JUSTWAY to get cashback! Details below.Hardware & AssemblyRequired Components
- Xiao ESP32 S3
- OV2640 or OV5640 Camera Module
- Micro SD Card for Storage
- Custom 3D-Printed Case (Ordered via JUSTWAY)
1️⃣ Connect the Camera Module and the SD Card securely using its designated pins.
2️⃣ Fit all components into the 3D-printed enclosure for protection.
- Install Arduino IDE – Download and install the latest version of Arduino IDE.
- Add ESP32 Board Support – In Arduino IDE, go to Preferences and add the following URL in "Additional Board Manager URLs":
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Install ESP32 Board Package – Open Boards Manager, search for ESP32, and install the latest package.
- Select Xiao ESP32 S3 Board – Under Tools > Board, choose Xiao ESP32 S3.
- Open Example Code – Go to File > Examples > ESP32 > Camera > CameraWebServer.
- Modify Code for Xiao ESP32 S3 – Update the code with this below code:
#include "esp_camera.h"
#include <WiFi.h>
#define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM
#include "camera_pins.h"
// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "**********";
const char* password = "**********";
void startCameraServer();
void setupLedFlash(int pin);
void setup() {
Serial.begin(115200);
while(!Serial);
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.frame_size = FRAMESIZE_UXGA;
config.pixel_format = PIXFORMAT_JPEG; // for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if(config.pixel_format == PIXFORMAT_JPEG){
if(psramFound()){
config.jpeg_quality = 10;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_LATEST;
} else {
// Limit the frame size when PSRAM is not available
config.frame_size = FRAMESIZE_SVGA;
config.fb_location = CAMERA_FB_IN_DRAM;
}
} else {
// Best option for face detection/recognition
config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
config.fb_count = 2;
#endif
}
// camera init
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}
sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1); // flip it back
s->set_brightness(s, 1); // up the brightness just a bit
s->set_saturation(s, -2); // lower the saturation
}
// drop down frame size for higher initial frame rate
if(config.pixel_format == PIXFORMAT_JPEG){
s->set_framesize(s, FRAMESIZE_QVGA);
}
// Setup LED FLash if LED pin is defined in camera_pins.h
#if defined(LED_GPIO_NUM)
setupLedFlash(LED_GPIO_NUM);
#endif
WiFi.begin(ssid, password);
WiFi.setSleep(false);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
startCameraServer();
Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.println("' to connect");
}
void loop() {
// Do nothing. Everything is done in another task by the web server
delay(10000);
}
- Connect the Board – Use a USB-C cable to connect the Xiao ESP32 S3 to your computer.
- Select Port – Under Tools > Port, choose the correct COM port.
- Upload Code – Click Upload and wait for the process to complete
- Open Serial Monitor – Set baud rate to 115200.
- Find IP Address – The board will display an IP address in the Serial Monitor.
- Access Camera Stream – Open a browser and enter the IP address to view the live camera feed.
- Capture Images – Use the modified code to take snapshots and store them on an SD card.
Next use this python script to make a video out of the images.
import cv2
import os
import numpy as np
from natsort import natsorted
def create_timelapse(image_folder='img', output_path='timelapse.mp4', fps=24):
# Get the list of images from the folder
images = [img for img in os.listdir(image_folder) if img.endswith((".jpg", ".jpeg", ".png"))]
if not images:
print("No images found in the specified folder!")
return
# Sort the images naturally (1.jpg, 2.jpg, 10.jpg instead of 1.jpg, 10.jpg, 2.jpg)
images = natsorted(images)
# Read the first image to get dimensions
frame = cv2.imread(os.path.join(image_folder, images[0]))
height, width, _ = frame.shape
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
# Counter for progress
total_frames = len(images)
print("Creating timelapse video...")
for idx, image in enumerate(images):
frame = cv2.imread(os.path.join(image_folder, image))
out.write(frame)
# Show progress
print(f"Processing: {idx+1}/{total_frames} images", end='\r')
# Release the video writer
out.release()
print(f"\nTimelapse video created successfully at {output_path}")
if __name__ == "__main__":
create_timelapse()
💰 JUSTWAY is offering 15% cashback on all successful orders placed between June 1st – August 31st, 2025 (UTC). If you’re using JUSTWAY’s 3D printing or CNC services, this is the perfect time to bring your projects to life at a discounted price!
Follow this link to get a Summer cashback from JUSTWAY
✔ Exclusive 15% Cashback on all manufacturing services!
✔ Applies to CNC, 3D Printing, and Sheet Metal fabrication.
✔ Fast approval process—cashback credited within 3 business days.
✔ Flexible use—combine cashback with coupons and loyalty points for extra savings!
✅ How to Apply1️⃣ Place an order with JUSTWAY between June 1st – August 31st, 2025.
2️⃣ After your order is completed (shipped/delivered), send an email to marketing03@justway.com with:
- Your JUSTWAY user ID or email
- Order number
A short message requesting cashback.
3️⃣ JUSTWAY will review your order for eligibility.
4️⃣ Upon approval, 15% of your order value will be credited to your JUSTWAY account balance within 3 business days.
📌 Important Cashback Details🚀 Available for ALL JUSTWAY services (CNC, 3D printing, sheet metal fabrication, etc.). 🚫 Exclusions apply—cashback does NOT cover shipping, VAT, handling, or customs fees. 📧 Cashback is NOT automatic—you must apply via email. 💰 JUSTWAY Account Credit—Cashback is non-transferable and non-withdrawable. 📊 Multiple orders?—List all order numbers in one email to apply for all at once.
🧠 Pro Tip!💨 The earlier you place an order, the sooner you can apply and use cashback for your next project!
🛠️ Don’t wait—cashback applications close on September 15th, 2025!
Final ThoughtsBy combining Xiao ESP32 S3, JUSTWAY’s expert 3D printing, and an optimized enclosure, you can create a powerful, budget-friendly time-lapse camera for capturing stunning visual sequences.
Follow this link to get a Summer cashback from JUSTWAY
And with JUSTWAY’s Summer Cashback Event, this is the best time to save 15% on your manufacturing orders! Whether it’s 3D printing, CNC machining, or sheet metal fabrication, you can bring your ideas to life at a lower cost.
Comments