Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32 Wi-Fi Controlled Video Player with TFT Display and SD Card

View and Edit Project In Cirkit DesignerImage of ESP32 Wi-Fi Controlled Video Player with TFT Display and SD Card

Circuit Documentation

Summary

This circuit is designed to play video files from an SD card using an ESP32 microcontroller and display the video on a TFT LCD display. The ESP32 connects to a WiFi network, initializes the TFT display, and reads video files from the SD card. The main components in this circuit are the ESP32 microcontroller, a TFT LCD display (ST7735S), and a Micro SD Card Module.

Component List

ESP32 (30 pin)

TFT LCD Display ST7735S

Micro SD Card Module

Wiring Details

ESP32 (30 pin)

TFT LCD Display ST7735S

Micro SD Card Module

Code Documentation

/*
 * ESP32 SD Card Video Player
 * This code initializes the ESP32, sets up the TFT display,
 * connects to a WiFi network, and plays video files from an SD card.
 */

#include <TFT_eSPI.h> // Include the TFT library
#include <WiFi.h> // Include the WiFi library
#include <SD.h> // Include the SD card library
#include <SPI.h> // Include the SPI library

const char* ssid = "your_SSID"; // Replace with your SSID
const char* password = "your_PASSWORD"; // Replace with your password

TFT_eSPI tft = TFT_eSPI(); // Create TFT object

void setup() {
  // Initialize serial communication
  Serial.begin(115200);
  // Initialize the TFT display
  tft.init();
  tft.setRotation(1); // Set display orientation
  tft.fillScreen(TFT_BLACK); // Clear the screen
  tft.setTextColor(TFT_WHITE); // Set text color
  tft.setTextSize(2); // Set text size
  tft.setCursor(0, 0); // Set cursor position
  tft.println("Initializing..."); // Display message
  // Connect to WiFi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");
  // Initialize SD card
  if (!SD.begin()) {
    Serial.println("Card Mount Failed");
    return;
  }
  uint8_t cardType = SD.cardType();
  if (cardType == CARD_NONE) {
    Serial.println("No SD card attached");
    return;
  }
  Serial.println("SD card initialized");
}

void loop() {
  // Main loop code
  // Add your video playback logic here
  // Example: Displaying a simple message
  tft.fillScreen(TFT_BLACK); // Clear the screen
  tft.setCursor(0, 0); // Reset cursor position
  tft.println("Playing video..."); // Display message
  delay(5000); // Wait for 5 seconds before refreshing
}

This code initializes the ESP32, sets up the TFT display, connects to a WiFi network, and initializes the SD card. The main loop is currently set to display a simple message, but you can add your video playback logic in the loop.