Build Your Own Mini Digital Camera With ESP32-S3 Cam & ST7789 Display

by Project Pajri in Circuits > Arduino

748 Views, 3 Favorites, 0 Comments

Build Your Own Mini Digital Camera With ESP32-S3 Cam & ST7789 Display

Desain tanpa judul (12).png
WhatsApp Image 2026-03-22 at 05.16.30 (1).jpeg
WhatsApp Image 2026-03-22 at 05.16.30.jpeg


This project utilizes the XIAO ESP32-S3 Sense as the primary controller to capture real-time images through its integrated OV2640 camera sensor, streaming the video feed directly onto a 240x240 px ST7789 TFT LCD display. The standout feature of this build is its Triple-Button Interface, which allows users to interact seamlessly with their media by toggling between live streaming, capturing high-resolution photos, and instantly reviewing them from the microSD card storage. By leveraging the XIAO's built-in SD slot, the system functions as a fully standalone mini digital camera capable of both real-time monitoring and local data logging in a remarkably compact form factor.

Supplies

WhatsApp Image 2026-03-22 at 05.28.48.jpeg
WhatsApp Image 2026-03-22 at 23.33.16.jpeg

Core Components

  1. 1x Microcontroller: Seeed Studio XIAO ESP32-S3 Sense (U2).
  2. 1x Display: ST7789 LCD Module (240x240 px, 12-pin interface) (U1).
  3. 1x Custom PCB: Designed for this project and manufactured by JLCPCB.

Electronic Components (SMD 0603 & SOT-23)

  1. 3x Tactile Switches: HX-3x6x3.5-CA-0.6-2.5N (SW1, SW2, SW3) for Shutter and Navigation.
  2. 1x Slide Switch: MSK12C02 (SW4) for Power Control.
  3. 1x Transistor: S8050 (J3Y) (Q1) for LCD Backlight switching.
  4. Resistors (0603): 1x 10Ω (R1), 1x 10kΩ (R2), 1x 1kΩ (R3).
  5. Capacitor (0603): 1x 10nF (C1).

Storage & Power

  1. 1x MicroSD Card: To store captured photos (inserted into the XIAO S3 Sense slot).
  2. 1x LiPo Battery: 3.7V (Connected via the BAT+ / BAT- test points).

Tools Needed

  1. Soldering Station: Fine-tip iron or Hot Air station for SMD 0603 components.
  2. Solder Paste/Wire & Flux.
  3. Tweezers: Essential for placing small SMD parts.
  4. USB-C Cable: For firmware flashing and debugging.

PCB Design & Fabrication

Schematic MIniCam ESP32.png
Screenshot 2026-03-22 053329.png

I designed a custom PCB using EasyEDA to keep the camera as compact as possible. The circuit integrates the XIAO ESP32-S3 Sense, an ST7789 LCD, and a triple-button interface into one seamless board.

Key Design Features:

  1. Display: SPI connection with a transistor-controlled backlight.
  2. MCU: Full integration for the XIAO S3 Sense and its built-in microSD.
  3. UI & Power: Three tactile buttons for navigation and a slide switch for power management.

Fabrication: The project is hosted on OSHWlab. You can access the project link below to view the schematic or directly click the "Order at JLCPCB" button to get the boards manufactured professionally with just one click.

Soldering & Hardware Modification

33.png
WhatsApp Image 2026-03-22 at 05.45.49 (2).jpeg
WhatsApp Image 2026-03-22 at 05.45.49.jpeg
WhatsApp Image 2026-03-22 at 05.45.49 (1).jpeg

Now, let's assemble the components onto your custom PCB. Since we are using SMD 0603 footprints, precision is key.

Soldering Process:

  1. Passive Components: Start by soldering the small 0603 Resistors (R1, R2, R3) and Capacitor (C1).
  2. Discrete Components: Solder the S8050 Transistor (Q1), the Slide Switch (SW4), and the three Tactile Buttons (SW1, SW2, SW3).
  3. Core Modules: Carefully solder the ST7789 LCD (U1) and the XIAO ESP32-S3 Sense (U2) onto the board.

⚠️ Critical Hardware Hack: Cutting J3

Because the XIAO ESP32-S3 Sense and the ST7789 display both use pull-up resistors on the same lines, the SD card will fail to initialize if both are active.

Instructions:

  1. Locate the J3 pad on the XIAO ESP32-S3 Sense expansion board (see the reference image).
  2. Use a sharp hobby knife or cutter to cut the trace between the two pads.

Firmware & IDE Setup

Screenshot 2026-03-22 055132.png
9.jpg
10.jpg

Flash the code using the Arduino IDE. Since the project uses specific camera pin mapping for the XIAO S3 Sense, you need to manage two files in your sketch folder. Github: link

File Organization:

  1. Main Sketch: Create your main .ino file and paste the primary code.
  2. New Tab (camera_pins.h):
  3. In the Arduino IDE, click the three-dot menu (or the downward arrow) on the top right and select "New Tab".
  4. Name this file camera_pins.h.
  5. Paste the specific GPIO pin definitions for the XIAO ESP32-S3 Sense camera into this tab.

Core Functionalities:

  1. Dual Mode System: Toggles between Live View (streaming) and Gallery Mode (viewing saved photos) using a boolean state.
  2. Color Correction (Swap565): A custom function fixes the byte order of the camera data to ensure accurate colors on the ST7789 display.
  3. JPEG Decoding: Uses the TJpg_Decoder library to render saved .jpg files from the SD card back onto the 240x240 screen.
  4. Automated Storage: When BTN_SHOOT is pressed, the frame is converted to JPEG and saved with an incremental filename (e.g., img1.jpg, img2.jpg).

Button Mapping:

  1. BTN_SHOOT: Capture Photo (Preview) / Return to Camera (Gallery).
  2. BTN_NEXT: Enter Gallery / Next Photo.
  3. BTN_PREV: Previous Photo.
Important IDE Settings:
  1. Board: "Seeed XIAO ESP32S3"
  2. PSRAM: "OPI PSRAM" (Required for 240x240 camera buffer).
  3. Flash Mode: "QIO 80MHz"

Final Assembly & Testing.

WhatsApp Image 2026-03-22 at 23.33.59 (1).jpeg
WhatsApp Image 2026-03-22 at 23.33.59.jpeg
I'm Build mini digital cam using ESP32 & ST7789 || free file pcb & code

Congratulations! Your DIY Mini Digital Camera is now fully assembled and operational. The final build features a super compact form factor, barely larger than the XIAO module itself, yet it packs a powerful punch with its integrated display and microSD storage.

How to Use:

  1. Power On: Slide the power switch (SW4) to turn on the device.
  2. Live View: You will immediately see the real-time camera stream on the 240x240 LCD.
  3. Capture: Press the Shoot Button (BTN_SHOOT) to save the current frame to the SD card as a .jpg file.
  4. Gallery Mode: Press the Next Button (BTN_NEXT) to enter the gallery and view your saved photos.
  5. Navigation: Use the Next and Prev buttons to scroll through your images, and press Shoot again to return to the live camera mode.