Skip to content
Stephen Julian edited this page Feb 2, 2022 · 79 revisions

QR Code Scanning Kiosk Wiki

Introduction

This wiki summarises the development of a Cloud-connected QR Code Scanning Kiosk suitable for use in Retail Customer Loyalty Programmes and other applications. An Arduino MKR WiFi 1010 microcontroller was paired with a SparkFun QR Code Reader module scans barcodes and QR codes and uploads the scanned data to AWS IoT Core.

Motivation

Use cases and applications of the proposed QR Code Scanning Kiosk and potential variants include:

  • Customer loyalty programmes
  • Identity verification and access control
  • Retail payment and promotion services

Requirements

The purpose of this project was to build prototype versions of an electronic device designed for use by vendors in restaurants, cafés and the wider hospitality industry to connect customers' loyalty cards and/or mobile apps with the digital infrastructure of the vendor. Use cases may extend to include many types of retail stores in general.

Research

Devices that scan barcodes, QR codes and/or NFC tags have been found during research activities. Some devices enable the user to use their smartphone to scan barcodes, QR codes or NFC tags. Mobile apps are available that add this functionality to the smartphone in a user-centric and vendor controlled way.

QR Code Scanning Kiosk - Project Poster

Methodology

Rapid prototyping and incremental development with an Agile approach.

QR Code Scanning Kiosk - Series of Rapid Progressive Prototypes

Prototype V1: Breadboard Circuit

QR Code Scanning Kiosk Prototype V1 - Breadboard Circuit Schematic

QR Code Scanning Kiosk Prototype V1 - Breadboard Circuit Arrangement

Prototype V2: Add Adapter PCB (V1), LCD PCB

Prototype V3: Upgrade MCU, PCB, Add Lipo Battery, RTC, NTP

QR Code Scanning Kiosk Prototype V3 - Custom Adapter PCB (V2)

QR Code Scanning Kiosk Prototype V3 - Custom Adapter PCB (V2)

Prototype V4: Add BearSSL, MQTT, AWS IoT Core

QR Code Scanning Kiosk Prototype V4 - MQTT messaging with AWS IoT Core server

Prototype V5: Future Goals

While Prototype V5 has not been fully implemented, some planning and preparation has already taken place.

Prototype V2 introduced a PCB Breakout Board (BOB) for modules to interface with and components to be soldered to. The LCD module was connected and tested via programmatically writing some very simple output to the display via the serial data link from the Arduino MKR WiFi 1010 microcontroller. However, a Graphical User Interface (GUI) is still undeveloped.

Primary objectives for Prototype V5 include:

  1. Produce a revised design iteration of the component adapter board (PCB V3) to include circuit design optimisation and repositioning of components and headers for more efficient use of available space on the PCB and future enclosure.
  2. Display custom status messages on the LCD display triggered by PIR motion sensor activation and QR code scanning.

Further stretch goals include:

  1. Design, implement and test an interactive touchscreen GUI for the LCD. This can be for the user to customise options for collecting their loyalty reward.
  2. Design and 3D print an enclosure to protect and house the assembled device.
  3. Larger PCB surface area.
  4. Larger battery storage surface area enables larger capacity LiPo battery.
  5. DC-IN 5.5mm Barrel connector
  6. DC-DC buck voltage regulator (up to 30V IN, regulated 5V @ <3A OUT)
  7. In-line self resetting power supply fuse on voltage regulator output (6V/3A)
  8. Remove redundant micro-USB power cable.
  9. Remove cabling for connecting RGB LED and PIR motion sensor as they now instead interface directly with SMD female pin headers.
  10. Add to PCB a DHT-12 Thermistor (Temperature and Humidity Sensor) for the purpose of proactively monitoring the internal environment of the enclosure.
  11. Add to PCB a 9-pin female header for interfacing an NFC read/write module.

Cloud Services List

"AWS IoT is a managed cloud platform that lets connected devices - cars, light bulbs, sensor grids, and more - easily and securely interact with cloud applications and other devices." - AWS

To implement RTC, NTP & MQTT messaging between the MCU and AWS IoT:

  1. Generate a Certificate Signing Request (CSR) on MCU using a configuration script.
  2. Upload the CSR to AWS IoT Core to generate a certificate.
  3. Save the certificate to disk and insert into the MCU configuration firmware.
  4. Save the AWS certificate to disk and insert into the MCU configuration firmware.
  5. For encryption certificates to work the device needs to keep accurate time and date. Code the firmware sketch to synchronise the DS3231 RTC with a reliable and accurate NTP server at boot time and again periodically to minimise drift effects and maintain high accuracy. The server chosen for this project was a Google public NTP server.
  6. The ArduinoBearSSL library is required to be configured in the device firmware.
  7. In AWS IoT Core a “Thing” representing the device is required to be configured and with the appropriate certificate and configured access policy attached.
  8. AWS DynamoDB is a highly scalable and robust NoSQL database. For Prototype V4 a database table was created in AWS DynamoDB and designed to accept the name/value data pairs uploaded by the device to AWS IoT Core. AWS IoT Core does not store messages historically and so DynamoDB takes on the role of enabling highly robust persistent message storage in the AWS Cloud.

Integrations List

**Connectivity with Cloud Services including:

  1. Microsoft Azure
  2. Google Cloud
  3. AWS Cloud
  4. Arduino Cloud**

Changes List

N/A

Wish List

**Potential options for improvement:

  1. Upgrade Touchscreen
  2. Add NFC Tag Scanning Module
  3. Improve Battery Heat Dissipation
  4. Additional Connectivity Options
  5. Single Board PCB
  6. Suitable Enclosure**

Shopping List

Starting List

Before starting, read the original Project Report to access more complete documentation than this Wiki otherwise provides.

Testing List

Functional testing of messaging between the device and AWS IoT Core was mostly successful. However, it was discovered that when two successive message events occur very close together occasionally the latter message would arrive at the server before the earlier message. This advocates a resolution by time stamping messages at the device rather than after they are received at the server so as to enable correct time sorted ordering of messages when they are to be inserted into a database table.

Conclusion

The purpose of this project was to build prototype versions of an electronic device designed for use by vendors in the restaurants, cafés and hospitality industry to connect customers’ loyalty cards and/or mobile apps with the digital infrastructure of the vendor. Use cases may extend to include many types of retail stores.

The focus of this project has been on developing device hardware and firmware while leaving the development of software applications outside of the project scope. The exceptions to this were the configuration of Cloud server infrastructure and security features to enable the device to exchange message traffic with an AWS IoT Core secure server. This successfully completes the work in developing multiple proof-of-concept prototype devices that demonstrate the potential of investing in building solutions with these kinds of technologies.

Resources

SparkFun(n.d.). SparkFun 2D Barcode Scanner Breakout - SEN-18088. Retrieved from

https://www.sparkfun.com/products/18088

SparkFun(n.d.). 2D Barcode Scanner Breakout Hookup Guide. Retrieved from

https://learn.sparkfun.com/tutorials/2d-barcode-scanner-breakout-hookup-guide/all

SparkFun(2021). 2D Barcode Scanner Breakout. Retrieved from

https://github.com/sparkfun/2D_Barcode_Scanner_Breakout

Figures

All photographs, diagrams and screenshots are by the author unless otherwise indicated.

References

This project was originally completed by Stephen Julian in November 2021 as the capstone project of his Bachelor of Engineering Technology (Electrical) degree. This GitHub repository delivers on the intention to publish the project work under the MIT Licence. While this wiki provides a project summary, the complete original documentation is available in Adobe PDF format below:

Julian, Stephen (Nov 2021). QR Code Scanning Kiosk - MG7101 Project Slideshow. (Google Slides, 25 pages, 1 video)

Julian, Stephen (Nov 2021). QR Code Scanning Kiosk - MG7101 Project Presentation. (~10MB PDF, 25 pages)

Julian, Stephen (Nov 2021). QR Code Scanning Kiosk - MG7101 Project Final Report. (~110MB PDF, 118 pages)

Julian, Stephen (Nov 2021). QR Code Scanning Kiosk - MG7101 Project Poster. (~8MB PDF, 1 page)

Appendices

Appendix A: Arduino Files

Arduino Files. Retrieved from https://github.com/bizkiwi/qr-code-scanning-kiosk/tree/main/arduino-files

Appendix B: BOM Files

BOM Files. Retrieved from https://github.com/bizkiwi/qr-code-scanning-kiosk/tree/main/bom-files

Appendix C: Gerber Files

Gerber Files. Retrieved from https://github.com/bizkiwi/qr-code-scanning-kiosk/tree/main/gerber-files

Appendix D: Schematic Files

Schematic Files. Retrieved from https://github.com/bizkiwi/qr-code-scanning-kiosk/tree/main/schematic-files

Appendix E: Pick and Place Files

Pick and Place Files. Retrieved from https://github.com/bizkiwi/qr-code-scanning-kiosk/tree/main/pickandplace-files