

The Hyperpixel XP Square Touch 4.0 is a high-resolution touchscreen display designed specifically for Raspberry Pi. With its unique 4-inch square form factor, vibrant color reproduction, and multi-touch capabilities, this display is ideal for interactive projects, graphical interfaces, and compact applications requiring precise touch input. Its plug-and-play design ensures seamless integration with Raspberry Pi boards, making it a popular choice for hobbyists and professionals alike.








The following table outlines the key technical details of the Hyperpixel XP Square Touch 4.0:
| Specification | Details |
|---|---|
| Manufacturer | Hyperpixel |
| Part ID | 4.0 Square Touch |
| Display Size | 4 inches (square form factor) |
| Resolution | 720 x 720 pixels |
| Touch Technology | Capacitive multi-touch (up to 10 touch points) |
| Color Depth | 18-bit (262,144 colors) |
| Viewing Angle | 160° wide viewing angle |
| Interface | DPI (Display Parallel Interface) and I2C for touch input |
| Power Supply | 5V (via Raspberry Pi GPIO header) |
| Backlight | Adjustable brightness via software control |
| Dimensions | 76.2mm x 76.2mm x 10mm |
| Compatibility | Raspberry Pi models with a 40-pin GPIO header (e.g., Pi 4, Pi 3, Pi Zero) |
The Hyperpixel XP Square Touch 4.0 connects directly to the Raspberry Pi's 40-pin GPIO header. Below is the pin configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | 3.3V | Power supply for the display |
| 2 | 5V | Main power supply for the display and backlight |
| 3 | SDA (I2C) | I2C data line for touch input |
| 5 | SCL (I2C) | I2C clock line for touch input |
| 7 | DPI Data | Display Parallel Interface data line |
| 9 | GND | Ground connection |
| 11 | DPI Control | DPI control signal |
| 13 | DPI Clock | DPI clock signal |
| 15 | Backlight Control | PWM signal for backlight brightness adjustment |
Note: The remaining GPIO pins are used internally by the display and should not be connected to other components.
curl -sSL https://get.pimoroni.com/hyperpixel4 | bash
The Hyperpixel XP Square Touch 4.0 supports Python for touch input and display control. Below is an example script to detect touch events:
import evdev from evdev import InputDevice, categorize, ecodes
touchscreen = InputDevice('/dev/input/event0')
print("Touchscreen is ready. Touch the display to see events.")
for event in touchscreen.read_loop(): if event.type == ecodes.EV_ABS: # Categorize the event to extract details absevent = categorize(event) if event.code == ecodes.ABS_MT_POSITION_X: print(f"X Position: {event.value}") elif event.code == ecodes.ABS_MT_POSITION_Y: print(f"Y Position: {event.value}")
Display Not Turning On
Touch Input Not Working
Flickering or Dim Display
Incorrect Touch Coordinates
Q: Can I use the Hyperpixel XP Square Touch 4.0 with other single-board computers?
A: The display is designed specifically for Raspberry Pi models with a 40-pin GPIO header. Compatibility with other boards is not guaranteed.
Q: How do I adjust the backlight brightness?
A: You can control the backlight brightness using the pwm utility or through Python scripts.
Q: Is the display sunlight-readable?
A: The display is best suited for indoor use. For outdoor applications, additional shading may be required.
Q: Can I use the display in portrait mode?
A: Yes, the display orientation can be configured in the Raspberry Pi OS display settings or via the Hyperpixel driver.
This concludes the documentation for the Hyperpixel XP Square Touch 4.0. For further assistance, refer to the official Hyperpixel support resources.