Skip to content

Live image from a non-FIFO OV7670 camera module to a ST7789 TFT display with multithreading (and maybe SD reader)

License

Notifications You must be signed in to change notification settings

SimoSera/OV7670-ESP32-TFT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Changes from Original Repository

CLick here to see the original repository.

I modified the code to make this project work with ST7789 TFT display (instead of the ILI9341) and I implemented multithreading for better performance. I also changed two pins connections (13->4 and 14->19) so that now the pins 12 to 15 are free to be used for another spi comunication (maybe a SD card reader)

For a more in dept description on the changes read here

Non-FIFO OV7670 Video on TFT with ESP32

Draw live color video from a non-FIFO OV7670 camera module on a 240x320 ST7789 TFT display using an ESP32 board. The script is based on the example from the OV7670-ESP32 driver.

The official esp32-camera only supports the FIFO version of OV7670s.

Getting Started

Hardware

  • ESP32 (Node32S or ESP32 DevKit V1 will do) - I used a clone of ESP32 DevKit V1
  • non-FIFO OV7670 camera module
  • 240x320 ST7789 TFT LCD display

Wiring

OV7670 non-FIFO ESP32 GPIO Pin
RESET 3.3V
PWDN GND
SSCB_SDA (SIOD) 21 (pulled up with 1kΩ resistor)
SSCB_SCL (SIOC) 22 (pulled up with 1kΩ resistor)
HREF (not connected)
D0 36
D1 39
D2 34
D3 35
D4 32
D5 33
D6 25
D7 26
XCLK 27
PCLK 19
VSYNC 4
ST7789 TFT ESP32 GPIO Pin
VCC 3.3V
GND GND
DC 16
CS 5
RES 17
SDA 23
SCL 18
BLK (not connected)

Libraries

To work this project needs a couple of libraries. This code (at the time of writing this) works with the latest versions of Arduino IDE and ESP32 firmware.

The libraries needed are:

  • Custom OV7670 and I2SCamera libraries originally from this library but modified to work with the latest libraries and firmware. So to make the code work you need to download the OV7670.h, OV7670.cpp, I2SCamera.h and I2SCamera.cpp files.
  • Adafruit_GFX
  • Adafruit_ST7789 (this library is made for both ST7735 and ST7789)

If you have trouble flashing the ESP32, try press and hold the boot button and press EN once before flashing, and release boot when "Connecting....." shows up.

Rotation and Resolution

Change the ROTATION and MODE definition in the script.

When choosing the MODE remember that increasing the quality decreases speed and vice versa. It still works at good speed even in the 320x240 mode.

Due to the size of the screen, only the following resolutions are supported:

  • QVGA (320X240)
  • QQVGA (160x120)
  • QCIF (176x144, cropped)
  • QQCIF (88x72, cropped)

About

Live image from a non-FIFO OV7670 camera module to a ST7789 TFT display with multithreading (and maybe SD reader)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 79.4%
  • C 20.6%