Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

SSD1306 OLED with Wemos D1 mini — pocket Wi-Fi scanner

Wire a 0.96″ SSD1306 OLED to a Wemos D1 mini on D1/D2 at 3.3 V and list nearby Wi-Fi networks with channel and signal strength on the screen.

Arduino C++Verified — core esp8266 3.1.2, Adafruit SSD1306 2.5.17, 3 Nov 2026Compile-only

Community draft — report a mistake

The D1 mini and a 0.96″ OLED make a pocket-sized gadget, and the most useful thing to show on it is the board’s own radio. This sketch lists the 2.4 GHz networks around you, their channel and their signal strength — handy for picking a free channel for your router or finding the dead spot before you mount a sensor.

Wiring is the standard D1 mini I2C pair: SCL on D1, SDA on D2, power from 3V3.

Wiring

Wemos D1 miniOnly the pins used are shown · 3.3 V logicSSD1306 OLED 0.96″ (128×64, I2C)3V3D1D2GNDGNDVCCSCLSDA
Every connection
Wemos D1 miniSSD1306 OLED 0.96″ (128×64, I2C)WireNotes
3V3VCCredFrom 3V3, so the module’s I2C pull-ups go to 3.3 V.
GNDGNDblack
D1SCLyellowD1 = GPIO5, the core’s default SCL.
D2SDAblueD2 = GPIO4, the default SDA.

3.3–5 V (on-board regulator) part, 3.3 V board. Most modules have a regulator and run from 3.3 V or 5 V. Their I2C pull-ups go to VCC, so on ESP32 and Pico power the OLED from 3.3 V to keep SDA/SCL at a safe level.

Board quirks

  • Wire.begin() on the ESP8266 uses SDA = D2, SCL = D1 — the same two pins every LOLIN I2C shield uses, so you can keep this OLED and stack a sensor shield on the same bus.
  • The little OLED shield made for the D1 mini is a 0.66″ 64×48 panel. The Adafruit library doesn’t offer that size; use U8g2 (or a 64×48 fork of the Adafruit library) for it. This guide is for the common 0.96″ 128×64 module.
  • WiFi.scanNetworks() blocks for about 2 s. The core services Wi-Fi and the watchdog while it waits, so no yield() is needed — but don’t put your own long busy loops around it.
  • The scan only listens for beacons and never connects, so it needs no password and stores nothing.

Code

ssd1306-d1mini.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// Pocket Wi-Fi scanner: 0.96" SSD1306 OLED (128x64, I2C) on a Wemos D1 mini (ESP8266).
// VCC → 3V3, GND → GND, SCL → D1 (GPIO5), SDA → D2 (GPIO4).
// Lists nearby 2.4 GHz networks with channel and signal strength. It only listens:
// it never joins or disturbs any network.
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 64, &Wire, -1);  // -1: the 4-pin module has no reset pin

void setup() {
  Serial.begin(115200);
  Serial.println();
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();  // scan only - don't reconnect to a network saved in flash
  Wire.begin();       // SDA = D2 (GPIO4), SCL = D1 (GPIO5)
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println("SSD1306 not found at 0x3C - check SDA/SCL and try 0x3D");
    while (true) delay(100);  // delay() feeds the watchdog
  }
  display.setTextColor(SSD1306_WHITE);
  display.setTextSize(1);
  Serial.println("SSD1306 found at 0x3C - scanning every 10 s");
}

void loop() {
  int n = WiFi.scanNetworks();  // blocks ~2 s; the core keeps Wi-Fi and the watchdog serviced
  if (n < 0) n = 0;
  display.clearDisplay();
  display.setCursor(0, 0);
  display.printf("%d networks\n", n);
  Serial.printf("%d networks\n", n);
  for (int i = 0; i < n; i++) {
    String name = WiFi.SSID(i);
    if (name.length() == 0) name = "(hidden)";
    Serial.printf("  ch%-2d %4d dBm  %s\n", WiFi.channel(i), WiFi.RSSI(i), name.c_str());
    if (i < 7) display.printf("%-2d %4d %.12s\n", WiFi.channel(i), WiFi.RSSI(i), name.c_str());
  }
  display.display();
  WiFi.scanDelete();  // free the result list
  delay(10000);
}

Library: Adafruit SSD1306 (Adafruit (also install Adafruit GFX Library)) — compiled with Adafruit SSD1306 2.5.17.

Expected serial output

Serial Monitor · 115200Output
SSD1306 found at 0x3C - scanning every 10 s
4 networks
  ch1   -48 dBm  JioFiber-5A2C
  ch6   -61 dBm  Airtel_Home
  ch11  -77 dBm  (hidden)
  ch6   -83 dBm  TP-Link_2B10

Common errors

“SSD1306 not found at 0x3C”

SDA/SCL swapped (SDA is D2), a loose jumper, or a 0x3D module. Run the I2C scanner.

Only half the screen shows text

It is a 128×32 module. Change the constructor to Adafruit_SSD1306 display(128, 32, …).

“0 networks” every time

Only 2.4 GHz networks show — the ESP8266 can’t see 5 GHz. If even those are missing, check the board’s antenna end isn’t shielded by metal.

↑↓ to move · Enter to open