Professional Documents
Culture Documents
TFT Animated Eyes
TFT Animated Eyes
by Bodmer
This project uses low cost parts to create a pair of animated eyes on TFT screens. The project is based on the
Adafruit "Uncanny Eyes" project.
The two ST7735 128x128 pixel displays and the ESP32 board can typically bought online for around $10 total.
The software running on the ESP32 is an Arduino sketch, this is supported by the TFT_eSPI graphics library. The
sketch is an example provided within the TFT_eSPI library.
Other processors can also be used such as ESP8266 and STM32 boards. The ESP32 and STM32 processors can use
"Direct Memory Access" to transfer the images to the screen, this improves performance (aka frame rate). The
sketch uses a signi cant amount of RAM and FLASH program memory so bear this in mind when choosing a
processor.
Supplies:
Two ST7735 1.4" 128x128 TFT displays with 4 wire SPI interface
One ESP32 processor board
Breadboard and wires
Arduino IDE
TFT_eSPI library version 2.3.4 or later
Step 1: Performance
The Arduino IDE is used to compile and upload the sketch to the ESP32. This is a relatively advanced project, so it is
suggested that you get the Arduino IDE up and running with the simpler examples to become familiar with the
environment.
The ESP32 board package must be loaded into the IDE if you are using that processor. For STM32 boards use the
o cial stm32duino package.
The TFT_eSPI graphics library can be loaded via the Arduino IDE's library manager.
If you are already a TFT_eSPI library user and have a 240x320 (or larger) display operating correctly then the
Animated_Eyes_1 will run without modi cation and display two animated eyes on a single screen.
The prototype was built by plugging the ESP32 and The TFT_eSPI library uses "user_setup" les to de ne
displays into breadboards and using jumper wires. all the parameters for the display, processor and
This is convenient for initial experimentation but is interfaces, for the Animated_Eyes_2 sketch the
prone to poor connection especially if moved about. It "Setup47_ST7735.h" le was used with the wiring as
the eyes are to be used as part of a costume then shown above.
soldering all connections is recommended.
The displays used for testing were 128x128 ST7735
Normally the TFT chip select line for a single display is displays, the TFT_eSPI library setup le may need to
de ned within a user_setup le of the TFT_eSPI be changed as these displays come in many
library, however when using the library with two con guration variants.
displays the chip selects must be controlled by the
sketch, thus you must NOT de ne the TFT_CS pin in When it is all programmed and running the it can be
the TFT_eSPI library setup les. Instead, the chip unplugged from a computer and powered from a
selects (CS) must be de ned in the "con g.h" tab of phone charger battery pack that has a USB output.
the Animated_Eyes_2 sketch.