Raspberry Pi Generates QR Codes to Unlock Gates and Doors

Raspberry Pi
(Image credit: The IOT Project)

When it comes to home security, you can never be too diligent. That’s why a group of Polish students (Slawomir Sojka, Damian Prochaska, Jakub Ciemala, Nikodem Szlauer, Wojciech Droździk, and Hubert Wróblewski) put together this Raspberry Pi-powered QR code generating gate lock project, known as The IOT Lock, that creates custom codes for guests to unlock gates and doors. Instead of relying on a single PIN or password, each QR code is unique and can be disabled whenever you like.

For this project to be effective, the Raspberry Pi must be secured. Therefore, it logs each event so users can monitor activity and ensure the door or gate access is appropriately assigned. According to the team, the idea is to replace the usual lock and key system with something more digital and accessible via smartphone.

Users can generate QR codes to unlock the door or gate using a web or mobile application. They can send the QR code to whoever needs access to the lock. In addition, a QR scanner reads and identifies the codes, which will trigger the unlocking mechanism while logging the event in a database. It ensures that access is granted to who you want and that the activity is tracked.

Raspberry Pi

(Image credit: The IOT Project)

In the project's demonstration, the team uses a Raspberry Pi, a motion sensor, a CM2D QR scanner, a 12V relay, and an 8GB microSD card. Although, you can get away with changing a few components to suit your project needs. There are plans to update the system to be compatible with another microcontroller, the ESP32, to save money and add flexibility.

The system includes a web app with a graphic interface that makes it easy to adjust settings, generate QR codes, and act as an administrator over the gate access. You can even create teams of users to send QR codes and grant them access as a team rather than per user. Visit the official project page at GitHub to get a close look at the software used in the project.

If you want to recreate this Raspberry Pi project, check out the blog post on The IOT Project website for an in-depth look at how it goes together. You can also find a detailed look at its construction over at ElectroMaker.

Ash Hill
Contributing Writer

Ash Hill is a contributing writer for Tom's Hardware with a wealth of experience in the hobby electronics, 3D printing and PCs. She manages the Pi projects of the month and much of our daily Raspberry Pi reporting while also finding the best coupons and deals on all tech.