ExpertInterfaces & Displays

Eight-Button and Eight-LED Pico Console

Combine serial input and output registers into a compact control panel: eight buttons in, eight LEDs out, using six Pico signals.

Estimated time: 3–5 hours · Skills: Shift-register integration, GPIO timing, input polarity

Parts from the database

Other supplies

Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.

Connections

  1. Power both HC chips from Pico 3V3/GND and bypass each. HC165: CLK INH pin 15 low, SER pin 10 low, /PL pin 1 to GP2, CLK pin 2 to GP3, Q7 pin 9 to GP4; buttons pull D0–D7 low with 10 kΩ pull-ups.
  2. HC595: SER pin 14 to GP19, SRCLK pin 11 to GP18, RCLK pin 12 to GP17; /SRCLR pin 10 high, /OE pin 13 low.
  3. HC595 QA–QH pins 15,1,2,3,4,5,6,7 each drive one LED through 1 kΩ to ground. Confirm no output exceeds GPIO/IC current limits.

Build steps

  1. Run the loop; button states should print as an 8-bit value and be copied to the LED outputs.
  2. Press one button at a time and map each button to its LED.
  3. Add software debounce before using buttons for controls.
  4. Use only the logic LEDs supplied here; replace them with drivers before switching loads.

Software and firmware setup

from machine import Pin
from time import sleep_ms
load, clk_in, data = Pin(2,Pin.OUT,value=1), Pin(3,Pin.OUT,value=0), Pin(4,Pin.IN)
ser, srclk, rclk = Pin(19,Pin.OUT), Pin(18,Pin.OUT), Pin(17,Pin.OUT)
def read_buttons():
    load.value(0); load.value(1); value=0
    for _ in range(8):
        value=(value<<1)|data.value(); clk_in.value(1); clk_in.value(0)
    return value
def show(value):
    for bit in range(8):
        ser.value((value >> (7-bit)) & 1); srclk.value(0); srclk.value(1)
    rclk.value(0); rclk.value(1)
while True:
    buttons=read_buttons()
    show(buttons ^ 0xff)  # buttons pull low, so show pressed state
    print('{:08b}'.format(buttons))
    sleep_ms(50)

Review the pin assignments in the sketch against the wiring table before uploading.

Test your build

Pressing a button changes one printed bit and lights its paired LED after the short scan interval; adjust bit order if your wiring order differs.

Troubleshooting

  • No response: verify both clock paths and HC165 /PL pulse.
  • LEDs inverted: remove or change the XOR inversion in `show` mapping.
  • Pico resets: reduce LED current and inspect shared 3.3 V rail.

Safety and limitations

Use 3.3 V logic and low-current LEDs only; add a properly rated transistor/driver before controlling any real load.

Manufacturer and platform documentation

Community Notes for This Project

These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.

Set up the comments service to load community notes.

Share a tip or question about this build

← Browse all projects