I have this extremely minor problem where my gym is 4 blocks away, and I'd like to go over with nothing but my phone. Unfortunately, I have to bring a card with me for them to scan with a barcode reader. I figure I'd engineer a way out, but I'm a lowly mechanical and know very little about these optical systems.

I tried taking a picture of my card and having them scan it, but it's not very reliable. I'm using an Apple iPhone 11 screen, and I realize the an LCD screen isn't going to reflect light very well, and using a picture of the card is probably generating a lot of noise.

I have two methods going forward and I'm curious to see what thoughts you all have. I know the barcode scanner is using visible light, which google says is likely at 633nm.

My first is using a cleaner image for scanning, because my original one wasn't perfect. I generated a barcode and made sure it looks like my old one, so I have a pixel-perfect barcode on my phone. I can't imagine the reflection issue is fixed, but I know that it at least has some success rate.

My second idea is to recreate the reflected laser pattern that the barcode receiver expects to receive. I found that ff4200 corresponds to 633nm light. I used a black backdrop -- I have an LCD and not an OLED, so I'm wondering if that is going to cause some issues, as I'll be broadcasting "black" light. I have no idea how good the scanner is at picking up sub-pixel light and differentiating it from the red color on my phone screen, and I have no idea if the color accuracy of my phone will throw the barcode scanner off.

I plan to go back in 2 days to test it out, but does anyone with more relevant experience or education have any ideas on how to best do this?

Thank you.Attempt at barcode reflection recreation

  • 5
    $\begingroup$ Have a phone case that holds cards. $\endgroup$
    – Solar Mike
    Commented Jun 7, 2021 at 4:38
  • 1
    $\begingroup$ Phone case requires me to rip my phone case off , get it scanned, and put it back on. My current system just requires me to show my lock screen. You gotta dream bigger Mikey. $\endgroup$
    – Guest User
    Commented Jun 7, 2021 at 4:49
  • $\begingroup$ usually increasing brightness on the screen improves reliability of scanning. You can also generate a high-contrast - pure black and white image to scan. Use a barcode scanner app to figure out what the barcode is/says and look up the specs on the bars to generate to nominal rather than scanned image. $\endgroup$
    – Abel
    Commented Jun 7, 2021 at 5:12
  • $\begingroup$ I already did that -- you can see the post for more details. It's a 39 and I based the black and red image off of a black and white one that is as clear as the attached image $\endgroup$
    – Guest User
    Commented Jun 7, 2021 at 5:44
  • 2
    $\begingroup$ Scan your card with a printer and print a paper copy of the pattern. Tape this to the back of your phone. $\endgroup$
    – Jim Clark
    Commented Jun 7, 2021 at 11:05

2 Answers 2


Bar code readers can read phone screens

You can get apps that store cards on your phone (e.g. Stocard) and they work pretty well; at least as good if not better than a printed barcode on a scrunched up grocery bag.

I suggest that your photograph is distorted or not clear enough - these apps generate the correct bar code from the numbers and don't suffer from this problem.


I believe the reason your phone does not work is because the screen is not reflective.

What happens when the barcode is scanned (usually) is that a laser dot is swept across the bars very rapidly (thus it appears as a line).

As the dot hits the black and white parts of the image the laser is reflected into a sensor more or less, creating a pulse which a computer can read.

barcode scanner diagram barcode scanning gif

From here you can probably see why your phone dose not work. Although the barcode appears similar to a code printed on paper, as the laser hits the screen it does not reflect more or less light, so the digital pulse is not generated.

Note that the pulse occurs in time, based on the speed of the laser dot so your red and black image will not work either.

What could theoretically work is if your phone could rapidly flash the pulse that would result if a laser were scanning an actual barcode. Unfortunately your phone screen probably cannot change colors fast enough, and you would also have to know the scanning rate of the laser.

I don't suppose you bring an e-reader to the gym though? Because that would work the way you expect, since it reflects light, and doesn't just produce it.

There are some barcode readers (especially QR code readers) that can read a phone screen reliably. I believe these use a camera to read the code and not a laser. These will usually be a box with a clear window that you place the code against.

  • $\begingroup$ Great explanation, thank you. I do have two questions. The first, why does it still work sometimes? It's probably only a 40% success rate, but I have had luck in the past. Second, is there only one sensor for the red light? If it sweeps across the entire "bar", this would still theoretically work if the scanner is perpendicular to the image, if my assumptions are correct. If it's just one sensor and a parabolic reflector for example, I could see why the red bar idea would have zero chance. EDIT: I see, "oscillating mirror".. Red bar has no chance ): $\endgroup$
    – Guest User
    Commented Jun 7, 2021 at 17:07
  • $\begingroup$ I think it works sometimes because the screen is very slightly reflective. For example if you hold a bright light up to a display with a dead backlight you can usually see a bit of something. $\endgroup$
    – Drew
    Commented Jun 7, 2021 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.