Projects / Pi 400 learning desk

Pi 400 learning desk

Beginner1.5 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. Pi 4RASPBERRRASPBERRRASPBERR

    Flash the SD card

    With Raspberry Pi Imager.

  2. Pi 4

    Boot the Pi 400

    Complete the welcome wizard.

  3. Pi 4

    Update

    sudo apt update and upgrade.

  4. Pi 4RASPBERR

    Attach the T-cobbler

    Pi off, red stripe to pin 1.

  5. Pi 4RASPBERR19.1 mA

    Build the LED and button

    On the breadboard.

  6. Pi 419.1 mA

    Run a blink program

    Check the LED first.

  7. Pi 4

    Run the reaction game

    Save and run.

  8. Pi 4

    Improve it

    Add scores or a best time.

In short

How do you build a pi 400 learning desk?

Turn a Pi 400 into a first computer for coding, with a GPIO breadboard kit, an LED and a button for a reaction-time game. You need Raspberry Pi 400, Raspberry Pi breadboard kit (T-cobbler, 830 board), Raspberry Pi 15 W USB-C power supply, Raspberry Pi micro-HDMI to HDMI cable, LED 5 mm red, Resistor 330 Ω, Tactile push button 6 mm and SanDisk microSD card 32 GB (A1, Class 10). It takes 8 steps and about 90 minutes.

Level
Beginner
Time
About 90 min
Parts
8

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Pi 400 GPIO headerT-cobbler ribbon cable to the breadboard (keep the red stripe on pin 1)GPIO breakout
LED anodeCobbler GPIO17 through 330 Ω, cathode to the cobbler GNDOutput
ButtonCobbler GPIO27 on one side, GND on the otherInput, uses the internal pull-up
Power supplyPi 400 USB-C portUse the official 15 W supply
HDMIPi 400 micro HDMI port nearest the USB-C (HDMI0)Screen

Code

The Pi 400 is a Raspberry Pi 4 built into a keyboard, so you only add a mouse, a screen, power and a card. Flash Raspberry Pi OS (Bookworm or newer) to the card with Raspberry Pi Imager, choose a username and a strong password in the settings, and boot. Open Thonny from the menu to write Python. With the Pi switched off, connect the ribbon cable of the T-cobbler kit to the 40-pin header with the red stripe towards pin 1, then wire the circuit on the breadboard. Switch on, type the program in Thonny, save it as reaction_game.py and run it. The built-in pull-up means the button needs only two wires and no resistor. Each GPIO pin gives a few milliamps, so the LED always needs its 330 ohm resistor. Once it works, change the delay range, keep the best score, or flash the LED three times at the start. Switch off before changing wires.

# reaction_game.py: press the button as fast as you can when the LED lights
from gpiozero import LED, Button
from time import sleep, time
import random

led = LED(17)
button = Button(27)     # pressed reads as True, the pull-up is built in

print("Reaction game: hold still, press the button when the LED lights.")
while True:
    led.off()
    sleep(random.uniform(2, 5))
    if button.is_pressed:
        print("Too early! Let go of the button first.")
        continue
    led.on()
    start = time()
    button.wait_for_press()
    ms = (time() - start) * 1000
    led.off()
    print(f"Reaction time: {ms:.0f} ms")
    sleep(1.5)

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Boot the PiDesktop appears
Run a one-line blinkLED toggles
Start the gamePrompt appears
Press the button before the LEDToo early message
Press after the LED lightsReaction time in ms

If it does not work

No picture

Use the HDMI port next to the USB-C and check the cable.

LED never lights

Flip the LED, check the 330 Ω and the GPIO number.

Button seems stuck

Wires on the wrong side; one leg to GPIO27, the other to GND.

Ribbon cable fits two ways

Red stripe must be at pin 1.

ModuleNotFoundError

gpiozero is preinstalled; check you use python3.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the pi 400 learning desk?

Raspberry Pi 400, Raspberry Pi breadboard kit (T-cobbler, 830 board), Raspberry Pi 15 W USB-C power supply, Raspberry Pi micro-HDMI to HDMI cable, LED 5 mm red, Resistor 330 Ω, Tactile push button 6 mm and SanDisk microSD card 32 GB (A1, Class 10).

How long does the pi 400 learning desk take to build?

About 90 minutes for a beginner maker, in 8 steps.

How do I know the pi 400 learning desk works?

Boot the Pi: Desktop appears. Run a one-line blink: LED toggles. Start the game: Prompt appears.

No picture: what should I check?

Use the HDMI port next to the USB-C and check the cable.

LED never lights: what should I check?

Flip the LED, check the 330 Ω and the GPIO number.

Button seems stuck: what should I check?

Wires on the wrong side; one leg to GPIO27, the other to GND.

Ribbon cable fits two ways: what should I check?

Red stripe must be at pin 1.