Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Barcode reader connecting to PIC

Status
Not open for further replies.

lilwelshy

New Member
Hi for my final year project I am hoping to make a device that adds up carbohydrates of foods and drinks by using their barcodes, I will only be using a small sample of 10 products. I have been trying to understand the data coming out of the barcode scanner and seem to be stuck, I used an oscilloscope to look at the output of the scanner and then took the data and saved it to a USB stick and looked at it in excel and ha 2500 numerical outputs which doesn't make sense to me, i have searched the internet ( probably in the wrong places) and cannot understand this data.

Anyway what I would really like help with is connecting the barcode scanner to a PIC microcontroller such as the PIC 16F45J50 ( as it allows USB), I have read that because my barcode scanner can connect directly to a computer that I would nbeed something like max 232 to do this ? Has anyone done this successfully ?
 
  1. I used an oscilloscope to look at the output of the scanner and then took the data and saved it to a USB stick and looked at it in excel and ha 2500 numerical outputs
What did you save from the scope; the waveform, the binary data or decoded serial data? If its the waveform then the 2500 points, if you plot them against time in excel, will re-create the waveform you've captured.

2.
I have read that because my barcode scanner can connect directly to a computer that I would nbeed something like max 232 to do this
If you try and connect via USB you will need be able of USB host mode, two slaves won't talk to each other.

Have you looked at getting a raspberry Pi B, this already has the USB host hardware so you would just need to write some code
 
Using a MAX232 chip tells me that it's just standard RS232 serial data (of whatever baud rate), not USB. The output you will get from a barcode scanner is a string of numbers representing the scanned UPC code. You'll need a database of information regarding the specific products whose labels you scan, which you'll likely have to enter yourself. Here's a link to the Wikipedia article regarding the UPC bar code in common use: https://en.wikipedia.org/wiki/Universal_Product_Code
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top