# esp32-ssd1306-oled-example

> This project turns an ESP32 module with a 128×64 SSD1306 OLED display into a small wireless text terminal.

- Author: Mikrobot.pl
- Platform: ESP32
- Board: ESP32 Dev Module (`esp32:esp32:esp32`)
- SDK version: 3.3.6
- Tags: #esp32, #example, #oled, #ssd1306, #captive portal, #wifi
- Created: 2026-11-25
- Updated: 2026-11-25
- Favorites: 0, forks: 0
- Project page (view, flash from the browser, fork): https://flashesp.com/explore/qpsUTJ4lccY1e0nqVUmMF
- Download all sources (zip): https://flashesp.com/api/public-projects/qpsUTJ4lccY1e0nqVUmMF/download-sources/

## Source files

- [libraries_lock.json (243 B)](https://flashesp.com/explore/qpsUTJ4lccY1e0nqVUmMF/files/T0GXE71RgxmXhEL6cvCVP.md)
- [main.ino (5.4 KB)](https://flashesp.com/explore/qpsUTJ4lccY1e0nqVUmMF/files/LNT9ukY9pcHMv3NNy4FBE.md)
- readme.md (2.7 KB)

## README

# ESP32 OLED Text Portal  
### Wireless text sender for SSD1306 OLED with Captive Portal

![ESP32 OLED Text Portal](https://i.imgur.com/EMV8Irm.jpeg)
This project turns an **ESP32 (ESP-WROOM-32)** board with a **128×64 SSD1306 OLED display** into a small wireless text terminal.  
After powering the device, it creates a **WiFi Access Point** and opens a **captive portal** allowing users to enter any text that will then be displayed on the OLED screen.

Perfect for:
- message boards  
- IoT badges  
- simple wireless displays  
- interactive installations  

---

## ⭐ Features

- **Open WiFi Access Point** (no password required)  
  Network name: `ESP-OLED`
- **Captive portal**
  - Any website request redirects to the configuration page  
  - Works on Android, iOS, Windows, Linux
- **Web interface with live text preview**
- **OLED text rendering**
  - Automatic line wrapping  
  - Fixed footer with network name and IP address  
- **Default text after boot:** `mikrobot.pl`
- Fully self-contained, **no internet connection required**

---

## 📦 Hardware requirements

- **ESP32 ESP-WROOM-32** board (USB-C, CH340, 4 MB flash)  
- **SSD1306 128x64 OLED I2C** display (0.96", 3–5 V)  
- Wiring:

| OLED | ESP32   |
|------|---------|
| VCC  | 3V3     |
| GND  | GND     |
| SDA  | GPIO21  |
| SCL  | GPIO22  |

No external USB-to-serial adapter is needed, the board has a built-in CH340.

---

## 🔧 Software requirements

Install the following libraries via Arduino Library Manager (or select them on flashesp.com):

- `Adafruit SSD1306`
- `Adafruit GFX Library`
- `Adafruit BusIO` (dependency, usually installed automatically)

`WiFi`, `WebServer`, `DNSServer` and `Wire` come with the **ESP32 core**, make sure it is installed in Arduino IDE.  
Board to select: **ESP32 Dev Module**.

---

## 🚀 How it works

1. The ESP32 boots and initializes the SSD1306 display.
2. It starts a WiFi Access Point:
   - SSID: `ESP-OLED`
   - IP: `192.168.4.1`
3. A DNS server redirects every domain to the ESP32 (captive portal).
4. Connect your phone or laptop to `ESP-OLED`, the configuration page should open automatically.  
   If it does not, open `http://192.168.4.1` in a browser.
5. Type your text and press **Send to OLED**, the text appears on the display immediately.

The text is not saved, after a reboot the display shows `mikrobot.pl` again.

---

## 🛠 Troubleshooting

- **Display stays black:** check wiring and try changing `SCREEN_ADDRESS` from `0x3C` to `0x3D`.
- **Polish / special characters (ą, ś, ł…)** show as garbage on the OLED: the built-in Adafruit font does not support them. They display correctly on the web page.
- **Serial Monitor:** set to `115200` baud to see status messages.
