Posts: 1
Joined: Tue Oct 30, 2012 2:58 pm

Raspberry Pi as a QR Scanner?

Tue Oct 30, 2012 3:03 pm

Hi there.

I want to make a very small and inexpensive QR scanner and thought of the Raspberry Pi and other mini PC's.

I saw that some have managed to install Android on the Raspberry Pi, which I think is awesome.

With Android, I thought I could have an app installed that scans QR codes and sends the data to an email.

I know this is possible, but for the scanner to work, I need to connect a camera to the Raspberry Pi.

Is this remotely possible? I imagine it might be even more difficult to get this to work when I plan on installing Android on it.

Best regards

User avatar
Posts: 2022
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website Twitter

Re: Raspberry Pi as a QR Scanner?

Tue Oct 30, 2012 4:47 pm

I know this isn't what you want, but my phone scans QR codes very well (and a dozen other types of 'bar' code too). I suspect most phones that are remotely "smart" can do it too.

For the Pi solution, you need a Pi, PSU, display (or not if sending to the 'net). Camera, some way to control it - mouse, keyboard, button on the GPIO, and after all that, even with Android it's a bit unwieldy...

The actual algorithm for doing the scanning and decoding of QR codes isn't hard (so you don't really need android), and a simple contrast enhance on the image probably suffices... Nice academic excercise, or maybe integration into some factory automation/process control, but for practical use? I'll just point my phone at one...

Gordons projects:

User avatar
Posts: 17402
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Pi as a QR Scanner?

Tue Oct 30, 2012 6:33 pm

The zbar-tools package may be what you're looking for.

It can read various barcodes, including QR codes from many image sources including cameras and image files.

A cheap USB webcam (that is supported by the Pi) should do the trick.

Posts: 70
Joined: Wed Oct 31, 2012 4:45 pm
Location: South Florida
Contact: Website

Re: Raspberry Pi as a QR Scanner?

Sat Apr 13, 2013 3:14 am

There are many 'practical' application where the RPi would be a really good solution. One such application is where you want to scan a QR (or any other symbology) that is on the phone. :idea:

The RPi camera will be released very soon and I hope to test scanning various code symbologies using the RPi.

Posts: 142
Joined: Mon Dec 03, 2012 4:26 pm
Location: Deep in the mines of Moria

Re: Raspberry Pi as a QR Scanner?

Wed Apr 17, 2013 12:27 pm

Android is not a good way to go as:
1. It is incredibly slow.
2. It does not have the market/play store. That has to be payed for by the manufacturer.

Posts: 26
Joined: Sat May 19, 2012 9:44 pm

Re: Raspberry Pi as a QR Scanner?

Wed Apr 17, 2013 1:51 pm

As rpdom mentioned: zbar-tools.
You can use it in python easily and sending an email with the result is easy.

So with:
An raspberry board,
a webcam that works on it (you need one anyway, no matter what road you follow),
and Python + zbar + email module
it should get you what you are looking for.

The Android way would be harder and slower as has been mentioned by 4thdwarflord.
btw Does it have to send the data to the same email all the time? Then you can make it completely headless as well.

Posts: 53
Joined: Tue Apr 02, 2013 12:24 pm

Re: Raspberry Pi as a QR Scanner?

Wed Apr 17, 2013 5:35 pm

ZXing (cleverly named zebra crossing) is another great library for this. This library is all in java which might not be the best if you are just starting out.

My recommendation would be to use python and thankfully a python wrapper has been created for Xzing.

It works quite nicley and detection is as simple as a one step image process.

Code: Select all

reader = zxing.BarCodeReader("/var/opt/zxing")

Return to “Automation, sensing and robotics”