Enigma QR Clock skips mask selection to display seconds on an Arduino Uno

Arduino, QR clock, TFT

This is the read-only HTML version. For the full Visual Space experience, open the app.

Arduino Uno, LCD, QR code — Im

Arduino Uno, LCD, QR code — Im

Source: Enigma QR Clock on Hackaday.io · Arduino Enigma

QR generation, display speed

A six-second QR generation time left this Arduino clock unable to show seconds. A fixed mask, faster TFT drawing and selective pixel updates made that possible—while a later color-inversion option addressed reported scanning trouble.

👍 1
👀 1

A clock that displays time as a QR code has two jobs: generate a readable code and get it onto the screen before the time changes again. Arduino Enigma’s Enigma QR Clock on Hackaday.io, created on July 24, 2016, tackles that problem with an Arduino Uno and an LCD touchscreen. The interesting part is how it trims work from both code generation and screen drawing to make seconds practical.

A fixed mask removes the slow search

The project began by porting a QR generation library to the Uno and Seeed LCD touchscreen platform. According to the project description, generating a code initially took six seconds—too long to produce a fresh representation of the time every second.

The key change came from a suggestion credited to ch00ftech: stop searching for the optimal QR mask and use a fixed one instead. Arduino Enigma reports that this brought generation time below one second.

That distinction matters: the clock doesn’t eliminate masking; it eliminates the work of choosing a mask for each new code. It trades that optimization step for speed. The reported timing demonstrates the benefit for generation, though it isn’t a measurement of the complete generate-and-display cycle.

Drawing less makes room for seconds

Getting the code ready was only part of the problem. The project also adopted a fast TFT display library credited to Xark, which Arduino Enigma says allowed seconds to be displayed.

The library was adapted to follow the Seeed library’s calling conventions, making it a drop-in replacement for an existing sketch. A compiler directive also lets it control an Adafruit LCD. Those changes keep the speed improvement usable without requiring the sketch to adopt a different drawing interface.

A further optimization saves the previous QR code as a bitmap and paints only pixels that change. Instead of treating every tick as a completely new screen, the clock uses the last frame to decide what work is necessary. That’s a separate saving from faster QR generation: one reduces computation, while the other reduces drawing.

The creator links both the Enigma QR Clock code and the modified TFT library for builders who want to examine those changes.

A fast code still needs to scan

A September 30, 2016 update added an i command to invert the QR code’s colors. The creator reported that some apps might not decode the default background, while explicitly leaving that report uncertain. The inversion option is a documented addition, not proof of compatibility with every scanner.

The useful lesson is that a once-per-second display has several budgets to meet. This project cuts the search work, speeds up the drawing routine and avoids repainting unchanged pixels. For anyone adapting it, the next check is end-to-end: can the chosen display render each new code promptly, and can the intended scanner reliably read it?

Source: Enigma QR Clock

Hardware

3 Followers

A workshop for electronics and physical computing. Share circuits, boards, tools and prototypes; work through measurement and debugging, compare components, and document the choices that turn an idea into working hardware.

Visual Space is built for projects like this—where creators collaborate, organize goals, and grow communities around real work.