Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
1.3-inch Raspberry Pi OLED display board with joystick and three buttons

Designing a Headless Raspberry Pi Menu with an OLED and Joystick

A small OLED can make a headless Raspberry Pi much easier to use. It can show whether a logger is recording, explain a connection problem and let someone change a setting without attaching a monitor. The challenge is fitting those tasks into a tiny screen without creating a confusing collection of button combinations.

Begin with the decisions the user needs to make, then assign the display and controls to those decisions. A simple, predictable interface usually feels more capable than one packed with rarely used features.

Confirm the display and controls as one hardware system

PMD Way's 1.3-inch OLED display pHAT combines a 128 × 64 monochrome screen, five-way mini joystick and three buttons. Its product page links to the corresponding Waveshare documentation. This makes it a useful example for a compact local control panel.

The Waveshare product reference identifies an SH1106 controller and a 3.3 V operating voltage. Use a driver intended for that controller and the board's configured interface; do not select an SSD1306 driver solely because the resolution matches.

Fit the board with power disconnected, checking header alignment and mechanical clearance. A 40-pin header shape does not establish compatibility between every example library, operating system and Raspberry Pi model. Verify the supplier's current software support for your combination before building the application around it.

Reserve the GPIO before adding other accessories

The display and buttons occupy more than a single communications bus. The manufacturer's HAT manual lists separate GPIO for joystick directions, centre press, three keys, display reset and data/command control.

For example, it assigns joystick up to BCM GPIO6 and the centre press to BCM GPIO13. Those are BCM signal numbers, not physical header positions. Keep the complete pin allocation beside your project schematic and compare it with other attached hardware before connecting both.

The board's interface selection involves its hardware configuration. Enabling I2C in software does not automatically reconfigure an SPI-wired display. Start from the documented default and a working manufacturer example before considering a change of interface.

Design the home screen around one primary question

For a data logger, the primary question might be “Is it recording?” Put that state in the most prominent position. Follow it with the information needed to interpret the state, such as the current file number or elapsed time. Move secondary details into a separate page.

Sketch the screen at its actual pixel dimensions. If an illustrative font occupies an 8 × 8 pixel cell, 128 × 64 pixels can hold at most 16 columns by eight rows before margins. Larger text and spacing reduce that capacity quickly. Choose short labels that remain understandable rather than shrinking everything until it barely fits.

Show units beside values and reserve room for an unavailable state. A missing temperature should display “No reading”, not a convincing zero. When a displayed value is old, show its age or a stale marker.

Give navigation a consistent grammar

Use up and down to move through a list, centre press to select, and one clearly assigned button to go back. Keep those meanings stable across pages. If left and right adjust a value, display the adjustment mode so an accidental sideways movement does not silently change a setting.

Example interface states for a small logger
State Screen content Expected action
Home Recording state and essential readings Select opens the menu.
Menu Short list with a visible selection Up/down moves; select enters.
Edit interval Working value and save/cancel choices Confirm saves; back discards.
Shutdown confirmation Clear consequence and default cancel A deliberate confirmation requests shutdown.

Keep the value being edited separate from the saved value. This makes cancellation meaningful. For a sampling interval, show the units throughout editing and reject values the application cannot support.

Turn switch activity into deliberate events

Mechanical controls can produce several electrical transitions during one action. Debouncing prevents these from becoming several menu movements. A held joystick direction also needs a policy: one movement per press, or an initial movement followed by controlled repeat.

GPIO Zero's input-device documentation distinguishes bounce compensation, hold duration and hold repetition. Those are separate behaviours. Choose values by testing the actual controls and intended users, and confirm the selected GPIO backend supports your Raspberry Pi.

Keep button handlers short. They should record an event or update interface state rather than wait for a slow network request. Otherwise the screen can appear frozen while the program is busy with something unrelated.

Separate the interface from the work

A logger's sampling and file-writing tasks should continue independently of menu redraws. Keep a small shared status record that the display reads: recording state, latest measurement, last successful write and any error. The interface presents that record without inventing success merely because a button was pressed.

For example, “Starting…” can follow a request to begin recording. Change it to “Recording” only after the recording process confirms that it has opened its destination successfully. If storage is unavailable, show a useful error and preserve a route back to the menu.

Redraw when content changes or at a sensible status interval. Constantly clearing the entire display can create distracting flicker and unnecessary work. Test readability from the actual enclosure viewing angle, not just directly above an open bench assembly.

Make shutdown a request with a visible consequence

Put shutdown behind a confirmation screen, with cancellation selected initially. Stop new application work, close files through the application's normal process, then request the operating system's orderly shutdown using the supported system mechanism.

The systemctl documentation describes systemctl poweroff as asynchronous: the request can return before shutdown finishes. Therefore a successful command return is not a reliable moment to tell the user to remove power. Use wording such as “Shutdown requested” and follow the particular Pi's documented completion indication.

The display board is not itself a power-disconnect controller. Do not assume an OLED going blank proves that every shutdown operation completed or that the hardware supply has been disconnected.

Test the awkward interactions

Try quick presses, long holds, cancelling an edit, an unavailable sensor and a failed storage operation. Restart the application and confirm it returns to a useful state. Ask someone unfamiliar with the project to perform its main task without verbal instructions.

When choosing among Raspberry Pi OLED displays, consider the controls and software path as carefully as the screen. A small interface succeeds when its state is clear, its actions are predictable and its messages describe what the system actually knows.

Previous article Battery Power for Arduino Projects: Voltage Range, Runtime and Regulator Heat