Useful Sensors' Tiny Code Reader Is a Privacy-Centric Low-Cost Scanner for 2D QR Codes

Now available for just $7, this camera-based QR code scanner does everything on-device — and keeps the image data locked away.

Useful Sensors, a company which aims to deliver exactly what it sounds like using devices with integrated machine learning capabilities, has launched the follow-up for its Person Sensor: the Tiny Code Reader, a compact camera board designed exclusively for decoding 2D QR codes.

"The Tiny Code Reader [is] a small, low-cost hardware module that reads QR codes," Useful Sensors' co-founder and chief executive officer Pete Warden explains. "It's designed to be a simple way to provision a system, for example by providing the Wi-Fi network name and password, or to provide input when there's no keyboard. Internally the Tiny Code Reader bundles an image sensor and a small microcontroller into a single board, but to make it as easy as possible to build into products we've tried to hide those implementation details."

That is, of course, the secret behind the company's approach to sensor technology: rather than a bare sensor which offloads the work of processing an incoming signal into usable data, it's an all-in-one device with an on-board Raspberry Pi RP2040 microcontroller running a custom tinyML QR code-decoding model which ships the data to a host already-processed — in this case, the decoded QR code data — over an I2C connection.

The compact board uses a Qwiic/STEMMA QT-compatible connector and expects 3.3V power, with support for bitrates up to 400k baud. For those looking to use it in a non-Qwiic-compatible creation, there are also unpopulated 0.1" pin headers — which can be snapped off, interestingly, to reduce the footprint of the board if they're not required. There's no illumination on-board, though its creators say that there's no infrared filter included over the sensor — meaning it should be possible to light up a target QR code with visible or infrared light, depending on your needs.

"With the sensor powered, bring up a simple QR code on your phone and place it about fifteen centimeters or six inches in front of the module, facing the camera," Warden writes of the sensor's operation. "You should see the LED on the front of the board rapidly flashing blue, and then turn green when the QR code is detected. It may take a bit of wiggling and moving back and forth to get a detection. [The decoded] data is a 16-bit unsigned integer containing the length of the read QR code content, followed by the content itself in a 254 byte array."

There are some restrictions to the device, however — implemented, Warden claims, in the name of privacy. "We’ve designed the module so that it is as resistant as possible to anyone accessing the raw image data, and only the metadata derived from each frame is available," he explains. "This approach does constrain what developers can do with the device."

"One obvious restriction," Warden continues, "is that we don’t allow you to access the image data, but we also don’t support flashing the firmware or model updating, because doing so could allow unchecked changes to the sensor’s behavior. Even though there’s a microcontroller on the board, we’re hoping that you’ll be able to get enough value out of its pre-programmed behavior to compensate for the inconvenience of this user protection approach."

More information on the sensor is available on the Useful Sensors' GitHub repository, along with code examples in Arduino-flavored C, MicroPython, and CircuitPython, as well as device-specific examples for the Raspberry Pi Pico, BBC micro:bit, and Pimoroni Badger 2040. The sensors themselves are now available to buy on Adafruit, priced at $7 with a maximum of two units per customer.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles