Bar Code Scanner

I've been thinking (on and off) for over a year of a way to improve how I store and more importantly, how I find my electronic components. Like a lot of people I have (plastic and metal) storage cabinets that comprise of rows of drawers (in which I place all the various items I have acquired and purchased over the years). At the moment I have thin cardboard labels that I place inside each drawer. For components I use regularly I can remember... "oh that's in the third drawer (from the left) on the second row" (unless of course the drawer gets put back in the wrong place).

When I saw this advert on AE I couldn't resist pressing the "Buy Now" button especially as I had some credit from refunds/returns and some tokens - that lowered the price even more.


The scanner arrived this week and after a few failed attempts at getting the Bluetooth to work I tried plugging the 2.4GHz Wireless Dongle into one of my Raspberry Pi 4Bs that act as my home server running Node-RED and Mosquitto.
The dongle appears as an HID Keyboard Device so I created a simple Python script to trap the "key presses" until an "KEY_ENTER" is detected - which causes the bar code to be sent via MQTT to Node-RED.

Next step was to create a simple NR flow to send a query to my MySQL dB.


Part of my simple dB...

This gives a result that indicates if the bar code is in the database or not. The 'switch' node (in the above flow) is used to trigger a message that is sent to a Telegram account on my phone and also to one of my Alexa devices.
As a quick test I cut a label off of a couple of packet of biscuits and inserted one code in the dB.


sat_bar_code_B

If anyone is interested, here's the Python file (rename it to... 'bar_code_scanner.py')
bar_code_scanner.txt (3.6 KB)

10 Likes

Excellent Dave! I have been thinking of something like this for kitchen ingredients.

That's a good idea.
Could probably extend it to label all those strange looking items one finds in the freezer.

3 Likes

Just had a brilliant thought - rather than spending time thinking up bar-codes and then printing them out - I'm going to cut them off of all the things I buy, then insert the code in my dB.

It will remind me of the "olde" days and the "I-Spy" books I had as a child and books of railway train numbers that I crossed-out when I spotted the engine.

Only the older generation on the Forum will remember these small booklets.

This is the modern equivalent... "I Spy Bar-Codes"

EDIT:
Just found some photos of the "I Spy" booklets and "Train Spotting" - shows my age.

4 Likes

Then use an old phone attached to the freezer as a display to tell you what it is. :slight_smile:

Even better, scan when something goes in so you have the what and the when. :sunglasses:

1 Like

Well done Dave, yet another first world problem solved.

2 Likes

My friend @zenofmud aka Paul always asks me to place a BOM (Bill of Materials) on every PCB I design and make, so for my latest PCB I thought I'd try getting a bar-code and QR-code printed on the silk-screen as shown below. Will be interesting if my hand-held scanner can handle it.



The bar-code will be used to query a MySQL dB, while the QR-code resolves to a URL.

Edit:
Just updated my dB so I have an entry ready to "welcome" the PCB when it arrives in the UK.

1 Like

Cool. Seems like a great way to do things.

1 Like

So have to ask, what software do you use to design pcb and do you mask and make your pcb's or ship out the file?

I taught myself PCB design during COVID-19 using the FREE program called EasyEDA.

Then I make use of JLCpcb in China to manufacture the boards and ship them to me in the UK.

4 Likes

Hey @dynamicdave ,
Last year I have been reordering my components. It seemed that I had ordered the same stuff from Ali 5 times, because I could never find it again. So a better management system is very welcome!

But I don't really understand how you can search faster this way. Am I correct that you need to scan every label now, to find out what is the boxes?

you better hurry :wink:

see this report about "The end of barcode"

https://www.msn.com/en-au/news/australia/why-it-will-soon-be-the-end-of-the-line-for-barcodes-after-50-years/ss-AA1wGIV0

MSN :frowning:
So messed up, my browser simply refuses to show the output!

@BartButenaers, I’ve built a node-red flow to locate my parts. I started by creating a CSV file (stored in my PartsBin folder) for each location and add an entry for each part with the location name, part ID, device type, a description and the quantity of items. For example:

bin,type,partnumber,description,quantity
B-HDX-Resistors,resistor,10 ohm,10 ohm resistor,25
B-HDX-Resistors,resistor,22 ohm,22 ohm resistor,24
B-HDX-Resistors,resistor,47 ohm,47 ohm resistor,23
B-HDX-Resistors,resistor,68 ohm,68 ohm resistor,196
B-HDX-Resistors,resistor,100 ohm,100 ohm resistor,25
B-HDX-Resistors,resistor,200 ohm,200 ohm resistor,79

I have a flow that reads in all the CSV files in folder my parts directory and loads the data into an sqlite DB.

Then I have a dashboard where you can enter a part number and it will look it up and show you the location. So if I need a 100K resistor I can enter it and get this:

or if I want to see all my resistors, I can pick that in the 'type' option and get something like this:

I need to do a cleanup/update of the flow and update to dashboard 2, then save it as a project.

But if anyone is interested, I'm happy to share it now.

3 Likes

Hi Bart,
My original idea, before I bought the Bar Code scanner, was to put labels on each plastic drawer.
Like 1B2, 1B3.... which means Cabinet 1, Row B, Second drawer or Third drawer.
Then have some sort of look-up table (e.g. dB) that mapped the item to the location.
Although I never got round to implementing the idea my friend @zenofmud did (see his post).

As I said in my original post, getting the scanner was a bit of an impulse buy. However I think it will certainly come in useful decoding the Bar/QR Code on my PCBs as up-till-now it has been tricky (because of lack of spare realestate) to put a BOM on the reverse side. This also means, that because the BOM is held in a dB, I can edit the details if a component was subsequently changed - something I couldn't do if it was silkscreened on the board.

I asked the missus if a bar code reader & tablet with Node-red dashboard would improve my selection from the jars of herbs and spices in the kitchen cupboard.

She seemed dubious.

4 Likes

Hahaha

I work with barcodes all the time as we do Warehousing for Sage X3. A QR code is just another form of Barcode (no bars!). Another article written to be able to write something. A QR Code is of course an upgrade. :smiley:

Not at all surprised. However, you might find it useful for restocking - in other words just scan the barcode when something is getting low in order to create a shopping list.

Very much overkill though unless you are managing a house for many people and who would want something cluttering up the kitchen when the space is always at a premium it seems.

:grin:

It sounds like a solution looking for a problem, but I kind of like it.

2 Likes

@zenofmud, @dynamicdave

Thanks both for the extensive descrption!

So you guys have a complete small warehouse management system. Nice! I am quite impressed! But that will have to wait here until I am retired :yum:

Please continue sharing stuff like that. Really nice to see where it is going...

3 Likes