I solved this problem by taking a photograph of my library card. To check out a book, I load the picture and hold it up to the scanner.
I added an image of my barcode to a location based reminder, so it pops up in a notification when I go to my local library.
I used this pro-tip today and it worked great. Thanks for the idea.