A project to display and rotate 3D objects on a TFT screen using data from the MPU6050 gyroscope and accelerometer.
MPU6050_TFT_3D is an interactive 3D visualization project. It uses the MPU6050 module to detect motion and displays a rotating 3D cube on an Adafruit TFT display. This is a great learning tool for working with accelerometers, gyroscopes, and graphical displays with Arduino or PlatformIO.
- Real-time 3D cube rendering on a TFT screen.
- Dynamic rotation based on MPU6050 sensor data.
- Displays real-time acceleration, gyroscope, and temperature readings.
- Optimized drawing to reduce flickering.
- Microcontroller: Arduino, ESP32, or compatible board.
- Display: Adafruit ST7735 or compatible TFT screen.
- MPU6050: Gyroscope and accelerometer module.
git clone https://github.com/your-username/MPU6050_TFT_3D.git
Open the downloaded folder in PlatformIO (recommended) or Arduino IDE.
Follow the pin connections below to set up the hardware:
- MPU6050 to Microcontroller:
- VCC → 5V (Arduino Nano)
- GND → GND (Arduino Nano)
- SCL → A5 (Arduino Nano)
- SDA → A4 (Arduino Nano)
- TFT Display to Microcontroller:
- VCC (ST7735S) → 5V (Arduino Nano)
- GND (ST7735S) → GND (Arduino Nano)
- CS (ST7735S) → D10 (Arduino Nano)
- RST (ST7735S) → D8 (Arduino Nano)
- A0(DC) (ST7735S) → D9 (Arduino Nano)
- SDA (ST7735S) → D11 (Arduino Nano)
- SCK (ST7735S) → D13 (Arduino Nano)
- LED (ST7735S) → 3V (Arduino Nano)
Ensure the following libraries are installed in your PlatformIO or Arduino IDE:
- Adafruit GFX Library
- Adafruit ST7735 and ST7789 Library
- Adafruit MPU6050 Library
- Adafruit Sensor Library
Compile and upload the code to your microcontroller using PlatformIO or Arduino IDE.
Once uploaded, the TFT screen will display a rotating 3D cube, along with real-time sensor data such as acceleration, gyroscope readings, and temperature.
- src/: Contains the main source code.
- platformio.ini: PlatformIO project configuration file.