Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-Powered OLED Display Interface

Image of ESP32-Powered OLED Display Interface

Circuit Documentation

Summary of the Circuit

This circuit consists of an ESP32 microcontroller and a 0.96" OLED display. The ESP32 is a versatile microcontroller with Wi-Fi and Bluetooth capabilities, and it is used here to control the OLED display. The OLED display is likely used to show data or status information from the ESP32. The ESP32 communicates with the OLED display via the I2C protocol, using its dedicated SDA and SCK pins.

Component List

ESP32 (30 pin)

  • Description: A 30-pin ESP32 microcontroller module with Wi-Fi and Bluetooth capabilities.
  • Purpose: Acts as the central processing unit of the circuit, controlling the OLED display and handling communication protocols.
  • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3.

0.96" OLED

  • Description: A small 0.96-inch OLED display module for visual output.
  • Purpose: To display information or data provided by the ESP32.
  • Pins: GND, VDD, SCK, SDA.

Wiring Details

ESP32 (30 pin)

  • D22 connected to OLED SCK
  • D21 connected to OLED SDA
  • GND connected to OLED GND
  • 3V3 connected to OLED VDD

0.96" OLED

  • SCK connected to ESP32 D22
  • SDA connected to ESP32 D21
  • GND connected to ESP32 GND
  • VDD connected to ESP32 3V3

Documented Code

Code for the ESP32 Microcontroller

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// Define the screen dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

// Create an instance of the display
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
  // Initialize the display
  display.begin(SSD1306_I2C_ADDRESS, OLED_RESET);
  display.clearDisplay();

  // Set text size and color
  display.setTextSize(1); // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE); // White text

  // Set cursor position
  display.setCursor(0, 0);
  display.println("Hello, ESP32!");
  display.display(); // Show on screen
}

void loop() {
  // You can add code here to update the display if needed
}

File Name: sketch.ino

Note: The code initializes the OLED display and prints "Hello, ESP32!" on the screen. The setup() function is called once when the ESP32 starts, and the loop() function runs continuously, allowing for further updates to the display if needed.