Troubleshooting Barcodes: A Lesson In Critical Thinking

We’ve all been there. Something that is known to work doesn’t work out in the field. But back at home base, it works fine. How do you fix it? Of course, there’s no one right answer to that question, but [Benji York] had a particularly satisfying round of troubleshooting some errant barcodes and even came up with a very creative solution.

Here’s the setup: a customer couldn’t read some barcodes sent from [Benji’s] company. Yet when the bad barcodes returned, they were fine. They looked fine, too. In a Twitter post, [Benji] challenges you to see if you can tell what’s wrong.

We’ll confess. We couldn’t.  [Benji] started decoding the barcodes by hand and noticed that one bar was just a little thinner than it should be. You can see in the picture, there is a thin white line cutting through the borders. That’s a problem with the printer and it manages to thin out one of the vertical lines in the barcode. Apparently, [Benji’s] scanner is more tolerant of this than the customer scanner.

The solution was also interesting. Instead of replacing or repairing the printer, it works fine to simply rotate the label 90 degrees. Sure, the thin line is still there, but it is a minor glitch in all the bars that any scanner will handle. [Benji] suggests always printing barcodes “against the grain” although, of course, that will depend a lot on the kind of technology your printer uses.

What we thought was interesting, though, is what this tells you about critical thinking when faced with a problem. Now that you know what the problem is, that thin vertical line in the border stands out like a sore thumb. But if you are like us, you were so fixated on the barcode that we totally missed it. Like the old saying about the forest and the trees.

A great reminder to look at all parts of something that aren’t working, not just the part that is failing. Honestly, we would have probably just repaired the printer but we do applaud the creative workaround. We spend a lot of time thinking about troubleshooting. If you want to dive deeper into barcodes, we can help you with that, too.

26 thoughts on “Troubleshooting Barcodes: A Lesson In Critical Thinking

  1. This is very common on shipping labels. I wish shippers would have all labels printed against the grain. There are a few major shippers who shall remain nameless that can’t seem to figure this out. We have to reprint at least half of the labels frome those shippers.

    1. Unfortunately, that’s most likely because that’s how their label printers are designed to orient the labels when printing them.
      So I’d rather blame both the scanner for being too sensitive (as a damage “streak” along the grain is possible when handling the labeled object) and the printer for not being precise enough.

  2. If you’ve played with barcodes much, that line stands out like a sore thumb. In my case, I had programmers who were unwilling to bow to reality, so I had to replace oh so very many printheads.

    1. That would help, but if two adjacent “pixels” (thermels? thixels?) fail then won’t you have the same problem?

      Rotating the barcode is one of those simple hacks that could save $1000s (if you have lots of PoS/outlets/etc.), reduce maintenance, improve customer experience, and reduce e-waste. For the side ways barcode to be unreadable, a significant portion of the thixels would need to fail, probably more than 10x of the thixels failures for right-way-up printing. Nice hack.

  3. This is a common problem with thermal printers. There are several possible solutions.

    Rotating the orientation, called ladder printing, is one solution, but ladder bars are very hard on thermal printers, and our printer service vendor recommended we not use them.

    Increasing the width of the barcodes makes the stripes thicker, making them more tolerant of a single print element failure like this one. But increasing the width also reduces the number of characters that can be encoded in the same area. Depending on the application it’s not always possible.

    Changing symbology can be a good solution in certain situations. If you can use a “denser” barcode that encodes more characters in the same area, you can print it wider and still make it fit the same area. However, this client is already squeezing as many Code128 characters as they can into the print space available, and Code128 is already one of the more dense symbologies. Plus it looks like it’s being used in the auto industry, where these barcodes are already standardized and changing symbologies is not an option.

    There is one more cheat he can try. Print the bar code in tiny stair-steps, shifting the starting pixel to the right every 1/4″. Often the barcode can be read if you can hide the dead pixel in the middle of the bar. The resulting bar code might not pass their client’s standards, however.

    But honestly the best thing to do after a complaint like this is have the client swap to a backup printer and have the failing printer serviced.

    1. THIS. Although the cleaning the print head would probably help a bit as well.

      If that still doesn’t work, I’d check the symbology that the client’s scanner is configured for- at one point, we were disabling every symbology that the scanners supported except for the one that we actually used (not Code128), which caused all kinds of problems when the vendor updated their software to use Code128 and we had to factory reset every. single. scanner. across two properties.

      And for some bizzare reason, USB connected 2D scanners are still stupidly expensive compared to their more primitive 1D siblings…

    1. Radial scratches on a record just make an annoying pop… but tangential ones can deflect the stylus either to some point ahead in the track (skip) or behind the existing position (repeating).

      For all the advances, optical discs suffer just as badly as more mechanical methods of storage.

  4. Technically, he didn’t “fix” the problem, he band-aided it. Replacing the printhead is the proper fix for a Tier 1 supplier. In my experience with various thermal transfer printers (24 years now) and labels of significantly higher complexity, proper setup and maintenance of the printer will greatly extend printhead life. At my current employer, we average a printhead life about 150-200% of manufacturer specs due to tightly controlled printer settings.
    Also, Symbol/Zebra has a utility called 123Scan that will allow you to audit your print quality when used with a CCD based 2D barcode scanner. I use it to validate 1D barcodes for quality concerns like skipped prints, the other defect on this label. (a few bars have random gaps in the print)

  5. My previous supermarket would have a bottle return system that spew out receipts with a barcode, I decoded their system and it was just date, amount of bottles and an increasing number. When you came to the cashier they would pin those reciepts to a stake, but not before making a horizontal pass over the label with a black marker, leaving the label perfectly readable to any scanner.

    1. But then you have to convince the cashier to scan something with an ominous marking that means “Do not scan this because this has already been cashed out”. I guess it would be a social engineering hack.

      1. I think his point is that you can scan the last “increasing number” scanned by the cashier and print your own receipt for a large number of bottles returned (and a high payout) with a correct number. It’s likely however the numbers are communicated by the bottle machine to the computer system and cross checked by the cash register when the receipt is scanned so that a receipt cannot be scanned twice and it’s not possible to scan an fake receipt or scan a receipt with an artificially inflated number of bottles returned.

        1. Unless there are more than one points of sale, each with their own stack of receipts and you have to guess which one has the last code.

          In many places, there are also donation boxes next to the bottle return machines where users can drop their receipts if they don’t want to bother cashing them in – or people simply forget, or drop their receipt – so what’s at the cashier may not be what’s in the system in the first place.

          You may guess a number that is larger than what has been cashed in already, but you will be caught when they find a double slip and check the security tapes.

  6. all you need is window cleaner and a rag from the kitchen roll. the “whole-line thermo cell” rarely fails, but collects lots of gunk. had a great example yesterday at a fast food chain… NOTHING would read that barcode i got there :D

  7. The “need” to make things smaller and smaller has caused me a lot of headaches in the supply chain dealing with barcode problems.
    Despite issuing a specification the supplier will break it, or a warehouse somewhere will have ancient bar code scanners and refuse to upgrade them. And of course the more info you try to get into the barcode the bigger the problem.
    QR codes help to solve this but of course a lot of the chain wont support that either.

    Random example:

    https://rog.asus.com/forum/attachment.php?s=aea94732dafe709a64d7a3b66e9aad24&attachmentid=92666&d=1649690421&thumb=1

    Imagine that label is actually1.5inches across as some are that small but trying to cram all that into the space even if it wasn’t rubbed.
    The business I was contracted with even made their own scanners and couldn’t read the barcodes with many models.

  8. Many of our customers require the barcode to be a certain size and in a certain spot on the label. So for us, the only option would be to replace the defective part in the printer.

    Bummer I know.

  9. Code 128 uses print elements (bars or spaces) that are 2, 3, and 4 units (the X dimension) wide. A missing dot will invalidate the barcode if it falls in a bar, but if it falls in a space, the code will be valid and legible. In the picture, it appears that a 2X bar became 1X. With different content, it may be that a 3X bar turns into 2 1X bars with a 1X space in the middle, which is also invalid. Similar problem with a missing dot in the middle of a 4X bar.

    Rotating the code at angles other than multiples of 90 degrees will not work on a low-resolution printer, as it would create a stair-step effect on the code elements.

    The correct way to invalidate a 1D barcode so that it can’t be scanned again is to run a marker vertically through the code, completely filling one or more spaces for the full height of the bars. But that’s not intuitively obvious to the untrained.

    In addition to thermal printer issues, I commonly see laser-printed labels that are printed at too-small a magnification. Such a code might be readable with a handheld scanner, but not readable by the flying-spot linear scanners typically mounted above a conveyor in a distribution center, warehouse, or sorting center where packages fly by at hundreds of feet per minute. In these conditions, you get only one shot at reading; the X dimension, bar height, and quiet zones (white areas before and after the barcode) are critical to successful reading. Handheld scanning is generally more forgiving; the operator gets multiple opportunities to scan the barcode, and is free to adjust the distance and angle of the scanner until the code is able to be read.

    1. About 1977, Byte got interested in barcodes. So articles on the hardware, but also the software. One article made a connection to morse code, and in more recent times I’ve read that the creator was influenced by morse code.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.