Difference between revisions of "ESP32-S2 Parallel TFT with Touch(3.5'')"

From MakerFabsWiki
Jump to: navigation, search
(Draw on LCD)
Line 80: Line 80:
 
[[File:ESP32-S2_Parallel_TFT_with_Touch_A014.jpg]]<br>
 
[[File:ESP32-S2_Parallel_TFT_with_Touch_A014.jpg]]<br>
  
===Display the picture===
+
===Touch the screen===
  
1. You can get the code from here:'''[https://github.com/Makerfabs/Project_Touch-Screen-Camera Core]'''<br>
+
1. You can get the code from here:'''[https://github.com/Makerfabs/Makerfabs-ESP32-S2-Parallel-TFT-with-Touch/tree/main/example/simple_test/touch16_3.5]'''<br>
 
2. Copy the picture you want to show to the SD card. Insert the SD card into the board.<br>
 
2. Copy the picture you want to show to the SD card. Insert the SD card into the board.<br>
3. Open the file “\Project_Touch-Screen-Camera-master\SD2TFT\SD2TFT.ino”. The name of the showed picture must be filled in the string array, such as the below code.<br>
+
3. Open the file “\/simple_test/touch16_3.5” with Arduino IDE.<br>
<pre>String img_file[5] =
+
If you purchase a capacitive screen, make sure the code as below.<br>
    {
 
        "/1.bmp",               
 
        "/2.bmp",
 
        "/3.bmp",
 
        "/4.bmp",
 
        "/5.bmp"};</pre>
 
4. Verify and upload the code, you will get a digital photo frame.<br>
 
[[File:ESP32-S2_Parallel_TFT_with_Touch_A014.GIF]]<br>
 
 
 
===Camera===
 
 
 
1. You can get the code from here: '''[https://github.com/Makerfabs/Project_Touch-Screen-Camera Core]'''<br>
 
2. Open the file “\Project_Touch-Screen-Camera-master\Camera_v2\Camera_v2.ino”. Choose the screen type and modify the code.<be>
 
 
<pre>
 
<pre>
 
//#define NS2009_TOUCH  //Resistive screen driver
 
//#define NS2009_TOUCH  //Resistive screen driver
 
#define FT6236_TOUCH //Capacitive screen driver
 
#define FT6236_TOUCH //Capacitive screen driver
 
#ifdef NS2009_TOUCH
 
#include "NS2009.h"
 
const int i2c_touch_addr = NS2009_ADDR;
 
#define get_pos ns2009_pos
 
#endif
 
 
#ifdef FT6236_TOUCH
 
#include "FT6236.h"
 
const int i2c_touch_addr = TOUCH_I2C_ADD;
 
#define get_pos ft6236_pos
 
#endif
 
 
</pre>
 
</pre>
3. Verify and upload the code, you will get a camera.<br>
+
If you purchase a resistive screen, make sure the code as below.<br>
[[File:ESP32-S2_Parallel_TFT_with_Touch_A015.jpg|500px]]<br>
+
<pre>
 
+
#define NS2009_TOUCH  //Resistive screen driver
== Indoor Environment Expansion board ==
+
//#define FT6236_TOUCH //Capacitive screen driver
 
+
</pre>
This is an expansion board for measuring CO2, TVOC, Temperature, and Humidity. The board is design for ESP32 TFT LCD with Camera(3.5')(also for 3.2' one). For using, plug the board into the ESP32 TFT LCD board directly, program the ESP32. The ESP32 TFT LCD will turn to a meter for monitoring the environment.<br>
+
4. Verify and upload the code, you can touch the screen.<br>
'''Model: [https://www.makerfabs.com/esp32-touch-indoor-environment-expansion.html Indoor Environment Expansion]'''<br>
+
[[File:ESP32-S2_Parallel_TFT_with_Touch_A014.GIF]]<br>
[[File:ESP32-S2_Parallel_TFT_with_Touch_A016.jpg|500px]]<br>
 
 
 
=== Features ===
 
*SGP30 Air Quality Sensor, measuring TVOC and CO2.
 
*DHT11 temperature and humidity sensor.
 
*Active buzzer.
 
===Hardware===
 
 
 
*[https://www.makerfabs.com/wiki/images/d/d6/3.5_Environment_Expansion_Schematic.pdf Schematic]<br>
 
 
 
=== Using ===
 
*Plug the expansion board into the ESP32 TFT LCD board.
 
*Loading the program obtained from [https://github.com/Makerfabs/Project_Touch-Screen-Camera/tree/master/Environment%20Expansion%20Board GitHub].
 
*Reset the ESP32, and wait a minute.
 
*The LCD will display the measure of CO2, Temperature, Humidity.
 
*When the CO2 level is high over 1000, the buzzer on board rings.
 
[[File:ESP32-S2_Parallel_TFT_with_Touch_A017.jpg|500px]]<br>
 
 
 
===Display CO2 historical level===
 
*Plug the expansion board into the ESP32 TFT LCD board.
 
*Loading the [https://github.com/Makerfabs/Project_Touch-Screen-Camera/tree/master/example/p-line-chart program].
 
*Reset the ESP32 board, the ESP32 will start to record the CO2 level and TVOC level, and draw the historical values to line.
 
[[File:ESP32-S2_Parallel_TFT_with_Touch_A018.jpg|500px]]<br>
 
  
 
== FAQ  ==
 
== FAQ  ==

Revision as of 07:39, 22 November 2021

Introduction

The 3.5" 320x480 TFT LCD driver is ILI9488, it uses 16bits parallel line for communication with ESP32-S2, the main clock could be up to 20MHz, make the display smooth enough for videos; You can freely use some of Mabee pins(A I2c and a IOs) with the breakout connectors, to connect the ESP32-S2 display with sensors/ actuators, suitable for IoT applications.

Model: Resistive: ESPTFT35RE

ESP32-S2 Parallel TFT with Touch A001.jpg

Features

  • Integrated ESP32-S2 with 2.4G WiFi
  • Wi-Fi Protocols: 802.11b/g/n(802.11n up to 150Mbps),A-MPDU and A-MSDU aggregation and 0.4us guard interval support
  • Wi-Fi Frequency range: 2.402GHz - 2.483Ghz
  • Arduino Compatible: You can play it with Arduino IDE
  • LCD 3.5 inch Amorphous-TFT-LCD (Thin Film Transistor Liquid Crystal Display) for mobile-phone or handy electrical equipment
  • LCD Driver: ILI9488(16bits parallel line)
  • LCD Resolution: 320*480
  • FT6236 Series ICs are single-chip capacitive touch panel controller IC with a built-in 16 bit enhanced Micro-controller unit (MCU)
  • NS2009: A 4-wire resistive touch screen control circuit with I2C interface, which contains A 12-bit resolution A/D converter
  • Power supply: 5V, Type-C USB
  • Micro SD card slot on the board
  • Dual USB Type-C: one for native USB and one for USB-to-UART
  • Two Mabee interfaces
  • Board size: 66mm * 85mm


Diagram

ESP32-S2 Parallel TFT with Touch A002.JPG
Pin Assignment
500px
Dimension
500px
Note:unit is mm.

Usage

Warning: Don't operate when in power supply on
Github:Project_Touch_Screen_Camera

Software setup

NOTE: In order for the project to work normally, please install the same version.
1.Install the Arduino IDE V1.8.10.
2.Install the ESP32-S2 boards supporting V2.0.1

ESP32-S2 Parallel TFT with Touch A005.jpg

  • Click “Tools>Board>Boards Manager” to search for and install the ESP32 library:
     

ESP32-S2 Parallel TFT with Touch A006.jpg
3.Install LovyanGFX library V0.4.7

Click “Tools> Manager Libraries” to search for and install LovyanGFX library.

ESP32-S2 Parallel TFT with Touch A009.jpg
5.Select and setting the parameter in the Tools menu, as the picture:
ESP32-S2 Parallel TFT with Touch A010.jpg
Note: Different PC has different Serial COM number.

Graph on LCD

1. You can get the sourve code from github: [1]
2. Open the file Graph16_3.5. Select the screen type used and comment out the ones that are not used.

#define LGFX_USE_V1

#include <LovyanGFX.hpp>
#include <vector>

#define LCD_CS 37
#define LCD_BLK 45

#define LINE_COUNT 6

//Choice your touch IC
#define NS2009_TOUCH    //Resistive screen driver
//#define FT6236_TOUCH  //Capacitive screen driver

500px
3. Verify it and upload.
ESP32-S2 Parallel TFT with Touch A012.jpg
If failed to upload the code as the picture, please upload again and try to press the Flash switch when the code is uploading.
700px
4. After done uploading, reset the ESP32-S2 and you will get a graph on the screen.
ESP32-S2 Parallel TFT with Touch A014.jpg

Touch the screen

1. You can get the code from here:[2]
2. Copy the picture you want to show to the SD card. Insert the SD card into the board.
3. Open the file “\/simple_test/touch16_3.5” with Arduino IDE.
If you purchase a capacitive screen, make sure the code as below.

//#define NS2009_TOUCH  //Resistive screen driver
#define FT6236_TOUCH //Capacitive screen driver

If you purchase a resistive screen, make sure the code as below.

#define NS2009_TOUCH  //Resistive screen driver
//#define FT6236_TOUCH //Capacitive screen driver

4. Verify and upload the code, you can touch the screen.
File:ESP32-S2 Parallel TFT with Touch A014.GIF

FAQ

You can list your question here or contact support@makerfabs.com for technology support. Detailed descriptions of your question will be helped to solve your question.

  • Q: Why the display fails to respond sometimes I touch.
A: The touching interface is loose, please reconnect it.

Resources