The Nokia 5110 is a cheap 84×48 monochrome LCD with a low-power controller, the PCD8544. It suits battery gadgets and small status screens, and it is readable in daylight.
On the ESP32 DevKit V1 it is an easy fit: the display is a 3.3 V part, so all five signal lines connect directly — hardware SPI on D18/D23 and the control lines on D25, D26 and D27. The sketch turns the board into a pocket Wi-Fi scanner that lists the five strongest networks around you with their signal strength, refreshed every five seconds.
Wiring
| ESP32 DevKit V1 | Nokia 5110 LCD (84×48, PCD8544) | Wire | Notes |
|---|---|---|---|
| D25 | RST | orange | |
| D27 | CE | purple | Chip select. SCE on blue boards. |
| D26 | DC | blue | |
| D23 | DIN | green | VSPI MOSI. |
| D18 | CLK | yellow | VSPI SCK. |
| 3V3 | VCC | red | The PCD8544 is a 3.3 V chip — a direct match for the ESP32. |
| GND | BL | black | Via 330 Ω — Red boards light the backlight with BL to GND. Blue boards: BL through 330 Ω to 3V3 instead. |
| GND | GND | black |
3.3 V (2.7–3.3 V) part, 3.3 V board. The PCD8544 is a 3.3 V chip and its inputs are not 5 V tolerant. ESP32 and Pico connect directly. On an Uno power it from 3.3 V and drop the five signal lines through a level shifter (or 10 kΩ series resistors on RST, DC, DIN, CLK and 1 kΩ on CE as a quick fix).
Board quirks
- Unlike on an Uno, no level shifting is needed: the ESP32’s 3.3 V logic is exactly what the PCD8544 expects, so all five signal wires go straight across.
- The three-pin constructor
Adafruit_PCD8544(DC, CS, RST)uses hardware SPI, which on the DevKit V1 means CLK on D18 and DIN on D23. RST, CE and DC can go on any free GPIO; D25–D27 keep the strapping pins (D2, D5, D12, D15) free. - Contrast is the usual problem. The sketch sets 55; if the screen is all grey or black lower it, if it is blank raise it. Values between 45 and 65 suit most modules, and the right one shifts a little with temperature.
- The scan is passive: the ESP32 listens for beacons and never connects or sends data. The display has room for 14 characters × 6 lines, so names are cut to 9 characters next to the signal in dBm.
- Backlight polarity differs between the red and blue boards. If the light stays off, move the 330 Ω resistor from GND to 3V3.
Code
// Nokia 5110 LCD (PCD8544) on an ESP32 DevKit V1 — pocket Wi-Fi scanner.
// Hardware SPI (VSPI): CLK → D18, DIN → D23. CE → D27, DC → D26, RST → D25.
// VCC → 3V3, GND → GND, BL → 330 Ω → GND (red boards; blue boards: BL via 330 Ω to 3V3).
// Lists the five strongest networks nearby (passive scan — it never connects or transmits data).
#include <WiFi.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
constexpr int8_t LCD_DC = 26, LCD_CE = 27, LCD_RST = 25;
Adafruit_PCD8544 lcd(LCD_DC, LCD_CE, LCD_RST); // 3-pin constructor = hardware SPI on D18/D23
void setup() {
Serial.begin(115200);
lcd.begin();
lcd.setContrast(55); // 45–65 suits most modules: too high = all black, too low = blank
lcd.clearDisplay();
lcd.setTextColor(BLACK);
lcd.setCursor(0, 0);
lcd.println("ESP32 + 5110");
lcd.println("Scanning...");
lcd.display();
WiFi.mode(WIFI_STA);
WiFi.disconnect();
Serial.println("Nokia 5110 ready — scanning Wi-Fi every 5 s");
}
void loop() {
int n = WiFi.scanNetworks();
// Pick the five strongest (the scan result is not guaranteed to be sorted).
int order[5];
int shown = 0;
for (; shown < 5 && shown < n; shown++) {
int best = -1;
for (int i = 0; i < n; i++) {
bool used = false;
for (int k = 0; k < shown; k++) used |= order[k] == i;
if (!used && (best < 0 || WiFi.RSSI(i) > WiFi.RSSI(best))) best = i;
}
order[shown] = best;
}
lcd.clearDisplay();
lcd.setCursor(0, 0);
lcd.printf("%d networks\n", n); // 14 characters × 6 lines on 84 × 48 pixels
Serial.printf("%d networks\n", n);
for (int k = 0; k < shown; k++) {
int i = order[k];
String ssid = WiFi.SSID(i);
if (ssid.isEmpty()) ssid = "(hidden)";
lcd.printf("%4ld %.9s\n", (long)WiFi.RSSI(i), ssid.c_str());
Serial.printf(" %4ld dBm ch %2ld %s\n", (long)WiFi.RSSI(i), (long)WiFi.channel(i), ssid.c_str());
}
lcd.display();
WiFi.scanDelete();
delay(5000);
}// Nokia 5110 LCD (PCD8544) on an ESP32 DevKit V1 — pocket Wi-Fi scanner.
// Hardware SPI (VSPI): CLK → D18, DIN → D23. CE → D27, DC → D26, RST → D25.
// VCC → 3V3, GND → GND, BL → 330 Ω → GND (red boards; blue boards: BL via 330 Ω to 3V3).
// Lists the five strongest networks nearby (passive scan — it never connects or transmits data).
#include <WiFi.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
constexpr int8_t LCD_DC = 26, LCD_CE = 27, LCD_RST = 25;
Adafruit_PCD8544 lcd(LCD_DC, LCD_CE, LCD_RST); // 3-pin constructor = hardware SPI on D18/D23
void setup() {
Serial.begin(115200);
lcd.begin();
lcd.setContrast(55); // 45–65 suits most modules: too high = all black, too low = blank
lcd.clearDisplay();
lcd.setTextColor(BLACK);
lcd.setCursor(0, 0);
lcd.println("ESP32 + 5110");
lcd.println("Scanning...");
lcd.display();
WiFi.mode(WIFI_STA);
WiFi.disconnect();
Serial.println("Nokia 5110 ready — scanning Wi-Fi every 5 s");
}
void loop() {
int n = WiFi.scanNetworks();
// Pick the five strongest (the scan result is not guaranteed to be sorted).
int order[5];
int shown = 0;
for (; shown < 5 && shown < n; shown++) {
int best = -1;
for (int i = 0; i < n; i++) {
bool used = false;
for (int k = 0; k < shown; k++) used |= order[k] == i;
if (!used && (best < 0 || WiFi.RSSI(i) > WiFi.RSSI(best))) best = i;
}
order[shown] = best;
}
lcd.clearDisplay();
lcd.setCursor(0, 0);
lcd.printf("%d networks\n", n); // 14 characters × 6 lines on 84 × 48 pixels
Serial.printf("%d networks\n", n);
for (int k = 0; k < shown; k++) {
int i = order[k];
String ssid = WiFi.SSID(i);
if (ssid.isEmpty()) ssid = "(hidden)";
lcd.printf("%4ld %.9s\n", (long)WiFi.RSSI(i), ssid.c_str());
Serial.printf(" %4ld dBm ch %2ld %s\n", (long)WiFi.RSSI(i), (long)WiFi.channel(i), ssid.c_str());
}
lcd.display();
WiFi.scanDelete();
delay(5000);
}Library: Adafruit PCD8544 Nokia 5110 LCD library (Adafruit (also install Adafruit GFX Library)) — compiled with Adafruit PCD8544 Nokia 5110 LCD library 2.0.3.
Expected serial output
Nokia 5110 ready — scanning Wi-Fi every 5 s
7 networks
-42 dBm ch 6 FlatNo12_5G
-67 dBm ch 11 JioFiber-xyz
-71 dBm ch 1 ACT_Home
-80 dBm ch 6 (hidden)
-88 dBm ch 3 AirtelXstreamNokia 5110 ready — scanning Wi-Fi every 5 s 7 networks -42 dBm ch 6 FlatNo12_5G -67 dBm ch 11 JioFiber-xyz -71 dBm ch 1 ACT_Home -80 dBm ch 6 (hidden) -88 dBm ch 3 AirtelXstream
Common errors
Screen is completely black or completely blank
Contrast. Change setContrast(55) in steps of 5 until text appears.
Backlight works but nothing is drawn
DIN and CLK swapped, or not on D23/D18. Hardware SPI only uses those two pins.
Text is garbled or shifted after a few minutes
A loose RST or DC wire. Breadboard jumpers on these displays are often marginal — push the module firmly into the breadboard or solder header pins.