MakerLab
Raspberry PiRaspberry Pi 400

Raspberry Pi 400: The Complete MakerLab Reference

A powerful single-board computer integrated into a compact keyboard, perfect for learning, coding, and prototyping.

Raspberry Pi 400

The Raspberry Pi 400 is a unique and versatile single-board computer built directly into a compact, retro-style keyboard. Released in late 2020, it reimagines the classic personal computer experience for a new generation of makers, students, and hobbyists. It integrates a Raspberry Pi 4 Model B into the keyboard's PCB, offering a familiar and accessible computing platform without the need for external peripherals beyond a mouse and display.

At its heart, the Raspberry Pi 400 is powered by the Broadcom BCM2711 system-on-a-chip (SoC), the same powerful quad-core ARM Cortex-A72 processor found in the Raspberry Pi 4. This SoC provides significant processing power, making the Pi 400 suitable for a wide range of tasks, from web browsing and document editing to more demanding applications like light programming, media playback, and even some light gaming. The integration into a keyboard form factor simplifies setup and reduces clutter, making it an ideal choice for educational settings or as a primary desktop replacement for basic computing needs.

Compared to other Raspberry Pi boards, the Pi 400 offers a more complete, out-of-the-box computing experience. While boards like the Raspberry Pi Pico are microcontrollers focused on embedded projects, and the standard Raspberry Pi 4 is a bare board requiring a separate case and keyboard, the Pi 400 is a self-contained unit. This makes it less ideal for deeply embedded projects requiring minimal footprint or extreme environmental resilience, but perfect for users who want a capable, general-purpose computer that can also be used for learning about electronics and programming through its accessible GPIO pins.

The target audience for the Raspberry Pi 400 includes students learning to code, aspiring developers, educators, and makers who want a single device that can serve as both a learning tool and a functional computer. Its plug-and-play nature, coupled with the vast ecosystem of Raspberry Pi software and accessories, makes it an excellent entry point into the world of computing and embedded systems. The integrated design also adds a layer of durability and convenience, reducing the number of separate components to manage.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCBroadcom BCM2711
Architecture64-bit Quad-core ARM Cortex-A72
Clock speed1.8 GHz (overclocked from 1.5 GHz on standard Pi 4)
Flash / StorageMicroSD card slot (OS and storage)
RAM / SRAM4GB LPDDR4-3200 SDRAM
Operating voltage5V DC (via USB-C)
Digital I/O pins40-pin GPIO header (standard Raspberry Pi header)
Analog / ADCโ€”
PWMYes (via software/GPIO)
ConnectivityGigabit Ethernet, Dual-band 802.11ac Wi-Fi, Bluetooth 5.0
USB2x USB 3.0, 2x USB 2.0
Power input5V DC, 3A via USB-C connector
Dimensions245 mm ร— 176 mm ร— 35 mm (keyboard unit)

Pinout & pin functions

PinFunction
3.3VPower output (3.3V)
5VPower output (5V)
GNDGround
GPIO17General Purpose Input/Output
GPIO18General Purpose Input/Output, PWM0
GPIO27General Purpose Input/Output
GPIO22General Purpose Input/Output
GPIO23General Purpose Input/Output, SPI1 MOSI
GPIO24General Purpose Input/Output, SPI1 MISO
GPIO25General Purpose Input/Output, SPI1 SCK
GPIO10General Purpose Input/Output, SPI1 CE0
GPIO9General Purpose Input/Output, SPI1 CE1
GNDGround
GPIO11General Purpose Input/Output, SPI0 SCK
GPIO5General Purpose Input/Output, I2C1 SCL
GPIO6General Purpose Input/Output, I2C1 SDA
GPIO13General Purpose Input/Output, PWM1
GPIO19General Purpose Input/Output, PWM0
GPIO26General Purpose Input/Output
GPIO7General Purpose Input/Output, SPI0 MOSI
GPIO8General Purpose Input/Output, SPI0 MISO
GNDGround
GPIO12General Purpose Input/Output, PWM0
GPIO16General Purpose Input/Output
GPIO20General Purpose Input/Output, I2C1 SDA
GPIO21General Purpose Input/Output, I2C1 SCL
GPIO28General Purpose Input/Output
GPIO29General Purpose Input/Output
GPIO30General Purpose Input/Output
GPIO31General Purpose Input/Output
GNDGround
GPIO0General Purpose Input/Output
GPIO1General Purpose Input/Output, I2C0 SDA
GPIO2General Purpose Input/Output, I2C0 SCL
GPIO3General Purpose Input/Output, I2C0 SDA
GPIO4General Purpose Input/Output
GPIO14General Purpose Input/Output, UART0 TXD
GPIO15General Purpose Input/Output, UART0 RXD
GPIO17General Purpose Input/Output
3.3VPower output (3.3V)
GNDGround
5VPower output (5V)

Wiring & circuit basics

Powering the Raspberry Pi 400 is straightforward via its USB-C port, which requires a stable 5V DC supply capable of delivering at least 3A. Using the official Raspberry Pi 400 PSU or a comparable high-quality USB-C power adapter is highly recommended to prevent undervoltage issues that can lead to instability or data corruption. The board itself incorporates voltage regulation for its internal components, but external peripherals connected to the GPIO header operate at 3.3V logic levels. It is crucial to use level shifters if interfacing with 5V components to avoid damaging the Pi.

Connecting components to the GPIO header requires careful attention to pin functions. For example, to blink an LED, you would connect the LED's anode (longer leg) to a 3.3V pin (like GPIO17), then connect the LED's cathode (shorter leg) through a current-limiting resistor (typically 220-330 ohms) to a ground (GND) pin. The resistor prevents excessive current from flowing through the LED and the GPIO pin, protecting both.

For more complex sensors, like an I2C sensor (e.g., a BME280 environmental sensor), you would connect its VCC pin to a 3.3V pin on the Pi 400, its GND pin to a GND pin, its SDA pin to GPIO6 (or GPIO20), and its SCL pin to GPIO5 (or GPIO21). These specific GPIO pins are part of the I2C bus, allowing the Pi to communicate with the sensor using the I2C protocol. Always consult the sensor's datasheet and the Raspberry Pi 400 pinout diagram to ensure correct connections.

Programming & getting started

The Raspberry Pi 400, running Raspberry Pi OS (a Debian-based Linux distribution), is primarily programmed using standard Linux development tools and scripting languages. For embedded-style projects utilizing the GPIO pins, Python is the most popular choice, often using libraries like RPi.GPIO or gpiozero. You can write Python scripts directly on the Pi 400 using editors like Thonny or Geany, and run them from the terminal. For more advanced users, C/C++ with libraries like wiringPi (though deprecated, still functional) or libgpiod can be used.

To upload your first program (e.g., a Python script to blink an LED), ensure your Raspberry Pi 400 is set up with Raspberry Pi OS and connected to the internet. Open a terminal window, navigate to the directory where you saved your script (e.g., `cd Desktop`), and execute it using `python your_script_name.py`. For example, a simple script to toggle GPIO17 would involve importing the `RPi.GPIO` library, setting the pin mode, and then using `GPIO.output(17, GPIO.HIGH)` and `GPIO.output(17, GPIO.LOW)` within a loop.

Project ideas

Retro Gaming ConsoleTransform your Pi 400 into a retro gaming machine using emulators like RetroPie. This project utilizes the board's processing power and keyboard input, learning about software configuration and emulation.
Home Automation HubBuild a central hub for smart home devices using Python scripts and GPIO. Control relays for lights or read sensors (temperature, humidity) connected to the GPIO pins, learning about I/O control and network communication.
Weather StationConnect sensors like a DHT22 (temperature/humidity) or BMP280 (pressure) to the GPIO pins and log data to a file or cloud service. This project teaches I2C/1-Wire communication and data logging.
Network Attached Storage (NAS)Connect an external USB hard drive and configure Samba to share files over your network. This leverages the Pi 400's USB 3.0 ports and Gigabit Ethernet for a practical home server project.
Robotics ControllerUse the GPIO pins to control servo motors and DC motors via motor driver boards. Program movement sequences in Python, learning about motor control, PWM, and basic robotics principles.
Custom Keyboard MacrosProgram custom keyboard shortcuts and macros using Python scripts that interact with the operating system. This project explores the integration of hardware and software for productivity enhancements.

Buying tips & gotchas

When purchasing a Raspberry Pi 400, consider buying it as part of a kit that includes a mouse, power supply, and MicroSD card pre-loaded with Raspberry Pi OS, as this offers the best value and a seamless setup experience. Be aware that while the Pi 400 has a standard 40-pin GPIO header, it lacks the built-in analog-to-digital converter (ADC) found on some other microcontrollers; you'll need an external ADC chip for analog input. Avoid using generic, low-quality USB-C power supplies, as insufficient power can cause unpredictable behavior. Ensure any HATs (Hardware Attached on Top) or expansion boards are compatible with the Raspberry Pi 400's form factor and pinout.