Worst Clock Ever Teaches You QR Codes

[WhiskeyTangoHotel] wrote in with his newest clock build — and he did warn us that it was minimalist and maybe less than useful. Indeed, it is nothing more than a super-cheap ESP32-C3 breakout board with an OLED screen and some code. Worse, you can’t even tell the time on it without pointing your cell phone at the QR code it generates. Plot twist: you skip the QR code and check the time on your phone.

But then we got to thinking, and there is actually a lot to learn from here on the software side. This thing pulls the time down from an NTP server, formats it into a nice human-readable string using strftime, throws that string into a QR code that’s generated on the fly, and then pushes the bits out to the screen. All in a handful of lines of code.

As always, the secret is in the libraries and how you use them, and we wanted to check out the QR code generator, but we couldn’t find an exact match for QRCodeGenerator.h. Probably the most popular library is the Arduino QRCode library by [ricmoo]. It’s bundled with Arduino, but labelled version 0.0.1, which we find a little bit modest given how widely it’s used. It also hasn’t been updated in eight years: proof that it just works?

That library drew from [nayuki]’s fantastically documented multi-language QR-Code-generator library, which should have you covered on any platform you can imagine, with additional third-party ports to languages you haven’t even heard of. That’s where we’d go for a non-Arduino project.

What library did [WTH] use? We hope to find out soon, but at least we found a couple good candidates, and it appears to be a version of one or the other.

We’ve seen a lot of projects where the hacker generates a QR code using some online tool, packs the bits into a C header array, and displays that. That’s fine when you only need a single static QR code, but absolutely limiting when you want to make something dynamic. You know, like an unreadable clock.

You will not be surprised to know that this isn’t the first unreadable QR-code clock we’ve featured here. But it’s definitely the smallest and most instructive.

7 thoughts on “Worst Clock Ever Teaches You QR Codes

    1. Thanks to Google Chrome, we’re all conditioned to think that version numbers must be at least 3 digits and increment on a near-daily basis!

      This is a neat design, though, and has planted a seed in my own imagination… 🤔

  1. Now this is a really neat spin on the usual clock builds here. This is a real surprise. The display could be bigger but I think it is cool. One suggestion for fun…If you made it into a wall clock you might want it to slip in occasionally the QR code for “Rick Roll”. One thing though QR’s have a bad rap due to the stickers that send people to fake or hacking websites. My favorite though is the TV employment ad that the announcer says ” to apply for a position just scan the QR code on the screen”…like someone is so desperate they are going to get off their arse to scan a code on a TV screen.

  2. This reminds me of those watches in the ’80-ies and ’90-ies that got data (such as appointments) out of a PC by holding it in front of a few blinking pixels on your monitor.

    The shaky out of focus video is quite horrible though.

    Can you also play checkers on a QR code board?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.