Skip to main content

Project 4: Sensor Data on Screen

Overview:

Project 4 aims to create an integrated system using ESP32 microcontroller along with the MPU6050 sensor and an ST7725 TFT display. This project focuses on capturing real-time data and displaying it on a TFT display.

Material:

ComponentImage
10 DOF IMU Sensor
1.8" TFT LCD Screen
ESP32 Dev Board

Objectives:

  • Sensor Data Acquisition: Utilize the MPU6050 to gather real-time accelerometer, gyroscope, and temperature data.
  • Data Visualisation: Implement a graphical interface on the ST7735 TFT display to show sensor data.

Hardware Assembly:

Pin Connection:

LCD PinDescriptionTo ESP32 Pin
GNDGround (0V)GND
VCC_INPower5V
SDASerial DataP21
SCLSerial ClockP22

Pseudocode:

	Include necessary libraries for MPU6050 and TFT display
Define TFT display pins
Initialize MPU6050 sensor object
Initialize TFT display object with specified pins

Function setup:
Initialize TFT display with black background, white text color, size 1 text
Initialize serial communication at 115200 baud rate
Start MPU6050 sensor
Configure MPU6050 settings for accelerometer, gyro, and bandwidth
Wait for 100 milliseconds

Function loop:
Clear the TFT display and reset cursor to top-left
Declare sensor event variables for acceleration, gyro, and temperature
Retrieve sensor data from MPU6050

Display "Acceleration" label and values for X, Y, Z on TFT display
Display a separator line
Display "Rotation" label and values for X, Y, Z on TFT display
Display a separator line
Display "Temperature" label and value on TFT display
Display a separator line
Wait for 100 milliseconds

What you should see: