NederlandsKlik deze knop voor de Nederlandstalige website

LILYGO TTGO T-Journal: ESP32 + OV2640 Camera

The LILYGO TTGO T-Journal is one of the new ESP32 development boards with a built-in 2-megapixel camera module. In addition to the camera, WiFi and Bluetooth, this board also has a number of interesting features. On the board you will also find an OLED screen, USB to serial interface, GPIOs and connections for a 3.7V lithium battery and external (SMA or U.FL) antenna. Of course, I got my T-Journal again from “One Guy, One Blog” home supplier: VNGsystems.

LILYGO TTGO T-Journal ESP32 with OV2640 Camera: back
LILYGO TTGO T-Journal ESP32 with OV2640 Camera: back

ESP32 microcontroller

The basis of the board is the ESP32 microcontroller, in this case, the 7mm x 7mm QFN variant “ESP32-PICO-D4” (datasheet). This 32-bit dual-core microcontroller with 4MiB memory also provides the WiFi and Bluetooth connections. On this board, the ESP32 is hidden under the OLED display and a heat sink.

USB and battery

You can program the ESP32 with the well-known Arduino IDE. The board has a CP2104 USB to TTL interface and micro-USB connection. So you can connect it directly to a computer without a separate serial adapter.

The IP5306 IC is a battery management chip that ensures the safe charging and discharging of an optional 3.7V lithium battery. But of course, you can also supply the board with power via the USB port.

LILYGO TTGO T-Journal ESP32 with OV2640 Camera: front
LILYGO TTGO T-Journal ESP32 with OV2640 Camera: front

OV2640 camera

The OV2640 – 2.0 MP camera module is based on the OV2640 sensor from OmniVision. The color sensor has an optical format of 1 / 4.0 ″, which in combination with the pixel size of 2.2 µm x 2.2 µm results in the 2.0 MP 1600 x 1200 UXGA image. The sensor is used in cell phones, PDAs, toys and other battery-powered products. It is also a popular module for Arduino, ChipKit, STM32, ARM, and FPGA projects. The library that you can use for this camera is the ESP32-Camera library.

OV2640 Camera
OV2640 Camera

OLED display

The white OLED screen is of the SSD1306 type. The size is 0.91 inch (2.31 centimeters) and the resolution 128 pixels x 32 pixels. The screen can be controlled via I2C through the ThingPulse OLED SSD1306 Arduino library.

LILYGO TTGO T-Journal ESP32 with OV2640 Camera: OLED display
LILYGO TTGO T-Journal ESP32 with OV2640 Camera: OLED display

GPIO

On the long sides of the board, you will find two GPIOs: GPIO2 (ADC2_2) and GPIO4 (ADC2_0). Both are accompanied by 3.3V and GND. You only have to solder the headers and you have connections that are pin-compatible with analog servos. There are also 2 GPIOs (13 and 14) for I2C and GPIO32 with a push button.

LILYGO TTGO T-Journal demo firmware

The LILYGO TTGO T-Journal comes with demo firmware loaded in the ESP32. You can try out the demo as follows:

  • Connect the T-Journal to a USB charger or power bank
  • With telephone, tablet or laptop you can now connect to the WiFi network “TTGO-CAMERA“, the password is “12345678
  • Open the browser and go to the IP address indicated on the OLED screen: 192.168.1.1

You now see a live T-Journal video stream in the browser.

LILYGO TTGO T-Journal: streaming video
LILYGO TTGO T-Journal: streaming video

A screenshot of the phone then looks like this:

LILYGO TTGO T-Journal: video streaming (screenshot)
LILYGO TTGO T-Journal: video streaming (screenshot)

The output of the serial monitor (115200 baud) after a reset:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1324
load:0x40078000,len:7788
ho 0 tail 12 room 4
load:0x40080400,len:6448
entry 0x400806e8
I (34) camera: Enabling XCLK output
D (35) camera: Initializing SSCB
D (36) camera: Resetting camera
D (56) camera: Searching for camera address
D (114) camera: Detected camera at address=0x30
I (125) camera: Camera PID=0x26 VER=0x42 MIDL=0x7f MIDH=0xa2
D (125) camera: Doing SW reset of sensor
D (199) camera: Setting frame size to 800x600
D (267) camera: in_bpp: 2, fb_bpp: 2, fb_size: 96000, mode: 0, width: 800 height: 600
D (267) camera: Allocating frame buffer (96000 bytes)
D (269) camera: Initializing I2S and DMA
D (273) camera: Line width (for DMA): 6400 bytes
D (277) camera: DMA buffer size: 3200, DMA buffers per line: 2
D (282) camera: DMA buffer count: 8
D (285) camera: Allocating DMA buffer #0, size=3200
D (290) camera: Allocating DMA buffer #1, size=3200
D (295) camera: Allocating DMA buffer #2, size=3200
D (299) camera: Allocating DMA buffer #3, size=3200
D (304) camera: Allocating DMA buffer #4, size=3200
D (308) camera: Allocating DMA buffer #5, size=3200
D (313) camera: Allocating DMA buffer #6, size=3200
D (318) camera: Allocating DMA buffer #7, size=3200
D (322) camera: Initializing GPIO interrupts
D (388) camera: Init done
I (392) wifi: wifi driver task: 3ffe3934, prio:23, stack:3584, core=0
I (901) wifi: wifi firmware version: d8b211c
I (902) wifi: config NVS flash: enabled
I (904) wifi: config nano formating: disabled
I (935) wifi: Init dynamic tx buffer num: 32
I (936) wifi: Init data frame dynamic rx buffer num: 10
I (936) wifi: Init management frame dynamic rx buffer num: 10
I (939) wifi: Init static rx buffer size: 1600
I (943) wifi: Init static rx buffer num: 4
I (947) wifi: Init dynamic rx buffer num: 10
I (1144) wifi: mode : softAP (24:0a:c4:2f:88:d5)
AP Config Success.
AP MAC: 24:0A:C4:2F:88:D5

The “softAP” demo firmware (an Arduino sketch) can be found on the GitHub page of Lilygo.

LILYGO TTGO – To be continued

In a subsequent article, we will use the T-Journal for a fun project. Consider use as:

  • FPV camera on a robot / car / boat / quadcopter
  • Video doorbell
  • Pan / tilt security camera
  • Motion detector for a Halloween project etc. etc.

Then we see how easy it is to program this board with the Arduino IDE. We will also compare T-Journal with other ESP32-based boards such as the ESP32-CAM. In other words: to be continued!

ESP32 boards
ESP32 boards

Specifications LILYGO TTGO T-Journal

Microcontroller: ESPRESSIF ESP32-PICO-D4, 240MHz dual-core, 32-bit
Display: OLED 0.91 “SSD1306, 128×32 pixels
USB to TTL CP2104
Camera: OV2640 2 megapixel
WIFI: 802.11 b / g / n / e / i (up to 150 Mbps)
Bluetooth: v4.2BR / EDR and BLE standard

Operating voltage: 2.3V-3.6V
Operating current: approximately 160 mA
Operating temperature range: -40 ℃ ~ + 85 ℃
Dimensions: 64.57 mm * 23.98 mm

USB 5V / 1A power supply
Charging current 1A
Connection for 3.7V lithium battery

Schematics: https://github.com/LilyGO/ESP32-Camera/blob/master/ov2640_v1.3.pdf

VNG Systems

8 Comments