ID Tech 4439 Barcode Scanner

barcode

The IDTech Econoscan 4439/4431 is a low-cost CCD barcode scanner. Pricing runs about the same as an mbed module. It can read barcodes with a range of one to two inches and at a rate of 43 per second. It is available with RS232, USB, or PS/2 output. This setup will use the RS232 I/O option. It outputs the data at 9600 baud on an RS232 serial port. Click the button, and after reading a barcode it will send out the barcode data in ASCII on the serial output. While sending out data the LED is red and when it first powers up the LED blinks green. It beeps after reading a barcode.

In addition to the RS232 DB9 I/O connector, it has a Y cable power connector for 5V at 500MA to power the device. It is easier to hookup everything if you purchase the device with the AC wall adapter included that has the proper barrel style power connector. An RS232 voltage level conversion circuit such as the one on a breakout board below from Pololu will be needed to use it with one of mbed's serial ports.

/media/uploads/4180_1/p_rs232.jpg
The Pololu RS232 Serial Adapter

Wiring

mbedPololu RS232 adapter
VU=5vVCC
GNDGND
RX(14)TX

You could also use a RS-232 adapter without handshaking support such as the module below from Sparkfun. An RS232 voltage conversion circuit could also be built on a breadboard (this circuit is already in the two RS232 adapter breakouts along with the DB9 connector).

rs232
The Sparkfun Serial Adapter has LEDs, but no handshake lines

Wiring

mbedSparkfun RS232 SMD adapter
3.3VVcc
GNDGND
RX(14)TX


In addition, a null modem and a M/M gender changer adapter (or cables) are also needed. The mini DB9 null modem and gender changer adapters as seen below are a handy way to hook it up so that everything just plugs together. A single M/M DB9 null modem mini adapter could be used to minimize all of the connector clutter, if you can find one.

/media/uploads/4180_1/nullmodem.jpg
mini DB9 null modem adapter

barset
Breadboard setup for barcode scanner

Software

To try it out, just run the standard serial bridge code on mbed, run a terminal application on the PC attached to mbed's virtual com port running at 9600 baud (just like for printf). Hold it about two inches from the barcode and click the button. You should see the barcode data stream out whenever a code is read by the reader. A red flash on the LED along with a beep means it read the barcode and sent out the data.

Serial_Bridge_for_Barcode_Reader

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
Serial device(p13, p14);  // tx, rx

int main() {
    while(1) {
        if(pc.readable()) {
            device.putc(pc.getc());
        }
        if(device.readable()) {
            pc.putc(device.getc());
        }
    }
}




/media/uploads/4180_1/barcap.jpg

After reading the barcode on the mbed box, the device sends out serial data. Two barcodes were read.

/media/uploads/4180_1/_scaled_mbedbarcodez.jpg
Barcodes found on the mbed box used for demo

The output format for the device is the data you normally see printed in small type under the barcode in ASCII followed by carriage return and line feed. Wikipedia has some basic information on barcode number formats under Barcode , UPC codes and Book ISBNs. There are also websites that can be used to lookup additional information about a book or product using the ISBN or UPC code. The more expensive barcode scanners have longer range, faster sampling rates, may not require as much attention to pointing and a particular orientation, and may support additional new barcode formats. A more extensive user's manual is also available.

The newer Econoscan II models with an RS232 interface should also work in a similar manner. They are currently replacing the older econoscan models and will be easier to find in the future. As seen in the video below, they have longer range and faster sample rates at a somewhat lower cost.

ID Tech barcode scanner demo video


Please log in to post comments.