Project 3.1.28: Status Remote Display
Advanced Embedded Systems Project Using Raspberry Pi Pico 2 W and MicroPython
Overview
The Pico simulates a remote status panel by cycling through system states and showing them with a three-LED display.
Remote teams need simple status panels that summarize whether a distant system is healthy, busy, or needs service.
A Pico 2 W prototype with one push button and three LEDs that represent a remote device status display panel.
Human-readable state mapping, button debouncing, and honest discussion of how a local panel could later receive wired or wireless updates.
Required Components
![]() Raspberry Pi Pico 2 W |
![]() Push button |
![]() Breadboard |
![]() Jumper wires |
![]() LED |
![]() Resistor |
Circuit Connections
| Component terminal | Connect to | Pico physical pin | Notes |
|---|---|---|---|
| Button leg 1 | GPIO 14 | GPIO 14 / physical pin 19 | Use with internal pull-down |
| Button leg 2 | 3.3V output | Physical pin 36 | High when pressed |
| Green LED anode | 220 ohm resistor to GPIO 15 | GPIO 15 / physical pin 20 | NORMAL |
| Yellow LED anode | 220 ohm resistor to GPIO 16 | GPIO 16 / physical pin 21 | BUSY |
| Red LED anode | 220 ohm resistor to GPIO 17 | GPIO 17 / physical pin 22 | FAULT |
| All LED cathodes | GND | Physical pin 18, 23, or 38 | Ground return |
Wiring Diagram

Button -> GPIO 14 and 3.3V
GPIO 15 -> resistor -> green LED anode
GPIO 16 -> resistor -> yellow LED anode
GPIO 17 -> resistor -> red LED anode
All LED cathodes -> GND
Step-by-Step Assembly
- Wire the push button between GPIO 14 and 3.3V.
- Connect the green LED to GPIO 15 through a 220 ohm resistor and connect the cathode to GND.
- Connect the yellow LED to GPIO 16 through a 220 ohm resistor and connect the cathode to GND.
- Connect the red LED to GPIO 17 through a 220 ohm resistor and connect the cathode to GND.
Testing Individual Components
Before running the full project, test each subsystem separately. This makes it easier to find wiring, library, or logic problems before full integration.
- Hardware setup: Assemble the Pico, sensor, indicator, and load wiring exactly as shown in the connection table before applying power.
- Test the input sensor: Print the button state and confirm it changes cleanly when pressed and released.
- Test the output device: Test each LED separately so the color-to-pin mapping is correct before running the state logic.
- Test the decision logic: Confirm that short presses cycle states and a long press resets to OFFLINE.
- Run the full system: Run repeated presses and compare the LED state with the printed serial label.
- Validate the prototype: Ask another student to interpret the panel without coaching and note whether the display language is intuitive.
- Save the project: Save the validated program on the Pico as main.py and keep a copy on the computer for future edits.
Full Project Code
After completing and checking the circuit connections, open Thonny IDE, copy and paste this code into a new file or upload the project file to the Raspberry Pi Pico 2 W, then run it from Thonny.
from machine import Pin
import time
BUTTON_PIN = 14
GREEN_PIN = 15
YELLOW_PIN = 16
RED_PIN = 17
LONG_PRESS_MS = 1500
button = Pin(BUTTON_PIN, Pin.IN, Pin.PULL_DOWN)
green = Pin(GREEN_PIN, Pin.OUT)
yellow = Pin(YELLOW_PIN, Pin.OUT)
red = Pin(RED_PIN, Pin.OUT)
states = ["OFFLINE", "NORMAL", "BUSY", "FAULT"]
state_index = 0
last_button_state = 0
press_start_ms = 0
def show_state(index):
state = states[index]
green.value(1 if state == "NORMAL" else 0)
yellow.value(1 if state == "BUSY" else 0)
red.value(1 if state == "FAULT" else 0)
if state == "OFFLINE":
green.off()
yellow.off()
red.off()
print("Remote display state:", state)
show_state(state_index)
print("Status remote display ready")
while True:
now = time.ticks_ms()
current = button.value()
if current == 1 and last_button_state == 0:
press_start_ms = now
elif current == 0 and last_button_state == 1:
press_length = time.ticks_diff(now, press_start_ms)
if press_length >= LONG_PRESS_MS:
state_index = 0
else:
state_index = (state_index + 1) % len(states)
show_state(state_index)
last_button_state = current
time.sleep_ms(50)
How the Code Works
| Code Section | What It Does | Why It Matters | What to Modify During Testing |
|---|---|---|---|
| State list | Stores the ordered status labels used by the panel | A remote display is only useful if the status meaning stays consistent | Change the labels only if the LED mapping and documentation change too |
| Button timing | Measures short and long presses to support cycling and reset | One button can support more than one action when timing is used carefully | Adjust LONG_PRESS_MS if users keep triggering the wrong action |
| show_state | Turns on the correct LED pattern and prints the matching label | The visual state and the reported state must always agree | Change the LED mapping only inside this helper if the hardware colors change |
| Main loop | Handles button events and updates the panel state | This creates a stable local interface that could later receive real remote updates | Keep the debounce delay unless you confirm the hardware is perfectly stable |
Expected Result
The serial monitor reports the current reading or state clearly.
The hardware output responds when the decision logic changes state.
Subsystem behavior matches the thresholds, timing, or rules described in the document.
Validation Checks
- Normal condition test: confirm the system stays in its safe or idle state under baseline conditions
- Warning condition test: move the input close to the chosen threshold and confirm the transition is sensible
- Critical condition test: trigger the strongest alert or control state and confirm the output response is correct
- Calibration test: compare the sensor or timing against a known reference or repeated trial
- Limitation test: deliberately create an awkward or noisy condition and note how the prototype behaves
Deployment and Limitations
- This prototype is useful for local indicator boards and classroom control panels
- Before deployment, labeling, enclosure design, and user training need improvement
- Status tools only work well when users trust the meaning of each state and keep the system updated
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| States skip unexpectedly | Button bounce or accidental long presses are occurring | Keep the debounce delay and adjust LONG_PRESS_MS after testing with real users |
| Wrong LED color represents the state | LED wiring does not match the intended status map | Recheck which GPIO pin drives each LED |
| Button does nothing | The button is not pulling GPIO 14 high when pressed | Print the button state and rewire the button between 3.3V and GPIO 14 |
| Users misread the panel | The meaning of each color is not obvious | Add labels or a printed legend next to the LEDs |





