Link Search Menu Expand Document
Mobile Data Collection toolbox

5.7.4 Using Barcodes


Why using barcodes?

Barcodes make it possible to prevent data entry errors by limiting the amount of information to enter during a data collection session related to the same element (be it follow-up, WASH facility visit, etc.). Scanning a barcode rather than inputting a unique identifier manually (like a Universal Unique Identifier (UUID)), drastically reduces the risks of error as there is less risk of errors of inattention when capturing the code. Keep in mind that QR codes can be easier to handle than usual barcodes.

This page show how barcodes widget is displayed on ODK Collect and supported barcodes formats.

Tool Focus : Downloading the barcode reader for ODK Collect

First, an additional (free) application must be installed on each phone/tablet that will have to read barcodes IF the version of ODK Collect is prior to 1.7.0. On Google Play, search for Barcode Scanner from ZXing Team:

image info

Remember that it is highly recommended to update ODK Collect regularly in order to avoid bugs and to have access to as many features as possible. So you probably won’t need to download a barcode scanner.

Coding the form using barcodes

The form itself should be adapted as well. While at its simplest, it would be sufficient to simply add a “barcode” type of question; it is useful to take a few extras precautions to handle potentially troublesome cases.

image info

  • If using an external list (see 5.7.1 Managing external data) with the barcodes, then a calculation that tries to find a match between the barcode that was scanned and the UUID stored in the list must be added (the second row above, id_key_from_barcode).
  • A note that informs the enumerators of the barcode that was interpreted by the application should be brought up. This allows verification that the scan worked properly.
  • A manual input should be set up in case the reading of the code fails.

The reading of the code can fail for a few reasons:

  • Reflections due to a combination of strong light source and plastic/reflective cover on the card can throw off the reader
  • Dust or spots on the barcode can hide some of it, resulting in an erroneous read
  • Too much movements which scanning, or scanning at an angle can also cause errors
  • Finally, the quality of the camera on the phone will determine the efficiency and accuracy of this process, as well as the presence of auto-focus/flash on the camera.

Generating the barcodes

Unless you are dealing with existing barcodes that are available with your constituents/beneficiaries (i.e. barcode on the borehole, HH cards that have been distributed to your beneficiaries…), you are likely to need some way to generate and print barcodes. One option is to buy a purpose-made printer (there are small printers that can bring labels in smaller format, including barcodes). This may be worthwhile if the material is available in your location and if you will be using barcodes extensively. The solution presented here uses Excel, as it doesn’t require additional investments.

First, a special type of font must be downloaded if it is not already installed on the computer. There are many sources for this, including this one.

Download it and unzip the file obtained. It contains a few files, but only one is of interest. You can right-click it and choose “install”:

image info

If Office is already open (Word, Excel, etc.) you may need to close all opened documents and open them again before the font actually becomes available.

Then in Microsoft Excel or Word, you can create the list of codes that will have to be printed. The following Excel template provides one way to achieve this (it is also included in the Follow-up survey, in the tab “Barcode”).

The Excel setup to produce barcodes image info {: .text-center}

  • Column A contains the list of UUID that we will have to print and distribute to the beneficiaries (it could also be alpha-numeric)
  • Column B contains a formula to quickly add the * character at the beginning/end of each barcode:

    image info

  • Column C creates the barcode. It is simply set to be = to the corresponding cell in column B (“=B2”). The main difference is that the font selected was “Free 3 of 9” (e.g. the font we added on our computer by right-clicking & choosing “Install”). To ensure the code will be readable by a smartphone, the size of the police should be increased (48 or 72 seem to produce good results).

    image info

You can adjust the disposition of the cells to match your printing needs. Once your setup is completed, you could simply change the numbers in Column A and create a new set of barcode, without having to change the other components.

It may be wise to print the code along with the barcode (as opposed to just printing the barcode), as this provides a way for enumerators to verify if the reading was successful.