ESP32 Wi-Fi Signal Strength Meter with OLED Display

Build a pocket ESP32 Wi-Fi signal strength meter with an SSD1306 OLED and one button. It lists the strongest networks and shows a live dBm meter with a bar graph. Wiring table, diagram and full code.

  • DifficultyEasy
  • Build time1–2 hours
  • Board / MCUESP32 DevKit
  • Parts5 items
  • CodeArduino C++

Need it ready-made? Buy Ready Project

This ESP32 Wi-Fi signal strength meter is a pocket tool that scans the Wi-Fi networks around you and shows the five strongest on a small OLED screen, with their signal level in dBm. Pick one network with a push button and the meter locks on to it, showing a live reading, a quality percentage and a bar graph that updates about four times a second.

It is a small, beginner-friendly build with only three parts: an ESP32 DevKit, a 0.96 inch SSD1306 OLED and a push button. Walk around your home with it to find Wi-Fi dead spots, the best place for a router or repeater, or a good spot for your next ESP8266 or ESP32 IoT device. It never connects to any network, so it needs no Wi-Fi password.

ESP32 Wi-Fi signal strength meter with SSD1306 OLED display and push button on a breadboard

How It Works

  • Scanning: the ESP32 runs in station mode and calls WiFi.scanNetworks(). The results come back sorted from strongest to weakest, and the code keeps the top five, with each network’s name, MAC address (BSSID), channel and RSSI.
  • List screen: the OLED shows the five networks with their RSSI in dBm. The list refreshes every 10 seconds. A short press of the button moves the arrow to the next network.
  • Meter screen: a long press (more than 1 second) locks on to the selected network. The code then scans only that network’s channel, which is much faster than a full scan, and finds the same access point by its MAC address. It shows the RSSI in large digits, a 0 to 100 % quality value and a bar graph. If the network disappears it shows “Lost…”.
  • Reading the numbers: RSSI is negative. Around -50 dBm is excellent, -60 to -67 dBm is good for video calls, -70 dBm is usable for browsing and IoT, and below -80 dBm connections drop often.
  • Status LED: the on-board blue LED on GPIO2 lights during every full scan, and the Serial Monitor prints each meter reading at 115200 baud so you can log it on a laptop.

Components Required

  • ESP32 DevKit V1 (ESP32-WROOM-32, 30 or 38 pin) – 1
  • 0.96 inch SSD1306 I2C OLED display, 128×64 – 1
  • Tactile push button (6×6 mm) – 1
  • Breadboard and male-to-male jumper wires
  • Micro-USB cable, plus a 5V power bank to use it as a portable meter

Wiring Table

Part / pinESP32 pinNotes
OLED VCC3V3Most SSD1306 modules also accept 5V, but 3V3 is safest
OLED GNDGND
OLED SDAGPIO21Default I2C data pin
OLED SCLGPIO22Default I2C clock pin
Push button leg 1GPIO4Internal pull-up, reads LOW when pressed
Push button leg 2GND
Status LEDGPIO2On-board LED, no wiring needed
PowerMicro-USBUSB cable or power bank

Connection Diagram

The illustration above shows the parts and how they fit together. It is a guide for placement only. The pin-accurate drawing below matches the wiring table exactly, so follow it while you build.

ESP32 Wi-Fi Signal Strength Meter – Pin-Accurate Wiring Power USB cable or 5V power bank to the ESP32 DevKit micro-USB socket ESP32 3V3 pin: OLED VCC ESP32 GND: OLED GND and one leg of the push button SSD1306 OLED SDA to GPIO21 SCL to GPIO22 I2C address 0x3C (change OLED_ADDR to 0x3D if needed) Push button One leg to GPIO4, the other leg to GND Internal pull-up enabled in code, no resistor needed Status LED On-board blue LED on GPIO2 lights during each scan
Pin-accurate connection diagram for the ESP32 Wi-Fi signal strength meter.

Code

Install the ESP32 board package in the Arduino IDE (Boards Manager, search “esp32”) and choose ESP32 Dev Module. Install Adafruit SSD1306 and Adafruit GFX from the Library Manager. No Wi-Fi name or password is needed because the meter only scans.

/*
  ESP32 Wi-Fi Signal Strength Meter with OLED Display
  ardiunoprojecthub.online - Project 45

  - Scans nearby Wi-Fi networks and lists the 5 strongest on a 0.96" SSD1306 OLED.
  - Short press of the button: move the cursor to the next network.
  - Long press (over 1 s): lock on to the selected network and show a live
    RSSI meter (dBm, % quality and a bar graph). Long press again to go back.
  - The meter mode is handy for finding the best place for a router, repeater
    or an IoT device.

  Wiring:
    OLED VCC -> 3V3, GND -> GND, SDA -> GPIO21, SCL -> GPIO22
    Push button -> GPIO4 and GND (internal pull-up)
    Status LED (+) -> GPIO2 (on-board LED on most DevKits)

  Libraries: Adafruit SSD1306 and Adafruit GFX (Library Manager).
  No Wi-Fi password is needed: the ESP32 only scans, it never connects.
*/
#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_W 128
#define SCREEN_H 64
#define OLED_ADDR 0x3C        // change to 0x3D if your OLED uses that address
#define BUTTON_PIN 4
#define LED_PIN 2
#define MAX_LIST 5

Adafruit_SSD1306 oled(SCREEN_W, SCREEN_H, &Wire, -1);

String ssids[MAX_LIST];       // names of the strongest networks
uint8_t bssids[MAX_LIST][6];  // MAC address of each access point
int channels[MAX_LIST];
int rssis[MAX_LIST];
int listCount = 0;
int cursorPos = 0;
bool meterMode = false;
unsigned long lastScan = 0;

// Convert dBm to a rough 0-100 % quality value
int rssiToPercent(int rssi) {
  if (rssi <= -100) return 0;
  if (rssi >= -50) return 100;
  return 2 * (rssi + 100);
}

// Scan and keep the strongest MAX_LIST networks (results come sorted by RSSI)
void scanNetworks() {
  digitalWrite(LED_PIN, HIGH);
  int n = WiFi.scanNetworks(false, true);   // blocking scan, include hidden
  listCount = 0;
  for (int i = 0; i < n && listCount < MAX_LIST; i++) {
    String name = WiFi.SSID(i);
    if (name.length() == 0) name = "(hidden)";
    ssids[listCount] = name;
    memcpy(bssids[listCount], WiFi.BSSID(i), 6);
    channels[listCount] = WiFi.channel(i);
    rssis[listCount] = WiFi.RSSI(i);
    listCount++;
  }
  WiFi.scanDelete();
  if (cursorPos >= listCount) cursorPos = 0;
  digitalWrite(LED_PIN, LOW);
}

// Re-scan only the locked network's channel and return its RSSI (or 0 if lost)
int readLockedRssi() {
  int n = WiFi.scanNetworks(false, true, false, 120, channels[cursorPos]);
  int found = 0;
  for (int i = 0; i < n; i++) {
    if (memcmp(WiFi.BSSID(i), bssids[cursorPos], 6) == 0) {
      found = WiFi.RSSI(i);
      break;
    }
  }
  WiFi.scanDelete();
  return found;
}

void drawList() {
  oled.clearDisplay();
  oled.setTextSize(1);
  oled.setCursor(0, 0);
  oled.print("Wi-Fi scan  ");
  oled.print(listCount);
  oled.println(" found");
  oled.drawLine(0, 9, 127, 9, SSD1306_WHITE);
  if (listCount == 0) {
    oled.setCursor(0, 24);
    oled.println("No networks found");
  }
  for (int i = 0; i < listCount; i++) {
    int y = 12 + i * 10;
    oled.setCursor(0, y);
    oled.print(i == cursorPos ? ">" : " ");
    oled.print(ssids[i].substring(0, 13));   // keep it on one line
    oled.setCursor(98, y);
    oled.print(rssis[i]);
  }
  oled.display();
}

void drawMeter(int rssi) {
  oled.clearDisplay();
  oled.setTextSize(1);
  oled.setCursor(0, 0);
  oled.print(ssids[cursorPos].substring(0, 15));
  oled.setCursor(104, 0);
  oled.print("C");
  oled.print(channels[cursorPos]);
  if (rssi == 0) {
    oled.setTextSize(2);
    oled.setCursor(10, 28);
    oled.print("Lost...");
  } else {
    int pct = rssiToPercent(rssi);
    oled.setTextSize(2);
    oled.setCursor(0, 16);
    oled.print(rssi);
    oled.print(" dBm");
    oled.setTextSize(1);
    oled.setCursor(0, 36);
    oled.print("Quality: ");
    oled.print(pct);
    oled.print("%");
    oled.drawRect(0, 48, 128, 14, SSD1306_WHITE);           // bar outline
    oled.fillRect(2, 50, map(pct, 0, 100, 0, 124), 10, SSD1306_WHITE);
  }
  oled.display();
}

// Returns 0 = no press, 1 = short press, 2 = long press
int readButton() {
  if (digitalRead(BUTTON_PIN) == HIGH) return 0;
  delay(30);                                   // debounce
  if (digitalRead(BUTTON_PIN) == HIGH) return 0;
  unsigned long start = millis();
  while (digitalRead(BUTTON_PIN) == LOW) delay(5);
  return (millis() - start > 1000) ? 2 : 1;
}

void setup() {
  Serial.begin(115200);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pinMode(LED_PIN, OUTPUT);
  Wire.begin(21, 22);
  if (!oled.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) {
    Serial.println("OLED not found - check wiring and address");
    while (true) delay(1000);
  }
  oled.setTextColor(SSD1306_WHITE);
  oled.clearDisplay();
  oled.setCursor(0, 24);
  oled.print("Scanning Wi-Fi...");
  oled.display();
  WiFi.mode(WIFI_STA);   // station mode, but we never connect
  WiFi.disconnect();
  delay(100);
  scanNetworks();
  drawList();
  lastScan = millis();
}

void loop() {
  int press = readButton();
  if (press == 1 && !meterMode && listCount > 0) {
    cursorPos = (cursorPos + 1) % listCount;
    drawList();
  } else if (press == 2 && listCount > 0) {
    meterMode = !meterMode;
    if (!meterMode) { scanNetworks(); drawList(); lastScan = millis(); }
  }

  if (meterMode) {
    int rssi = readLockedRssi();             // about 4 updates per second
    drawMeter(rssi);
    Serial.printf("%s  %d dBm\n", ssids[cursorPos].c_str(), rssi);
  } else if (millis() - lastScan > 10000) {  // refresh the list every 10 s
    scanNetworks();
    drawList();
    lastScan = millis();
  }
}

Testing and Using the Meter

  • Upload the sketch. The OLED shows “Scanning Wi-Fi…” and then the list of the strongest networks.
  • Short-press the button to move the arrow to your own network, then hold it for more than one second to open the meter screen.
  • Stand next to the router and note the reading (usually -30 to -45 dBm). Then walk to each room and note the value.
  • Rooms below -75 dBm are weak spots. Move the router higher, away from walls and metal, or add a repeater halfway, and measure again.
  • Hold the button for one second again to return to the list.

Troubleshooting

ProblemFix
OLED stays blankCheck SDA on GPIO21 and SCL on GPIO22. Run an I2C scanner sketch; if the address is 0x3D, change OLED_ADDR.
“No networks found”Make sure you are within range of a 2.4 GHz network. The ESP32 cannot see 5 GHz Wi-Fi.
Your network is not in the listOnly the five strongest are shown. Move closer to the router, or change MAX_LIST to a bigger number and reduce the text size.
Button does nothingUse two legs on opposite sides of the tactile switch, or turn it 90 degrees on the breadboard.
Reading jumps around a lotThat is normal for Wi-Fi. Hold the meter still for a few seconds and use the average value.

Ideas to Extend

  • Add a small LiPo battery and a TP4056 charger board to make it fully portable.
  • Show a channel graph so you can pick the least crowded 2.4 GHz channel for your router.
  • Add a buzzer that beeps faster as the signal gets stronger, like a metal detector, to find hidden access points.

1 thought on “ESP32 Wi-Fi Signal Strength Meter with OLED Display”

Leave a Comment