{"id":92734,"date":"2020-01-16T14:14:08","date_gmt":"2020-01-16T14:14:08","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=92734"},"modified":"2020-07-30T14:05:54","modified_gmt":"2020-07-30T14:05:54","slug":"ttgo-t-journal-esp32-camera-getting-started","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/ttgo-t-journal-esp32-camera-getting-started\/","title":{"rendered":"TTGO T-Journal ESP32 Camera: Built-in Programmer, OLED, Antenna and Project Examples"},"content":{"rendered":"\n<p>This is a getting started guide for the TTGO T-Journal ESP32 Camera Development Board. The TTGO T-Journal features an OV2640 camera, an OLED display, several GPIOs to connect peripherals and a built-in programmer, which makes it easy to upload code. We&#8217;ll take a quick look at the camera dev board and learn how to program it using Arduino IDE.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples-1024x576.jpg?resize=1024%2C576&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 Camera: Built-in Programmer, OLED, Antenna and Project Examples\" class=\"wp-image-92843\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Where to Buy?<\/h2>\n\n\n\n<p>You can go to the<a href=\"https:\/\/makeradvisor.com\/tools\/ttgo-t-journal-esp32-camera\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" TTGO T-Journal page on Maker Advisor (opens in a new tab)\"> TTGO T-Journal page on Maker Advisor<\/a> to compare the board on different stores.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" aria-label=\"TTGO T-Journal ESP32 Camera + OLED  (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ttgo-t-journal-esp32-camera\/\" target=\"_blank\">TTGO T-Journal ESP32 Camera + OLED +Antenna + Built-in Programmer<\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/makeradvisor.com\/tools\/ttgo-t-journal-esp32-camera\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-Camera-Dev-Board-750.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 Camera + OLED +Antenna + Built-in Programmer\" class=\"wp-image-92845\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-Camera-Dev-Board-750.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-Camera-Dev-Board-750.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing the TTGO T-Journal ESP32 Camera<\/h2>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" aria-label=\"TTGO T-Journal (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ttgo-t-journal-esp32-camera\/\" target=\"_blank\">TTGO T-Journal<\/a> is a $12-$15 ESP32 Camera Development Board with an OV2640 camera, an antenna, an I2C SSD1306 0.91 inch OLED display, some exposed GPIOs, and a micro-USB interface that makes it easy and quick to upload code to the board.<\/p>\n\n\n\n<p>For a complete overview of this board you can watch the following video or read this article: <a href=\"https:\/\/makeradvisor.com\/ttgo-t-journal-esp32-camera-board-review\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"TTGO T-Journal ESP32 Camera Dev Board Review (opens in a new tab)\">TTGO T-Journal ESP32 Camera Dev Board Review<\/a>.<\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/ZrvH9fI1o_A?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TTGO T-Journal ESP32 Features<\/h2>\n\n\n\n<p>Here&#8217;s a summary of the TTGO T-Journal features:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Chipset ESPRESSIF-ESP32-PCIO-D4 240MHz Xtensa\u00ae single-\/dual-core 32-bit LX6 microprocessor<\/li><li>FLASH QSPI flash\/SRAM, up to 4 x 16 MBSRAM 520 kB SRAM<\/li><li>Reset button and button on GPIO 32<\/li><li>0.91 inch SSD1306 OLED display<\/li><li>Power indicator red LED<\/li><li>USB to TTL CP2104 (you can upload code via USB cable);<\/li><li>Camera OV2640 &nbsp;2 Megapixel<\/li><li>Steering engine analog servo (comes with two sets of pins ideal to connect servos)<\/li><li>Working voltage: 2.3V-3.6V<\/li><li>Working current: about 160mA<\/li><li>Size: 64.57mm x 23.98mm<\/li><\/ul>\n\n\n\n<p><strong>Power supply specifications:<\/strong>&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Power Supply USB 5V\/1A<\/li><li>Charging current 1A<\/li><li>Battery 3.7V lithium battery<\/li><\/ul>\n\n\n\n<p><strong>Read our in-depth review: <\/strong><a href=\"https:\/\/makeradvisor.com\/ttgo-t-journal-esp32-camera-board-review\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"TTGO T-Journal ESP32 Camera Development Board (opens in a new tab)\">TTGO T-Journal ESP32 Camera Development Board<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TTGO T-Journal ESP32 Board Pinout<\/h2>\n\n\n\n<p>Having the right pinout for your camera board is very important. If you don&#8217;t assign the right camera pins in your code, the camera will not work. The following image shows the TTGO T-Journal ESP32 board pinout.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1200\" height=\"848\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGOcam-pinout.jpg?resize=1200%2C848&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 Board Pinout\" class=\"wp-image-92757\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGOcam-pinout.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGOcam-pinout.jpg?resize=300%2C212&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGOcam-pinout.jpg?resize=1024%2C723&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGOcam-pinout.jpg?resize=768%2C542&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption><center><a href=\"https:\/\/github.com\/LilyGO\/ESP32-Camera\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Image Source (opens in a new tab)\">Image Source<\/a><\/center><\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"> TTGO T-Journal ESP32 Camera Connections<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-Camera-OV2640.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 OV2640 Camera\" class=\"wp-image-92759\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-Camera-OV2640.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-Camera-OV2640.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>Here&#8217;s a table with the connections between the ESP32 and the camera:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>OV2640 Camera<\/strong><\/td><td><strong>ESP32<\/strong><\/td><\/tr><tr><td>D2<\/td><td>GPIO 17<\/td><\/tr><tr><td>D3<\/td><td>GPIO 35<\/td><\/tr><tr><td>D4<\/td><td>GPIO 34<\/td><\/tr><tr><td>D5<\/td><td>GPIO 5<\/td><\/tr><tr><td>D6<\/td><td>GPIO 39<\/td><\/tr><tr><td>D7<\/td><td>GPIO 18<\/td><\/tr><tr><td>D8<\/td><td>GPIO 36<\/td><\/tr><tr><td>D9<\/td><td>GPIO 19<\/td><\/tr><tr><td>SIOC<\/td><td>GPIO 23<\/td><\/tr><tr><td>SIOD<\/td><td>GPIO 25<\/td><\/tr><tr><td>XCLK<\/td><td>GPIO 27<\/td><\/tr><tr><td>VSYNC<\/td><td>GPIO 22<\/td><\/tr><tr><td>HREF<\/td><td>GPIO 26<\/td><\/tr><tr><td>PCLK<\/td><td>GPIO 21<\/td><\/tr><tr><td>RST<\/td><td>GPIO 15<\/td><\/tr><tr><td>PWDN<\/td><td>GPIO 0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So, the pin assignment in your Arduino sketch should be as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM     27\n#define SIOD_GPIO_NUM     25\n#define SIOC_GPIO_NUM     23\n#define Y9_GPIO_NUM       19\n#define Y8_GPIO_NUM       36\n#define Y7_GPIO_NUM       18\n#define Y6_GPIO_NUM       39\n#define Y5_GPIO_NUM       5\n#define Y4_GPIO_NUM       34\n#define Y3_GPIO_NUM       35\n#define Y2_GPIO_NUM       17\n#define VSYNC_GPIO_NUM    22\n#define HREF_GPIO_NUM     26\n#define PCLK_GPIO_NUM     21<\/code><\/pre>\n\n\n\n<p>Because this board uses the same camera used in the <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">ESP32-CAM board<\/a>, the <a href=\"https:\/\/randomnerdtutorials.com\/category\/ESP32-CAM\/\">examples for the ESP32-CAM <\/a>(that don&#8217;t use microSD card) should also work with the TTGO T-Journal by changing the pin definition. We&#8217;ll show you a couple of examples in a moment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TTGO T-Journal ESP32 Board OLED Connections<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-CAM-OLED-display.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 Board OLED Connections Pins SCL SDA I2C\" class=\"wp-image-92760\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-CAM-OLED-display.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/TTGO-T-Journal-ESP32-CAM-OLED-display.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>This board comes with an I2C SSD1306 0.91 inch OLED display. To interact with the display you can use the <a rel=\"noreferrer noopener\" aria-label=\"Adafruit SSD1306 (opens in a new tab)\" href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\" target=\"_blank\">Adafruit SSD1306<\/a>, the <a rel=\"noreferrer noopener\" aria-label=\"oled-ssd1306 (opens in a new tab)\" href=\"https:\/\/github.com\/ThingPulse\/esp8266-oled-ssd1306\" target=\"_blank\">oled-ssd1306<\/a> or other compatible libraries. We usually use the Adafruit SSD1306 along with the <a rel=\"noreferrer noopener\" aria-label=\"Adafruit_GFX (opens in a new tab)\" href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\">Adafruit_GFX<\/a> to interact with OLED displays. <\/p>\n\n\n\n<p>The OLED communicates with the ESP32 using the following pins:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>OLED<\/strong><\/td><td><strong>ESP32<\/strong><\/td><\/tr><tr><td>SDA<\/td><td>GPIO 14<\/td><\/tr><tr><td>SCL<\/td><td>GPIO 13<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">TTGO T-Journal ESP32 Board Control OLED Display<\/h2>\n\n\n\n<p>In this section, well show you quick tips on how to control the OLED display of the TTGO T-Journal ESP32 board.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Libraries<\/h3>\n\n\n\n<p>To control the OLED display, we&#8217;ll use the <a rel=\"noreferrer noopener\" aria-label=\"Adafruit SSD1306 (opens in a new tab)\" href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\" target=\"_blank\">Adafruit SSD1306<\/a> and <a rel=\"noreferrer noopener\" aria-label=\"Adafruit GFX (opens in a new tab)\" href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\">Adafruit GFX<\/a> libraries. These libraries can be installed through the Arduino IDE Library Manager.<\/p>\n\n\n\n<p>In your Arduino IDE, go to <strong>Sketch <\/strong>&gt; <strong>Include Library<\/strong> &gt; <strong>Manage Libraries<\/strong>. Then, search for the library name and install it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OLED I2C Pins and Display Size<\/h3>\n\n\n\n<p>Controlling this OLED display is similar to control a regular 0.96 OLED display connected to an ESP32. The only difference is the way you initialize the display.<\/p>\n\n\n\n<p>You need to take into account the I2C pins used by this display (because it doesn&#8217;t use the default I2C pins), and the size of the display.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>I2C pins:<\/strong><ul><li>SDA (GPIO 14)<\/li><li>SCL (GPIO 13)<\/li><\/ul><\/li><li><strong>Display size:<\/strong><ul><li>Width: 128 px<\/li><li>Height: 32 px<\/li><\/ul><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Arduino Sketch<\/h3>\n\n\n\n<p>To control the OLED display, first, you need to import the required libraries:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#include &lt;Wire.h>\n#include &lt;Adafruit_GFX.h>\n#include &lt;Adafruit_SSD1306.h><\/code><\/pre>\n\n\n\n<p> Define the OLED size:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 32<\/code><\/pre>\n\n\n\n<p>Define the I2C pins:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define I2C_SDA 14\n#define I2C_SCL 13<\/code><\/pre>\n\n\n\n<p>Next create an <span class=\"rnthl rntliteral\">Adafruit_SSD1306<\/span> object called <span class=\"rnthl rntliteral\">display<\/span> as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, -1);<\/code><\/pre>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">setup()<\/span>, you need to initialize an I2C communication on the I2C pins you&#8217;ve defined earlier as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>Wire.begin(I2C_SDA, I2C_SCL);<\/code><\/pre>\n\n\n\n<p>Then, initialize the OLED display as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {\n  Serial.println(F(\"SSD1306 allocation failed\"));\n  for(;;);\n}<\/code><\/pre>\n\n\n\n<p>After properly initializing the display, you can use the usual functions to write text and display shapes on the OLED. Read our <a href=\"https:\/\/randomnerdtutorials.com\/esp32-ssd1306-oled-display-arduino-ide\/\">OLED tutorial with the ESP32<\/a> to learn more on how to interact with the OLED display.<\/p>\n\n\n\n<p>For testing purposes, you can upload the following code to your board. It simply displays &#8220;Hello World&#8221;.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/ttgo-t-journal-esp32-camera-getting-started\/\n  \n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files.\n  \n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n*\/\n\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n\n#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 32\n#define I2C_SDA 14\n#define I2C_SCL 13\n\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, -1);\n\nvoid setup() {\n  \n  Wire.begin(I2C_SDA, I2C_SCL);\n\n  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {\n    Serial.println(F(&quot;SSD1306 allocation failed&quot;));\n    for(;;);\n  }\n  \n  display.clearDisplay();\n  display.setTextSize(1);\n  display.setTextColor(WHITE);\n  display.setCursor(0, 0);\n  display.print(&quot;Hello World!&quot;);;\n  display.display();\n}\n\nvoid loop() {\n  \/\/ put your main code here, to run repeatedly:\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/TTGO-T-Journal-ESP32-Camera\/TTGO-T-Journal-ESP32-Camera-OLED-Hello-World.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Hello-World-OLED.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"TTGO T-Journal ESP32 Board Control OLED Display Sample Message Hello World\" class=\"wp-image-92847\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Hello-World-OLED.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Hello-World-OLED.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">TTGO T-Journal ESP32 Camera Projects<\/h2>\n\n\n\n<p>We&#8217;ve modified some of our existing <a href=\"https:\/\/randomnerdtutorials.com\/category\/ESP32-CAM\/\">ESP32-CAM projects<\/a> to be compatible with the TTGO T-Journal. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Video Streaming Web Server<\/h3>\n\n\n\n<p>The following code creates a video streaming web server on the camera IP address. So, you can create an IP CAM that can be integrated in Home Automation platforms like Home Assistant or Node-RED.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/ttgo-t-journal-esp32-camera-getting-started\/\n  \n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files.\n  \n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n*\/\n\n#include &quot;esp_camera.h&quot;\n#include &lt;WiFi.h&gt;\n#include &quot;esp_timer.h&quot;\n#include &quot;img_converters.h&quot;\n#include &quot;Arduino.h&quot;\n#include &quot;fb_gfx.h&quot;\n#include &quot;soc\/soc.h&quot; \/\/disable brownout problems\n#include &quot;soc\/rtc_cntl_reg.h&quot;  \/\/disable brownout problems\n#include &quot;esp_http_server.h&quot;\n\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n\n#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 32\n#define I2C_SDA 14\n#define I2C_SCL 13\n\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, -1);\n\n\/\/Replace with your network credentials\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\n\n#define PART_BOUNDARY &quot;123456789000000000000987654321&quot;\n\n\/\/ OV2640 camera module pins (CAMERA_MODEL_TTGO-T-Journal)\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM     27\n#define SIOD_GPIO_NUM     25\n#define SIOC_GPIO_NUM     23\n#define Y9_GPIO_NUM       19\n#define Y8_GPIO_NUM       36\n#define Y7_GPIO_NUM       18\n#define Y6_GPIO_NUM       39\n#define Y5_GPIO_NUM       5\n#define Y4_GPIO_NUM       34\n#define Y3_GPIO_NUM       35\n#define Y2_GPIO_NUM       17\n#define VSYNC_GPIO_NUM    22\n#define HREF_GPIO_NUM     26\n#define PCLK_GPIO_NUM     21\n\nstatic const char* _STREAM_CONTENT_TYPE = &quot;multipart\/x-mixed-replace;boundary=&quot; PART_BOUNDARY;\nstatic const char* _STREAM_BOUNDARY = &quot;\\r\\n--&quot; PART_BOUNDARY &quot;\\r\\n&quot;;\nstatic const char* _STREAM_PART = &quot;Content-Type: image\/jpeg\\r\\nContent-Length: %u\\r\\n\\r\\n&quot;;\n\nhttpd_handle_t stream_httpd = NULL;\n\nstatic esp_err_t stream_handler(httpd_req_t *req){\n  camera_fb_t * fb = NULL;\n  esp_err_t res = ESP_OK;\n  size_t _jpg_buf_len = 0;\n  uint8_t * _jpg_buf = NULL;\n  char * part_buf[64];\n\n  res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);\n  if(res != ESP_OK){\n    return res;\n  }\n\n  while(true){\n    fb = esp_camera_fb_get();\n    if (!fb) {\n      Serial.println(&quot;Camera capture failed&quot;);\n      res = ESP_FAIL;\n    } else {\n      if(fb-&gt;width &gt; 400){\n        if(fb-&gt;format != PIXFORMAT_JPEG){\n          bool jpeg_converted = frame2jpg(fb, 80, &amp;_jpg_buf, &amp;_jpg_buf_len);\n          esp_camera_fb_return(fb);\n          fb = NULL;\n          if(!jpeg_converted){\n            Serial.println(&quot;JPEG compression failed&quot;);\n            res = ESP_FAIL;\n          }\n        } else {\n          _jpg_buf_len = fb-&gt;len;\n          _jpg_buf = fb-&gt;buf;\n        }\n      }\n    }\n    if(res == ESP_OK){\n      size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);\n      res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);\n    }\n    if(res == ESP_OK){\n      res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);\n    }\n    if(res == ESP_OK){\n      res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));\n    }\n    if(fb){\n      esp_camera_fb_return(fb);\n      fb = NULL;\n      _jpg_buf = NULL;\n    } else if(_jpg_buf){\n      free(_jpg_buf);\n      _jpg_buf = NULL;\n    }\n    if(res != ESP_OK){\n      break;\n    }\n    \/\/Serial.printf(&quot;MJPG: %uB\\n&quot;,(uint32_t)(_jpg_buf_len));\n  }\n  return res;\n}\n\nvoid startCameraServer(){\n  httpd_config_t config = HTTPD_DEFAULT_CONFIG();\n  config.server_port = 80;\n\n  httpd_uri_t index_uri = {\n    .uri       = &quot;\/&quot;,\n    .method    = HTTP_GET,\n    .handler   = stream_handler,\n    .user_ctx  = NULL\n  };\n  \n  \/\/Serial.printf(&quot;Starting web server on port: '%d'\\n&quot;, config.server_port);\n  if (httpd_start(&amp;stream_httpd, &amp;config) == ESP_OK) {\n    httpd_register_uri_handler(stream_httpd, &amp;index_uri);\n  }\n}\n\nvoid setup() {\n  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); \/\/disable brownout detector\n \n  Serial.begin(115200);\n  Serial.setDebugOutput(false);\n  \n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sccb_sda = SIOD_GPIO_NUM;\n  config.pin_sccb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 20000000;\n  config.pixel_format = PIXFORMAT_JPEG; \n  \n  if(psramFound()){\n    config.frame_size = FRAMESIZE_UXGA;\n    config.jpeg_quality = 10;\n    config.fb_count = 2;\n  } else {\n    config.frame_size = FRAMESIZE_SVGA;\n    config.jpeg_quality = 12;\n    config.fb_count = 1;\n  }\n  \n  \/\/ Camera init\n  esp_err_t err = esp_camera_init(&amp;config);\n  if (err != ESP_OK) {\n    Serial.printf(&quot;Camera init failed with error 0x%x&quot;, err);\n    return;\n  }\n  \/\/ Wi-Fi connection\n  WiFi.begin(ssid, password);\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(500);\n    Serial.print(&quot;.&quot;);\n  }\n  Serial.println(&quot;&quot;);\n  Serial.println(&quot;WiFi connected&quot;);\n  \n  Serial.print(&quot;Camera Stream Ready! Go to: http:\/\/&quot;);\n  Serial.print(WiFi.localIP());\n\n  \/\/ Init OLED\n  Wire.begin(I2C_SDA, I2C_SCL);\n\n  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {\n    Serial.println(F(&quot;SSD1306 allocation failed&quot;));\n    for(;;);\n  }\n  display.clearDisplay();\n  display.setTextSize(1);\n  display.setTextColor(WHITE);\n  display.setCursor(5, 5);\n  display.print(WiFi.localIP());;\n  display.display();\n  \n  \/\/ Start streaming web server\n  startCameraServer();\n}\n\nvoid loop() {\n  delay(1);\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/TTGO-T-Journal-ESP32-Camera\/TTGO-T-Journal-ESP32-Camera-Video-Streaming-Web-Server.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"457\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?resize=750%2C457&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM Video Streaming Web Server Example\" class=\"wp-image-83414\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?resize=300%2C183&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>Learn more about this project: <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\">ESP32-CAM Video Streaming Web Server <\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Take Photo and Display in Web Server<\/h3>\n\n\n\n<p>The following code creates a web server that you can access to take and display photos. The web server IP address is displayed on the OLED.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/ttgo-t-journal-esp32-camera-getting-started\/\n  \n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files.\n  \n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n*\/\n\n#include &quot;WiFi.h&quot;\n#include &quot;esp_camera.h&quot;\n#include &quot;esp_timer.h&quot;\n#include &quot;img_converters.h&quot;\n#include &quot;Arduino.h&quot;\n#include &quot;soc\/soc.h&quot;           \/\/ Disable brownour problems\n#include &quot;soc\/rtc_cntl_reg.h&quot;  \/\/ Disable brownour problems\n#include &quot;driver\/rtc_io.h&quot;\n#include &lt;ESPAsyncWebServer.h&gt;\n#include &lt;SPIFFS.h&gt;\n#include &lt;FS.h&gt;\n\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_GFX.h&gt;\n#include &lt;Adafruit_SSD1306.h&gt;\n\n#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 32\n#define I2C_SDA 14\n#define I2C_SCL 13\n\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, -1);\n\n\/\/ Replace with your network credentials\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\n\n\/\/ Create AsyncWebServer object on port 80\nAsyncWebServer server(80);\n\nboolean takeNewPhoto = false;\n\n\/\/ Photo File Name to save in SPIFFS\n#define FILE_PHOTO &quot;\/photo.jpg&quot;\n\n\/\/ OV2640 camera module pins (CAMERA_MODEL_TTGO-T-Journal)\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM     27\n#define SIOD_GPIO_NUM     25\n#define SIOC_GPIO_NUM     23\n#define Y9_GPIO_NUM       19\n#define Y8_GPIO_NUM       36\n#define Y7_GPIO_NUM       18\n#define Y6_GPIO_NUM       39\n#define Y5_GPIO_NUM       5\n#define Y4_GPIO_NUM       34\n#define Y3_GPIO_NUM       35\n#define Y2_GPIO_NUM       17\n#define VSYNC_GPIO_NUM    22\n#define HREF_GPIO_NUM     26\n#define PCLK_GPIO_NUM     21\n\nconst char index_html[] PROGMEM = R&quot;rawliteral(\n&lt;!DOCTYPE HTML&gt;&lt;html&gt;\n&lt;head&gt;\n  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n  &lt;style&gt;\n    body { text-align:center; }\n    .vert { margin-bottom: 10%; }\n    .hori{ margin-bottom: 0%; }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;div id=&quot;container&quot;&gt;\n    &lt;h2&gt;ESP32-CAM Last Photo&lt;\/h2&gt;\n    &lt;p&gt;It might take more than 5 seconds to capture a photo.&lt;\/p&gt;\n    &lt;p&gt;\n      &lt;button onclick=&quot;rotatePhoto();&quot;&gt;ROTATE&lt;\/button&gt;\n      &lt;button onclick=&quot;capturePhoto()&quot;&gt;CAPTURE PHOTO&lt;\/button&gt;\n      &lt;button onclick=&quot;location.reload();&quot;&gt;REFRESH PAGE&lt;\/button&gt;\n    &lt;\/p&gt;\n  &lt;\/div&gt;\n  &lt;div&gt;&lt;img src=&quot;saved-photo&quot; id=&quot;photo&quot; width=&quot;70%&quot;&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;script&gt;\n  var deg = 0;\n  function capturePhoto() {\n    var xhr = new XMLHttpRequest();\n    xhr.open('GET', &quot;\/capture&quot;, true);\n    xhr.send();\n  }\n  function rotatePhoto() {\n    var img = document.getElementById(&quot;photo&quot;);\n    deg += 90;\n    if(isOdd(deg\/90)){ document.getElementById(&quot;container&quot;).className = &quot;vert&quot;; }\n    else{ document.getElementById(&quot;container&quot;).className = &quot;hori&quot;; }\n    img.style.transform = &quot;rotate(&quot; + deg + &quot;deg)&quot;;\n  }\n  function isOdd(n) { return Math.abs(n % 2) == 1; }\n&lt;\/script&gt;\n&lt;\/html&gt;)rawliteral&quot;;\n\nvoid setup() {\n  \/\/ Serial port for debugging purposes\n  Serial.begin(115200);\n\n  \/\/ Connect to Wi-Fi\n  WiFi.begin(ssid, password);\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(&quot;Connecting to WiFi...&quot;);\n  }\n  if (!SPIFFS.begin(true)) {\n    Serial.println(&quot;An Error has occurred while mounting SPIFFS&quot;);\n    ESP.restart();\n  }\n  else {\n    delay(500);\n    Serial.println(&quot;SPIFFS mounted successfully&quot;);\n  }\n\n  \/\/ Print ESP32 Local IP Address\n  Serial.print(&quot;IP Address: http:\/\/&quot;);\n  Serial.println(WiFi.localIP());\n\n  \/\/ Init OLED\n  Wire.begin(I2C_SDA, I2C_SCL);\n\n  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C, false, false)) {\n    Serial.println(F(&quot;SSD1306 allocation failed&quot;));\n    for(;;);\n  }\n  display.clearDisplay();\n  display.setTextSize(1);\n  display.setTextColor(WHITE);\n  display.setCursor(5, 5);\n  display.print(WiFi.localIP());;\n  display.display();\n\n\n  \/\/ Turn-off the 'brownout detector'\n  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);\n\n  \/\/ OV2640 camera module\n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sccb_sda = SIOD_GPIO_NUM;\n  config.pin_sccb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 20000000;\n  config.pixel_format = PIXFORMAT_JPEG;\n\n  if (psramFound()) {\n    config.frame_size = FRAMESIZE_UXGA;\n    config.jpeg_quality = 10;\n    config.fb_count = 2;\n  } else {\n    config.frame_size = FRAMESIZE_SVGA;\n    config.jpeg_quality = 12;\n    config.fb_count = 1;\n  }\n  \/\/ Camera init\n  esp_err_t err = esp_camera_init(&amp;config);\n  if (err != ESP_OK) {\n    Serial.printf(&quot;Camera init failed with error 0x%x&quot;, err);\n    ESP.restart();\n  }\n\n  \/\/ Route for root \/ web page\n  server.on(&quot;\/&quot;, HTTP_GET, [](AsyncWebServerRequest * request) {\n    request-&gt;send(200, &quot;text\/html&quot;, index_html);\n  });\n\n  server.on(&quot;\/capture&quot;, HTTP_GET, [](AsyncWebServerRequest * request) {\n    takeNewPhoto = true;\n    request-&gt;send(200, &quot;text\/plain&quot;, &quot;Taking Photo&quot;);\n  });\n\n  server.on(&quot;\/saved-photo&quot;, HTTP_GET, [](AsyncWebServerRequest * request) {\n    request-&gt;send(SPIFFS, FILE_PHOTO, &quot;image\/jpg&quot;, false);\n  });\n\n  \/\/ Start server\n  server.begin();\n\n}\n\nvoid loop() {\n  if (takeNewPhoto) {\n    capturePhotoSaveSpiffs();\n    takeNewPhoto = false;\n  }\n  delay(1);\n}\n\n\/\/ Check if photo capture was successful\nbool checkPhoto( fs::FS &amp;fs ) {\n  File f_pic = fs.open( FILE_PHOTO );\n  unsigned int pic_sz = f_pic.size();\n  return ( pic_sz &gt; 100 );\n}\n\n\/\/ Capture Photo and Save it to SPIFFS\nvoid capturePhotoSaveSpiffs( void ) {\n  camera_fb_t * fb = NULL; \/\/ pointer\n  bool ok = 0; \/\/ Boolean indicating if the picture has been taken correctly\n\n  do {\n    \/\/ Take a photo with the camera\n    Serial.println(&quot;Taking a photo...&quot;);\n\n    fb = esp_camera_fb_get();\n    if (!fb) {\n      Serial.println(&quot;Camera capture failed&quot;);\n      return;\n    }\n\n    \/\/ Photo file name\n    Serial.printf(&quot;Picture file name: %s\\n&quot;, FILE_PHOTO);\n    File file = SPIFFS.open(FILE_PHOTO, FILE_WRITE);\n\n    \/\/ Insert the data in the photo file\n    if (!file) {\n      Serial.println(&quot;Failed to open file in writing mode&quot;);\n    }\n    else {\n      file.write(fb-&gt;buf, fb-&gt;len); \/\/ payload (image), payload length\n      Serial.print(&quot;The picture has been saved in &quot;);\n      Serial.print(FILE_PHOTO);\n      Serial.print(&quot; - Size: &quot;);\n      Serial.print(file.size());\n      Serial.println(&quot; bytes&quot;);\n    }\n    \/\/ Close the file\n    file.close();\n    esp_camera_fb_return(fb);\n\n    \/\/ check if file has been correctly saved in SPIFFS\n    ok = checkPhoto(SPIFFS);\n  } while ( !ok );\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/TTGO-T-Journal-ESP32-Camera\/TTGO-T-Journal-ESP32-Camera-Take-Photo-Web-Server.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"650\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-CAM-Web-Server-Display-Last-Photo-Captured.jpg?resize=492%2C650&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM Take Photo and Display in Web Server\" class=\"wp-image-90439\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-CAM-Web-Server-Display-Last-Photo-Captured.jpg?w=492&amp;quality=100&amp;strip=all&amp;ssl=1 492w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/10\/ESP32-CAM-Web-Server-Display-Last-Photo-Captured.jpg?resize=227%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 227w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><\/figure><\/div>\n\n\n\n<p>Learn more about this project: <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-display-web-server\/\">ESP32-CAM Take Photo and Display in Web Server<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CameraWebServer Example<\/h3>\n\n\n\n<p>You can also run the default CameraWebServer example that comes with the Arduino IDE.  In your Arduino IDE, go to&nbsp;<strong>File&nbsp;<\/strong>&gt;&nbsp;<strong>Examples&nbsp;<\/strong>&gt;&nbsp;<strong>ESP32&nbsp;<\/strong>&gt;&nbsp;<strong>Camera&nbsp;<\/strong>and open the&nbsp;<strong>CameraWebServer<\/strong>&nbsp;example.<\/p>\n\n\n\n<p>You can click the next link to download the .zip with the final code:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/TTGO-T-Journal-ESP32-Camera\/CameraWebServer.zip\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><strong>Download our CameraWebServer Example for the TTGO T-Journal Board <\/strong><\/a><\/li><\/ul>\n\n\n\n<p>Otherwise, you need to add the TTGO T-Journal pinout to the <em>camera_pins.h<\/em> tab. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"569\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Add-T-Journal-Camera-pins.jpg?resize=590%2C569&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"CameraWebServer Example ESP32-CAM for Arduino IDE\" class=\"wp-image-92840\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Add-T-Journal-Camera-pins.jpg?w=590&amp;quality=100&amp;strip=all&amp;ssl=1 590w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Add-T-Journal-Camera-pins.jpg?resize=300%2C289&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/figure><\/div>\n\n\n\n<p>Copy the following to the camera_pins.h file.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#if defined(CAMERA_MODEL_T_JOURNAL)\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM     27\n#define SIOD_GPIO_NUM     25\n#define SIOC_GPIO_NUM     23\n\n#define Y9_GPIO_NUM       19\n#define Y8_GPIO_NUM       36\n#define Y7_GPIO_NUM       18\n#define Y6_GPIO_NUM       39\n#define Y5_GPIO_NUM       5\n#define Y4_GPIO_NUM       34\n#define Y3_GPIO_NUM       35\n#define Y2_GPIO_NUM       17\n#define VSYNC_GPIO_NUM    22\n#define HREF_GPIO_NUM     26\n#define PCLK_GPIO_NUM     21<\/code><\/pre>\n\n\n\n<p>Then, in the CameraWebServer tab, comment all the existing camera models, and add your camera, as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Select camera model\n#define CAMERA_MODEL_T_JOURNAL\n\/\/#define CAMERA_MODEL_WROVER_KIT\n\/\/#define CAMERA_MODEL_ESP_EYE\n\/\/#define CAMERA_MODEL_M5STACK_PSRAM\n\/\/#define CAMERA_MODEL_M5STACK_WIDE\n\/\/#define CAMERA_MODEL_AI_THINKER<\/code><\/pre>\n\n\n\n<p>Because this camera doesn&#8217;t have PSRAM, the face recognition and detection features of this project don&#8217;t work with this camera. All the other functionalities work well. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"407\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?resize=750%2C407&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"CameraWebServer Example ESP32-CAM for Arduino IDE Web Server\" class=\"wp-image-82436\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-video-streaming-example.jpg?resize=300%2C163&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Upload Code to the TTGO T-Journal ESP32 Camera<\/h2>\n\n\n\n<p>To upload code, you just need to connect the board to your computer, then in the Arduino IDE, go to <strong>Tools <\/strong>&gt; <strong>Port <\/strong>and select the COM port it is connected to.<\/p>\n\n\n\n<p>Then, you also need to select a Board model. The TTGO T-Journal is not available on the ESP32 models. So, select the following settings:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Board:<\/strong> &#8220;ESP32 Wrover Module&#8221;<\/li><li><strong>Partition Scheme:<\/strong> &#8220;Huge APP (3MB No OTA)&#8221;<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"369\" height=\"410\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/upload-code-esp32-cam.png?resize=369%2C410&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Board ESP32 Wrover Module and Partition Scheme Huge APP (3MB No OTA)\" class=\"wp-image-82434\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/upload-code-esp32-cam.png?w=369&amp;quality=100&amp;strip=all&amp;ssl=1 369w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/upload-code-esp32-cam.png?resize=270%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 270w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/><\/figure><\/div>\n\n\n\n<p>Then, simply click the Arduino IDE upload button and it is done!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"32\" height=\"32\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/upload-button-arduino-ide.png?resize=32%2C32&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino IDE Compile and upload sketch button\" class=\"wp-image-91745\"\/><\/figure><\/div>\n\n\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"94673\" class=\"elementor elementor-94673\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2689e44b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2689e44b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7490d123\" data-id=\"7490d123\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-35934f78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"35934f78\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-3de108d9\" data-id=\"3de108d9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5aca63ab elementor-widget elementor-widget-image\" data-id=\"5aca63ab\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"334\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?fit=334%2C334&amp;quality=100&amp;strip=all&amp;ssl=1\" class=\"attachment-full size-full wp-image-94555\" alt=\"\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?w=334&amp;quality=100&amp;strip=all&amp;ssl=1 334w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 334px) 100vw, 334px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-4bd084e0\" data-id=\"4bd084e0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-517cf0fa elementor-widget elementor-widget-heading\" data-id=\"517cf0fa\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">[eBook] Build ESP32-CAM Projects using Arduino IDE<\/a><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3438ea70 elementor-hidden-phone elementor-widget elementor-widget-text-editor\" data-id=\"3438ea70\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE\u00a0<strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-674524a5 elementor-hidden-desktop elementor-hidden-tablet elementor-widget elementor-widget-text-editor\" data-id=\"674524a5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE <strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>This tutorial was a quick getting started guide for the TTGO T-Journal ESP32 Camera Development board. You&#8217;ve learned how to control the OLED display and how to adapt existing ESP32 camera projects to your board.<\/p>\n\n\n\n<p>We hope you&#8217;ve found this tutorial useful. To learn more about this board, you can read our complete overview on Maker Advisor as well as our ESP32-CAM development boards comparison post:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/ttgo-t-journal-esp32-camera-board-review\/\" target=\"_blank\">TTGO T-Journal ESP32 Camera Board Review and Documentation (Pinout, Features, etc&#8230;)<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/esp32-camera-cam-boards-review-comparison\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"ESP32 Camera Dev Boards Review and Comparison (Best ESP32-CAM) (opens in a new tab)\">ESP32 Camera Dev Boards Review and Comparison (Best ESP32-CAM)<\/a><\/li><\/ul>\n\n\n\n<p>You may also be interested in other ESP32 development boards:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" aria-label=\"$7 ESP32-CAM with OV2640 Camera (Review)\u2028 (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-cam-ov2640-camera\/\" target=\"_blank\">$7 ESP32-CAM with OV2640 Camera (Review)<\/a><\/li><li><a rel=\"noreferrer noopener\" aria-label=\"ESP32 with Built-in SX1276 LoRa and SSD1306 OLED Display (Review)\u2028 (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-sx1276-lora-ssd1306-oled\/\" target=\"_blank\">ESP32 with Built-in SX1276 LoRa and SSD1306 OLED Display (Review)<\/a><\/li><li><a rel=\"noreferrer noopener\" aria-label=\"$11 TTGO T-Call ESP32 with SIM800L GSM\/GPRS (Overview) (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/ttgo-t-call-esp32-with-sim800l-gsm-gprs\/\" target=\"_blank\">$11 TTGO T-Call ESP32 with SIM800L GSM\/GPRS (Overview)<\/a><\/li><li><a rel=\"noreferrer noopener\" aria-label=\"10 IoT Development Boards You Need to Get (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/10-iot-development-boards\/\" target=\"_blank\">10 IoT Development Boards You Need to Get<\/a><\/li><li><a rel=\"noreferrer noopener\" aria-label=\"Best ESP32 Development Boards (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-development-boards-review-comparison\/\" target=\"_blank\">Best ESP32 Development Boards<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\"><strong>Build ESP32-CAM Projects (eBook)<\/strong><\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32-cam\/\"><strong>Read all our ESP32-CAM Projects, Tutorials and Guides<\/strong><\/a><\/li><\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a getting started guide for the TTGO T-Journal ESP32 Camera Development Board. The TTGO T-Journal features an OV2640 camera, an OLED display, several GPIOs to connect peripherals and &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"TTGO T-Journal ESP32 Camera: Built-in Programmer, OLED, Antenna and Project Examples\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/ttgo-t-journal-esp32-camera-getting-started\/#more-92734\" aria-label=\"Read more about TTGO T-Journal ESP32 Camera: Built-in Programmer, OLED, Antenna and Project Examples\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":92843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[281,276,277,319,264],"tags":[],"class_list":["post-92734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp32","category-esp32-arduino-ide","category-esp32-cam","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/ESP32-TTGO-T-Journal-Board-Project-Examples.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/92734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=92734"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/92734\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/92843"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=92734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=92734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=92734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}