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.

74HC595 shift register with NodeMCU ESP8266 — 8 outputs, Wi-Fi signal bar

Add 8 outputs to a NodeMCU with a 74HC595 at 3.3 V (DS D7, clock D5, latch D6), avoiding the boot pins, and show Wi-Fi signal strength as an LED bar.

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

Community draft — report a mistake

A 74HC595 shift register gives a NodeMCU eight extra outputs from three pins — and on the ESP8266, where boot pins and USB serial take most of the header, that matters more than on any other board.

The chip runs from 3V3, with data on D7, clock on D5 and latch on D6 — three pins with no boot role. OE goes to GND and MR to 3V3. After an LED self-test, the sketch scans for Wi-Fi networks and shows the strongest signal as a bar of 0–8 LEDs.

Wiring

NodeMCU ESP8266Only the pins used are shown · 3.3 V logic74HC595 8-bit shift register (DIP-16)GND3V3D5D6D7VCCGNDDSSH_CPST_CPOEMRQ0 → LED 1 via 220 Ω to GNDQ1 → LED 2 via 220 ΩQ2 → LED 3 via 220 ΩQ3 → LED 4 via 220 ΩQ4 → LED 5 via 220 ΩQ5 → LED 6 via 220 ΩQ6 → LED 7 via 220 ΩQ7 → LED 8 via 220 ΩQ7S (not connected)
Also needed: 8 LEDs and 8 × 220 Ω resistors, 100 nF ceramic capacitor.
Every connection
NodeMCU ESP826674HC595 8-bit shift register (DIP-16)WireNotes
—Q0—To LED 1 via 220 Ω to GND (not drawn)
—Q1—To LED 2 via 220 Ω (not drawn)
—Q2—To LED 3 via 220 Ω (not drawn)
—Q3—To LED 4 via 220 Ω (not drawn)
—Q4—To LED 5 via 220 Ω (not drawn)
—Q5—To LED 6 via 220 Ω (not drawn)
—Q6—To LED 7 via 220 Ω (not drawn)
—Q7—To LED 8 via 220 Ω (not drawn)
3V3VCCredPin 16. 100 nF capacitor from VCC to GND at the chip.
GNDGNDblackPin 8.
D7DSgreenPin 14, serial data (GPIO13).
D5SH_CPbluePin 11, shift clock (GPIO14).
D6ST_CPyellowPin 12, latch (GPIO12).
GNDOEblackPin 13, active-LOW output enable — always on.
3V3MRredPin 10, active-LOW reset — keep HIGH.

2–6 V part, 3.3 V board. Power it from the same voltage as your board: 3.3 V on ESP32 and Pico, 5 V on Uno. At 5 V the 74HC595 needs about 3.15 V for a HIGH, so a 3.3 V board driving a 5 V-powered chip is marginal — use a 74HCT595 at 5 V for that.

Board quirks

  • The NodeMCU has few truly free GPIOs: D3, D4 and D8 decide the boot mode, D0 has no PWM or interrupts, RX/TX carry USB serial, and D1/D2 are best kept for I2C. A 74HC595 on D5, D6 and D7 turns three safe pins into eight outputs.
  • Run the chip from 3V3 so its inputs match the ESP8266’s 3.3 V logic. A 74HC595 on 5 V needs about 3.5 V for a HIGH, which the NodeMCU can’t give reliably — use a 74HCT595 if you need 5 V outputs.
  • At 3.3 V the outputs are weaker, so 220 Ω resistors give about 5 mA per red LED. All eight on stays well under the chip’s 70 mA limit.
  • shiftOut() is plenty fast for LEDs. For long chains, D5/D7 are also the HSPI clock and MOSI pins, so you can switch to hardware SPI without rewiring.
  • The sketch scans for networks (passively — it never connects) and lights one LED per ~6 dB of the strongest signal: handy for finding the best spot for a router, repeater or outdoor NodeMCU.

Code

74hc595-nodemcu.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// 74HC595 shift register on a NodeMCU (ESP8266) — 8-LED Wi-Fi signal bar from 3 pins.
// VCC → 3V3, GND → GND, DS → D7 (GPIO13), SH_CP → D5 (GPIO14), ST_CP (latch) → D6 (GPIO12),
// OE → GND, MR → 3V3. Q0–Q7 → LED + 220 Ω each → GND.
// Shows the strongest nearby network's signal (passive scan — it never connects).
#include <ESP8266WiFi.h>

constexpr uint8_t DATA_PIN = D7, CLOCK_PIN = D5, LATCH_PIN = D6;

void writeByte(uint8_t value) {
  digitalWrite(LATCH_PIN, LOW);
  shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, value);  // Q7 gets the first bit sent
  digitalWrite(LATCH_PIN, HIGH);                   // outputs change together on this edge
}

void setup() {
  pinMode(DATA_PIN, OUTPUT);
  pinMode(CLOCK_PIN, OUTPUT);
  pinMode(LATCH_PIN, OUTPUT);
  writeByte(0);
  Serial.begin(115200);
  Serial.println();
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  for (uint8_t i = 0; i < 8; i++) {  // self-test: each LED in turn
    writeByte(1 << i);
    delay(100);
  }
  writeByte(0);
  Serial.println("74HC595 Wi-Fi bar: scanning every 3 s");
}

void loop() {
  int n = WiFi.scanNetworks();
  int best = -100;
  String name = "-";
  for (int i = 0; i < n; i++)
    if (WiFi.RSSI(i) > best) {
      best = WiFi.RSSI(i);
      name = WiFi.SSID(i);
    }
  // -90 dBm (barely there) → 0 LEDs, -40 dBm (next to the router) → 8 LEDs.
  int leds = n ? constrain((best + 90) * 8 / 50, 0, 8) : 0;
  writeByte(leds ? (uint8_t)(0xFF >> (8 - leds)) : 0);  // fill Q0 upwards
  Serial.printf("%d networks, strongest %s at %d dBm -> %d LEDs\n", n, name.c_str(), best, leds);
  WiFi.scanDelete();
  delay(3000);
}

Expected serial output

Serial Monitor · 115200Output
74HC595 Wi-Fi bar: scanning every 3 s
9 networks, strongest JioFiber-4G at -48 dBm -> 6 LEDs
9 networks, strongest JioFiber-4G at -63 dBm -> 4 LEDs

Common errors

Board won’t boot after wiring the 74HC595

A wire landed on D3, D4 or D8. Check that DS, SH_CP and ST_CP are on D7, D5 and D6.

LEDs show a random pattern that never changes

The latch on D6 isn’t connected. Without a rising edge on ST_CP the outputs never update.

Nothing lights

MR is LOW or floating (tie it to 3V3) or OE is HIGH (tie it to GND).

↑↓ to move · Enter to open