Shop OBEX P1 Docs P2 Docs Learn Events
How to connect barcode reader to Stamp2p40 — Parallax Forums

How to connect barcode reader to Stamp2p40

ettoetto Posts: 10
edited 2007-02-26 09:51 in BASIC Stamp
I am going to read barcodes with barcode reader and i would like to send read values to microcontroller. Is this possible?

After reading values with barcode reader(or scanner) there wont be any other control with the value of read barcode. I just want to barcode reader send the value to microcontroller and microcontroller show the value on LCD screen, thats all.

Anyone have an idea?

Thanks

Comments

  • latigerlillylatigerlilly Posts: 114
    edited 2007-02-25 18:14
    I am having the same problem. I am doing a workaround with old-fashioned punched cards instead of using a bar code reader. check the Parallax documentation, BS2P40 has voltage detectors that can read a logic 1 or 0 correlating with current/no current. Perfect for a punch card reader.

    Shameless Plug (please answer my question):
    http://forums.parallax.com/showpost.php?p=0
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-02-25 19:41
    Hi etto, yes it is possible if you select a scanner with a suitable serial output.

    If you anticipate having a large number of barcodes you might consider a Vdrive. The Vdrive is a USB thumbdrive reader/writer that can be interfaced to a microcontroller such as the Stamp. It was rolling through my mind what kind of applications I could use it for and a barcode scanner was one. My reasons were that the thumdrive can contain several thousand codes each with its own unique data such as brand name, price, supplier etc. Access to the data is quick and automatic. New product lines can be added by simply removing the thumdrive from the scanner and programming in a PC and it's relatively cheap. It does have a few drawbacks but it would be ideal for scan codes.

    A couple of other things I thought might be suited, RFID database, long term data logging, a container for robotic macros.

    Drawbacks (for me) it's a little tricky to program to begin with, I had to keep the baud to 2400 to reliably recieve "handshake" on a BS2, file names are limited to 8 characters.

    Browse this sight if you think it's something you might need. http://www.vinculum.com/

    Jeff T.
  • ettoetto Posts: 10
    edited 2007-02-25 22:00
    Unsoundcode said...

    Hi etto, yes it is possible if you select a scanner with a suitable serial output.

    If you anticipate having a large number of barcodes you might consider a Vdrive. The Vdrive is a USB thumbdrive reader/writer that can be interfaced to a microcontroller such as the Stamp. It was rolling through my mind what kind of applications I could use it for and a barcode scanner was one. My reasons were that the thumdrive can contain several thousand codes each with its own unique data such as brand name, price, supplier etc. Access to the data is quick and automatic. New product lines can be added by simply removing the thumdrive from the scanner and programming in a PC and it's relatively cheap. It does have a few drawbacks but it would be ideal for scan codes.

    A couple of other things I thought might be suited, RFID database, long term data logging, a container for robotic macros.

    Drawbacks (for me) it's a little tricky to program to begin with, I had to keep the baud to 2400 to reliably recieve "handshake" on a BS2, file names are limited to 8 characters.

    Browse this sight if you think it's something you might need. http://www.vinculum.com/

    Jeff T.

    ·· Hi Jeff,

    Thanks for your message. Actually, for me there won't be a database to define something after reading. It is quite simple process. Barcode Reader will read the barcode, send the number microcontroller(basic stamp) and microcontroller will send number to LCD screen.

    What kind of barcode reader is better for this process? And after reading barcode what kind of value i will have in microcontroller, i mean;· will i have exact reading value or am i going to make some conversions in microcontroller?
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-02-25 22:29
    Hi etto, you could check ebay out, many scanners have multiple ways of interfacing make sure you get one that supports RS232 and if it supports TTL RS232 that would save you building a converter. You will probably have to do a little formatting from scanner to LCD but it shouldnt be that hard.

    Jeff T.
  • ettoetto Posts: 10
    edited 2007-02-26 00:24
    Unsoundcode said...

    Hi etto, you could check ebay out, many scanners have multiple ways of interfacing make sure you get one that supports RS232 and if it supports TTL RS232 that would save you building a converter. You will probably have to do a little formatting from scanner to LCD but it shouldnt be that hard.

    Jeff T.

    Hi Jeff,

    I checked ebay i found some supports RS232. But i didnt see any of them support also TTL. I wanna ask you something about RS232, what is the difference between RS232 and USB cable, is this all about connection to microcontroller? Because i will connect barcode scanner to stamp(controller) than i will connect LCD screen to microcontroller.·I mean i dont connect LCD to barcode reader directly. Could u explain a bit about RS232?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-26 00:33
    In general, if you have a question like "What's RS232", try the Wikipedia. Here's the link for RS232 en.wikipedia.org/wiki/RS232

    RS232 is a standard for transmitting serial data. It defines the voltages involved and the signals for control (not just the serial data streams) like DTR (data terminal ready) and others. Most computers now use another standard (USB) for serial data that can handle multiple virtual devices and dynamic reconfiguration and can supply power to most devices. You can buy adapters that electrically look like an RS232 connection to the I/O device and look like a simple serial connection to the software.

    Handling a USB connection is much too complicated for a Stamp to do. There are some devices on the market for interfacing some kinds of USB peripherals to a microcontroller like a Stamp. GHI Electronics makes one and FTDI makes the Vinculum which is another. These may not be able to handle a bar code scanner unless the scanner is designed to look like an ordinary serial device to the USB host. Determining that may be difficult unless you're familiar with USB devices.

    Post Edited (Mike Green) : 2/26/2007 12:44:38 AM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-02-26 01:39
    Hi etto, a lot of devices interface/communicate to the Stamp via·serial connection (probably the LCD you are going to use)·and it is a subject well worth study. RS232 is one form of serial communication but uses voltages that are too high for the Stamp's I/O pins·to deal with so either you use a line driver to convert the signals to TTL (0v - 5v) or use a device that is already configured as 0v - 5v serial (TTL RS232). In one of it's simplest forms all you need is a wire for transmit a wire for recieve and a common 0v. In addition to Mikes reference·you should also read the·Pbasic help files SERIN and SEROUT.·They describe·quiet well the basic principals and show an example of two Stamps connected together in a serial configuration.

    Jeff T.
  • Desy2820Desy2820 Posts: 138
    edited 2007-02-26 09:51
    If you can find one of the barcode readers that connect to the keyboard port on the computer, you MAY be able to use this chip to interface with it.·

    http://www.awce.com/pak6.htm

    It's designed to interface a standard keyboard with a small micro, such as the Basic Stamp.
Sign In or Register to comment.