Scan Qr Codes With Raspberry Pi Pico

About the project

To extract information from QR codes and use a Barcode & QR Code HAT and a Raspberry Pi Pico.

Project info

Difficulty: Easy

Platforms: Raspberry Pi

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

SB Components Pico QR & Barcode Scanner HAT SB Components Pico QR & Barcode Scanner HAT x 1
Raspberry Pi Pico Raspberry Pi Pico x 1

Story

To extract information from QR codes and (even create your own barcode & QR Code using Python), use a Barcode & QR Code HAT & Raspberry Pi Pico

What Are QR Codes and How Do They Work?

QR codes, which are similar to barcodes in that they canencode data represented by black and white squares, are similar to QR codes.Instead of employing a laser, a camera detects the difference between thespaces and delivers the data to be processed. They're made up of multiple hugesquares that help align and place the QR code's boundaries, as well asformatting columns, a version number, and the data itself.

Credit : Arduino “having11” Guy

Credit : Arduino “having11” Guy

Credit : Arduino “having11” Guy

Pico QR Code & Barcode Reader - VisitMain Page

They can encode a wide range of data types, includingintegers, characters, and binary, allowing for a wide range of creativeapplications. Advertisers frequently include URLs that drive users to theirwebsites. Other businesses may use a QR code to encode critical product data, such as a serial number, and attach it to a component.

Create Barcodes & QR Codes with Python

Creating Barcode In Python

I’ve already created a blog on “Create Barcodes with Pure Python

Creating QR Code in Python

Users can easily encode data within a QR code and thenexport it as a picture using the Python tool "qrcode." Run thefollowing command to install it:

pip3 installqrcode[pil]

Then you can use it in a script to create a PIL picture using:

import qrcode
code = qrcode.make('Hello world!')

The image may then be saved as a file by using

code.save(<filename>.png)

The QRCode class allows you to further personalise yourcodes with settings like size, error correction amount, version, and borderwidth.

>>> import qrcode
>>> code = qrcode.make('Hello world')
>>> code.save('hellocode.png')

The QRCode class allows you to further personalise your codeswith settings like size, error correction amount, version, and border width.

>>> qr = qrcode.QRCode(version=20,error_correction=qrcode.constants.ERROR_CORRECT_M, box_size=10, border=4)
>>> qr.add_data('https://shopmakergenix.blogspot.com')
>>> qr.make(fit=True)
>>> img =qr.make_image(fill_color="black", black_color="white")
>>> img.save('url_example.png')

After you've made all of your personalised QR codes, combinethem into a single sheet and print it.

Setting Up the Raspberry Pi Pico

Pico Barcode HAT - Kickstarter

Pico Barcode HAT - Kickstarter

The default mode is USB-KBW, or USB keyboard mode, which sends data to the host by simulating a USB keyboard.

Scan Me

Scan Me

Scan Me

Scan the barcode above and you’re ready to scan 20 DifferentBarcode Symbiology

Pico Barcode HAT

Pico Barcode HAT

Read more

Credits

Photo of fin-expert

fin-expert

Tech Writer | Maker of Random Contraptions | Education | Learning — #Robotics #RaspberryPi #DIYElectronics

   

Leave your feedback...