Back to Explorer

esp32-sh1106-example

Project Information

Author

Mikrobot.pl

Board

ESP32 Dev Module

SDK Version

3.3.2

Platform

ESP32

Created

Updated

Description

SH1106 OLED Text Portal with captive portal on ESP32 Dev Board

Flash to Device

Login required: You need to login or create an account to flash this project.

Sorry, your browser doesn't support Web Serial.Web Serial requires HTTPS.

README

ESP32 SH1106 OLED Text Portal

Wireless text sender with captive portal on ESP32 Dev Board

This project turns an ESP32 Dev Board plus a 128×64 SH1106 I2C OLED display into a small wireless text terminal.

After power-up, the ESP32:

  • creates an open WiFi Access Point,
  • runs a captive portal (browser login page),
  • shows a web form where you can enter any text,
  • displays that text on the SH1106 OLED.

Default text on boot: mikrobot.pl


⭐ Features

  • Open WiFi Access Point (no password)
    • SSID: ESP32-OLED
    • IP address: 192.168.4.1
  • Captive portal
    • Any domain (e.g. google.com) is redirected to the ESP32
    • Common OS captive checks handled:
      • Android /generate_204
      • iOS/macOS /hotspot-detect.html
      • Windows /ncsi.txt
  • Web interface
    • Shows current text on the display
    • Simple form to send new text to the OLED
  • OLED rendering
    • Automatic word-wrap
    • Clear 128×64 monochrome display

📦 Hardware requirements

  • ESP32 Dev Board (e.g. ESP32-DevKitC)
  • 128×64 SH1106 I2C OLED display module

🔌 SH1106 → ESP32 wiring

On your SH1106 I2C module the clock pin is labeled SCK instead of SCL.
That is normal – it is still the I²C clock line.

Typical pins on the SH1106 module:

  • VCC
  • GND
  • SCK (I²C clock, sometimes labeled SCL or CLK)
  • SDA (I²C data)

Connect them to the ESP32 as follows:

SH1106 Pin ESP32 Pin Description
VCC 3V3 3.3 V Power
GND GND Ground
SCK GPIO22 I²C Clock (SCK on your module)
SDA GPIO21 I²C Data (SDA)

In the code, I²C is initialized as:

Wire.begin(21, 22); // SDA, SCK (clock)