Free wiring guides
Wire the SSD1306 OLED 0.96 in screen to the ESP32-S3
OLED screen, 0.96 in, SSD1306, 128×64, I2C. A small sharp screen for numbers and short text.
When buying: The 4-pin I2C version. Some makers swap VCC and GND: read the print before wiring.
Which pin goes where
| On the part | On the ESP32-S3 |
|---|---|
| GND | GND |
| VCC | 3V3 |
| SCL | GPIO 9 |
| SDA | GPIO 8 |
Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.
In 3D
Example sketch
// OLED screen, 0.96 in, SSD1306, 128×64, I2C
// on the ESP32-S3-DevKitC-1 (N8R2 or N16R8)
// https://stem.manusignal.com/en/parts/ssd1306-oled-0-96-inch-esp32-s3
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const int PIN_SDA = 8;
const int PIN_SCL = 9;
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
void setup() {
Wire.begin(PIN_SDA, PIN_SCL);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.clearDisplay();
oled.setTextColor(SSD1306_WHITE);
oled.setTextSize(2);
oled.setCursor(0, 24);
oled.print("It works");
oled.display();
}
void loop() {
delay(1000);
}
- Tools > Board > ESP32S3 Dev Module, then Tools > Port and choose the board's port.
- Adafruit GFX Library: install it from Sketch > Include Library > Manage Libraries.
- Adafruit SSD1306: install it from Sketch > Include Library > Manage Libraries.
This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.
What you should see
The screen shows “It works”.
If it does not work
- The OLED shows nothing.
- SDA and SCL are probably swapped. If they are right, your module may use address 0x3D: change 0x3C in the sketch.
Build something with it
These Build Packs use this part on this board, with the same pins.
- Ultrasonic tape measurePoint it at a wall and read the distance in centimetres, without touching anything.
- Air quality monitorShows how stuffy a room is. The light is green when the air is fresh, yellow when it is time to open a window, and red when it is stale.
- Interval timerWork, rest, repeat. Turn the knob to set the work minutes and press it to start; it beeps when each part ends.
- LoRa receiverListens for LoRa radio messages and shows each one with its signal strength. LoRa carries small messages over hundreds of metres with no Wi-Fi and no SIM.
- Weather stationTemperature, humidity and air pressure on a small screen, with a note of whether the pressure is rising or falling.
More parts on the ESP32-S3
- ST7789 1.54 in TFT screenESP32-S3 · 7 wires
- ST7789 2.0 in TFT screenESP32-S3 · 7 wires
- GC9A01 round screenESP32-S3 · 7 wires
- SSD1306 OLED 0.91 in screenESP32-S3 · 4 wires
- 4.2 in e-paper screenESP32-S3 · 8 wires
- TTP223 touch sensorESP32-S3 · 3 wires
- Push buttonESP32-S3 · 2 wires
- Foot switchESP32-S3 · 2 wires
- Slide switchESP32-S3 · 2 wires
- SW-520D tilt switchESP32-S3 · 2 wires
- MC-38 door switchESP32-S3 · 2 wires
- AM312 PIR motion sensorESP32-S3 · 3 wires
- HC-SR04 ultrasonic sensorESP32-S3 · 4 wires
- Capacitive soil moisture sensorESP32-S3 · 3 wires
- BME280 sensorESP32-S3 · 4 wires
- MLX90614 infrared thermometerESP32-S3 · 4 wires
- SGP30 air quality sensorESP32-S3 · 4 wires
- HX711 load cellESP32-S3 · 4 wires
- KY-040 rotary encoderESP32-S3 · 5 wires
- 3×4 keypadESP32-S3 · 7 wires
- Passive buzzerESP32-S3 · 2 wires
- WS2812 LED ringESP32-S3 · 3 wires
- WS2812 LED stickESP32-S3 · 3 wires
- WS2812B LED stripESP32-S3 · 3 wires
- KY-016 RGB LEDESP32-S3 · 4 wires
- 2-channel relay moduleESP32-S3 · 4 wires
- 28BYJ-48 stepper motor (ULN2003)ESP32-S3 · 6 wires
- MAX98357A I2S amplifierESP32-S3 · 5 wires
- SX1262 LoRa module (Ra-01SH)ESP32-S3 · 9 wires