Access control with QR, RFID and temperature verification

This Raspi prototype reads QR and RFID, checks guest temperature and temotely authenticates to grant barrier access.

Post Covid-19 world turned out to be a little different. Now, before granting access to certain private neighborhoods, companies and schools, a temperature check is required.

This Raspberry Pi based unit reads QR codes or RFID cards, then checks guest temperature, authenticates with a remote server and grants barrier access.

How does it work?

The prototype use Raspberry Pi 4 with a cam module, RFID reader, IR temperature sensor and 4 channel Relay connected. For the demo, a servo motor acts like a barrier but in real world, any type of barrier combination be enabled.

The software was programmed using Python with the following flow:

1. Cam takes a snapshot using a bright led as flash (just in case QR is printed on paper instead of a Smartphone screen)

2. If no QR is detected, unit tries to read RFID

3. QR is decoded so at this point, either guest QR code or guest RFID code is available

4. IR temperature sensor located at right reads guest writs temperature

5. Guest code + temperature is sent to a remote server where a PHP script listens for requests

6. A response is sent back to the unit with the relays to enable (barriers, etc)

7. A database is populated with all requests and access for reporting purposes


Technical notes

The main reason to use Raspberry Pi instead of Arduino was the QR code reader. There are several QR libraries that can be used with Raspbian and Python to decode QR but you will have to make some adjustments.

Both IR temperature sensor MLX90614 and PN532 use I2c. They have different address – checked with sudo i2cdetect -y 1- so you just have to connect cables in parallel and that’s it.

Code snippets

Scan QR Code with Raspberry

camera.resolution = (800, 600)
camera.color_effects = (128,128)

Query remote server

                url = 'http://IPHere/qr.php'		
myobj = {'qr': myData,'temp': str(temp)} try:
x =, data = myobj)

Read NFC from Raspberry PI

for target in n.poll():

Source: Access control with QR, RFID and temperature verification

About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top