Embedded Displays & User Interfaces

ReviewedIntermediate MakerAbout 5 min
BME280
In short

Embedded Displays & User Interfaces: the short answer

A small display turns your project into something people can read without a laptop. Common choices: SSD1306 OLED (128×64, sharp, I²C, two wires), 1602 character LCD (two lines of text, often with an I²C backpack), TM1637 (four 7-segment digits for clocks and counters) and ILI9341 TFT (colour, SPI, more pins and memory).

Level
Intermediate
Time
About 5 min
Topic
Sensors and actuators
You will learn to

Choose and wire a small display for readings and status.

A small display turns your project into something people can read without a laptop. Common choices: SSD1306 OLED (128×64, sharp, I²C, two wires), 1602 character LCD (two lines of text, often with an I²C backpack), TM1637 (four 7-segment digits for clocks and counters) and ILI9341 TFT (colour, SPI, more pins and memory).

Design the screen before coding it. Put the most important number biggest. Always show units. Show when the value was last updated, and show a clear message when a sensor fails or Wi-Fi drops, instead of a frozen or zero value.

Redraw only when something changes, or a few times per second at most. Clearing and redrawing everything in a fast loop causes flicker.

Matching the display to the job

A 128×64 OLED is sharp and uses very little power, but burns in if one image stays on for months. A 1602 character LCD is cheap, readable in daylight and easy to program, but it only shows two lines of text. Seven-segment displays are bright and readable from across a room, and suit numbers and clocks. Colour TFT screens show graphs and icons but need more pins, memory and effort.

Think about where it will be read: in sunlight an OLED can be hard to see, in a dark room a backlit LCD may glare. Pick by reading distance, light and the information to show.

Layout that people can read

Keep the biggest text for the one value people care about, and smaller text for the detail. Align numbers to the right so digits line up, and keep a fixed position for each item so the screen does not shift when a value changes length. Show units and a small label next to every number.

Show state clearly: a connected symbol, a low battery warning, an error message such as "Sensor not found". A screen that freezes on the last good value is worse than one that says something is wrong.

Updating without flicker

Redrawing the whole screen takes time and causes flicker. Draw only what has changed: for a number, clear just its small rectangle and write the new text. Libraries with a frame buffer (such as U8g2 for OLEDs) draw into memory, then send it all at once. Update a few times a second at most, which is plenty for a reading that changes slowly.

Avoid delay() in the loop that refreshes the screen. Use millis() so buttons and sensors keep working while the display updates.

I²C and SPI displays in practice

An I²C OLED needs two data wires and uses an address such as 0x3C. If nothing appears, run an I²C scanner, check the address and the power pins, and check that the library is set for the right controller (SSD1306 or SH1106, which look the same but need different code). A TFT on SPI needs the right chip-select, data/command and reset pins in the library's setup, and level shifting if it is a 5 V module on a 3.3 V board.

Common mistakes
  • Clearing the whole screen in every pass of loop().
  • Showing a number with no unit, or a stale value after a sensor fails.
  • Choosing an SH1106 library for an SSD1306 screen, or the other way round.
Intermediate lesson · Maker plan

Practise this lesson with Maker

The explanation above is free for everyone. The practice for Intermediate lessons in every domain are part of the Maker plan at ₹499 a month, and Pro includes them too.

With Maker you also get: a worked example, a hands-on task, a 3-question check.

Common questions

What will I learn in "Embedded Displays & User Interfaces"?

Choose and wire a small display for readings and status.