Category :other tutorials


4 Inches TFT Touch Screen for Arduino Mega2560

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

1 Product Picture
2 Product Description
3 Product Parameters
4 Interface Definition
5 Connect to Arduino
6 How to use on Arduino
7 Program Download

Product Picture

Product Description

    • Support Arduino Mega2560 direct plug-in use
    • 3.95-inch color screen, support 16BIT RGB 65K color display, display rich colors
    • 320×480 resolution for clear display
    • Supports 8-bit and 16-bit parallel bus transmission with fast transfer speed
    • On-board 5V/3.3V level shifting IC, compatible with 5V/3.3V operating voltage
    • Support touch function
    • Provides an Arduino library with a rich sample program
    • Available on C51 and STM32 platforms with a rich sample program
    • Easy to expand the experiment with SD card slot
    • Military-grade process standards, long-term stable work
    • Provide underlying driver technical support

Product Parameters

Name Parameter
Display Color RGB 65K color
Screen Size 3.95(inch)
Type TFT
Driver IC ST7796S
Resolution 480*320 (Pixel)
Module Interface 8Bit or 16Bit parallel interface
Active Area 83.52×55.68(mm)
Module PCB Size 61.54×105.69 (mm)
back light 6 chip HighLight white LEDs
Operating Temperature -20℃~60℃
Storage Temperature -30℃~70℃
Operating Voltage 5V/3.3V
Power Consumption TBD
Product Weight(Package containing) 68 (g)

Interface Definition

The blue box in the above figure is the 8-bit/16-bit data bus mode switch, which is described as follows:

Solder R5 with 0Ω resistor or short circuit directly, and disconnect R4: select 16-bit data bus mode (default), use DB0~DB15 data pin
Solder R4 with 0Ω resistor or short circuit directly, and disconnect R5: select 8-bit data bus mode, use DB0~DB7 data pin
Number Module Pin Pin Description Number Module Pin Pin Description
1 5V Positive power supply 2 5V Positive power supply
3 DB8 8th bit of data bus(No need to use when using 8-bit mode) 4 DB9 9th bit of data bus(No need to use when using 8-bit mode)
5 DB10 10th bit of data bus(No need to use when using 8-bit mode) 6 DB11 11th bit of data bus(No need to use when using 8-bit mode)
7 DB12 12th bit of data bus(No need to use when using 8-bit mode) 8 DB13 13th bit of data bus(No need to use when using 8-bit mode)
9 DB14 14th bit of data bus(No need to use when using 8-bit mode) 10 DB15 15th bit of data bus(No need to use when using 8-bit mode)
11 DB7 7th bit of data bus 12 DB6 6th bit of data bus
13 DB5 5th bit of data bus 14 DB4 4th bit of data bus
15 DB3 third bit of data bus 16 DB2 2nd bit of data bus
17 DB1 1st bit of data bus 18 DB0 0 bit of data bus
19 LCD_RS LCD register / data selection signalLow level: register, high level: command 20 LCD_WR LCD write control signal
21 LCD_CS LCD screen select control signal, low level enable 22 LCD_RST LCD reset control signal, low reset
23 NC Undefined, reserved 24 LCD_RD LCD read control signal
25 TP_IRQ Touch screen interrupt control signal, low level when touch is detected 26 NC Undefined, reserved
27 NC Undefined, reserved 28 NC Undefined, reserved
29 SD_CS SD card select control signal, low level enable 30 NC Undefined, reserved
31 MISO SPI bus input signal 32 MOSI Touch screen chip select control signal, low level enable
33 EX_CLK SPI bus clock signal 34 TP_CS SD card select control signal, low level enable
35 GND Power ground 36 GND Power ground


Connect to Arduino Mega2560

How to use on Arduino

  • Step 1: Download the test program
  1. Download the Arduino test program:
  2. For a description of the relevant test procedures, please refer to the test program documentation in the package
  • Step 2: Connect the Arduino development board
  1. Plug the module directly into the Arduino development board
  2. After the module is plugged in, power on the Arduino board
  • Step 3: Copy the dependent library
  1. Make sure the Arduino IDE is installed on your computer (if it is not installed: Arduino IDE download URL)
  2. After installing the Arduino IDE, you need to copy the dependent library to the Arduino project directory as follows:
(1) Decompress the downloaded test package
(2) Copy the dependent libraries in the Install libraries directory in the package (shown below) to the libraries folder of the Arduino project directory (the default Arduino project directory is C:\Users\Administrator\ Documents\Arduino\libraries).
  • Step 4: Compile and download the program to the development board
  1. Open the sample in the Example directory of the package to test, compile and download( Don’t know how to compile and download?
  • Step 5: Observe the running of the program
      1. After the program is downloaded, run it directly and observe the running status. If it can be displayed normally, the program runs successfully, as shown in the following figure (take the colligate_test test program as an example):
      2. This set of test procedures contains the following test items:
        1. Example_01_Simple_test is a simple swipe test that does not depend on the library, can be used to detect the LCD hardware;

        B.Example_02_clear_screen is a simple solid color brush test;

        1. Example_03_colligate_test is a comprehensive test, including graphics, lines, text display;
        2. Example_04_display_graph is a graphical display test, including graphics drawing and filling test;
        3. Example_05_display_scroll for character and graphic scroll display test;
        4. Example_06_display_string is a character display test;
        5. Example_07_show_bmp_picture is a picture display test, read the bmp picture in the SD card and display it;
        6. ExampIe_08_switch_test is the switch display and touch test;
        7. ExampIe_09_dispIay_phonecaII is a telephone dialing interface display and touch test;
        8. ExampIe_10_touch_pen is a touch pen test;
        9. SDCard Exten Example for Arduino platform SD card function test, including writing and reading;


How to use phone app to control robot smart car with ESP8266 wifi module and expansion board

This tutorial is to teach you how to use the ESP8266 wifi module and expansion board to make the robot smart car walk.
Read More


IntoRobot Nut Mode

Nut 有3个LED灯用来指示其工作状态

  • 用户灯:它连接到D6管脚,低电平亮,方便调试程序
  • 状态灯:这个是一个RGB的三色LED灯,可以指示 Nut 的工作状态
  • 串口指示灯:ESP8266串口1通讯状态指示灯
状态灯颜色 Nut状态
浅蓝色 启动
红色闪烁 配置模式
黄色闪烁 更新固件
绿色闪烁 尝试连接网络
蓝色闪烁 尝试连接云平台
白色闪烁 已连接云平台


Nut 有2个按键

  • 复位键:将 Nut 复位
  • MODE键:模式切换键,切换 Nut 工作模式

Nut 工作模式分为 BootLoader 模式和应用模式,MODE键在不同工作模式下操作会进入不同的工作状态。Nut 上电后工作在应用模式下。


给Nut上电或者复位后,Nut 状态灯为浅蓝色,此时按下 MODE 键后 Nut 会进入到BootLoader模式下,继续长按 MODE 键直至状态灯出现以下颜色后释放,会进入对应的工作状态。

MODE键按下时间 状态灯颜色 Nut工作状态
0-3秒 无变化 无变化
3-7秒 红色 保留
7-10秒 绿色 恢复默认固件
10-13秒 蓝色 保留
13-20秒 浅蓝色 恢复出厂设置
20-30秒 熄灭 回到按键之前的状态
>=30秒 黄色 清除参数


上电后 Nut 会进入应用模式,长按 MODE 键一定的时间直至状态灯变为相对应的颜色后释放,Nut 就会进入相应的工作状态,其关系如下所示:

MODE键按下时间 状态灯颜色 Nut工作状态
0-3秒 无变化 无变化
3-7秒 红色 进入或者退出配置模式
7-10秒 绿色 恢复默认固件
10-13秒 蓝色 保留
13-20秒 浅蓝色 恢复出厂设置
20-30秒 熄灭 回到按键之前的状态
>=30秒 黄色 清除参数
  • 配置模式:可通过APP或者WEB端配置 Nut 连入云平台
  • 默认固件:Nut 有一个默认灯控制应用程序,恢复后可在APP或者WEB进行控制
  • 出厂设置:不清除参数,重新烧写ESP8266程序
  • 完全初始化:清除 Nut 保存的所有参数并重新烧录程序,重新启动后直接进入配置模式

How to register IntoRobot account and use IntoRobot App

1) Benefit to register IntoRobot
IntoRobot Cloud server has many convenient services and resources to help DIY geeks to develop their IOT project. It allows register user to program code online with an Arduino-like GUI IDE, burn your code into MCU boards remotely and use free Mobile APP to control your board.

In order to take advantage of IntoRobot Cloud resources and services, you need to register a FREE account

2) Register IntoRobot account

In your browser, go to . If you don’t know Chinese , switch the language dropdown menu (in the bottom of home page) to English.

In the top-right corner, click Login ,then click Sign up now, you can easily register a new account. You will receive an activation link in your registration confirmation email or txt message. Simply click that link and your registration will become activated.

After registration, you can login to your intoRobot control panel as following:

3)IntoRobot Mobile APP

IntoRobot cloud support iOS and Android APP which can control your MCU board from your cell phone. Right now only Chinese version APP is available, English version will be released very soon.

In your IntoRobot online control panel, click Documents ->其他资料下载’ , click Android or iOS link to download the APP(you may need to allow to support third party APP in your cell phone setting). Run the APP and login with your IntoRobot account .