I am currently working on a project involving QR codes and a Raspberry Pi.

I have QR codes printed on business card size media. When the card is far enough away for the camera to see the whole code it was out of focus.

Luckily I had some cheap ($1.50) lenses that happen to have a 4.5″ focal length laying around from a previous project.  These worked perfectly for me as the distance from the card to the lens was ~4″. The nice thing about this mod is that it does not require modification of the original raspberry pi camera lens.

Before and After:



These worked perfectly. I am now able to reliably read the QR code using the zbarimg program from the repository.

sudo apt-get install zbar-tools

With this step out of the way I can get back to my project.