Use a Barcode Reader With TimeSquAir

Why not use a Barecode Reader to add products on your shopping list?

Step 1: Get a Barcode Reader

You can get one on amazon, in this tutorial it's the « Inateck 2.4GHz Wireless USB Automatic Barcode Scanner Handheld Bar-code Reader »

Step 2: Connect Your Barcode Reader

Open the TimeSquAir (4 nylon screws on the back) and plug the USB dongle of your Barcode reader on the Raspberry Pi.

Step 3: Collect the Data

Then on Node-RED, take the node "Serial" in the input section. Create a new Serial Port and set it like the picture.

Step 4: Transform a Binary Code Into a String

Now if you use your Barcode, it'll return something like that : «02000700000000000000000000000000...»

If you want to translate this binary code into characters you just need to create a function that will do it.

Step 5: An Example

You can generate your shopping list by scanning the products and use http://world.openfoodfacts.org to match the reference of the barcode of your product.

This example just displays the result, but you can stock it in a file and send it by email when you go shopping.

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest

    2 Discussions

    0
    None
    Lorddrake

    2 years ago

    how do you get the information from the website to your shopping list? is there an export feature, or do you have to manually cut and paste the info?

    1 reply
    0
    None
    ArthurD27Lorddrake

    Reply 2 years ago

    Hi, it works with an HTTP request. So you just need to specify the
    products in the url message and it'll return you the name of your
    product in a JSON format. If it doesn't you'll need to add this product directly on the
    openfoodfacts.