OPTICAL CODE READER AND FORMAT

Abstract: An optical code reader system includes an optical code reader and a corresponding optical code format. The code reader includes a detector circuit for establishing an adaptive threshold level related to the difference in successive positive and negative peaks of the analog signal corresponding to white and black areas of the code. The code format comprises a plurality of alternating encoded black and white areas bounded by white quiet zones and black preset areas associated with the quiet zones for presetting the threshold value of the detector circuit to a known level before the code is read.

Description: BACKGROUND OF THE INVENTION 1. Field of the Invention This invention relates generally to optical code readers and formats. More specifically, the invention is directed to an optical code reader having an adaptive threshold capability and to a corresponding optical code format that presets the threshold of the reader to a known value. 2. Statement of the Related Art Optical code readers and optical codes are presently used in many applications wherein it is desirable to identify an item quickly and accurately by a selected code applied thereto. Examples include product and price identification in retail stores, stock identification in inventory applications, and sample or test result and corresponding patient identification in medical applications. One common type of optical code reader presently in use generally comprises an optical source such as a light emitting diode (LED) that illuminates a code being scanned by the reader or being moved across a stationary reader, an optical detector such as a conventional photodiode or phototransistor that detects the light reflected by the code and converts it into an electrical analog signal, and a detector circuit (also called a discriminator or wave-shaping circuit) that converts the analog signal into digital pulses representative of the code. A variety of black on white type code formats in which a black pattern is printed on a white or other suitably contrasting background are known in the art. Such code formats include, for example, circular codes and bar codes, such as the widely known and used universal product code (UPC), among others. Black on white codes encode digital data in the alternating black and white areas of the code and some, like the UPC, in the relative widths of the black and white areas. Such code formats also generally include white "quiet zones" which border the code-containing areas. Known optical detector circuits typically convert the analog signal produced by scanning such a code into digital pulses corresponding to the code by comparing the signal to a threshold level and generating a pulse if the signal is above the threshold and no pulse if the signal is below the threshold, or vice versa depending on the logic employed. Typically, white code areas, having a high degree of light reflectivity, produce signals having relatively high positive peak values, whereas black areas, having a fairly low degree of reflectivity, produce signals having relatively high negative peak values compared to the threshold value. It has long been known in the optical reader art that the analog signal generated by the optical detector tends to have large amplitude variations both from code to code and within the same code. The reasons for such variations are known to include improper or non-uniform printing of the code, dirt or other foreign substances adhered to the code, non-uniformity of the surface on which the code is printed, variations in distance between the code and the reader, and varying contrast between the code and the background on which it is printed, to name a few. Such variations present significant problems in accurately detecting and converting the generated analog signal to corresponding digital pulses if a fixed threshold value is used. Accordingly, detector circuits having continuously adaptive thresholds have been developed. Many of such circuits are designed to adjust the threshold as a function of the difference between the values of successive positive and negative peaks which occur in the analog signal during black to white and white to black transitions in the code. A problem with such adaptive threshold detector circuits is that in the absence of black to white or white to black transitions, the threshold signal tends to float to near the level of the analog signal generated by the optical detector. This situation renders the detector circuit extremely sensitive to even small negative-going excursions of the analog signal which can be readily caused by minor surface imperfections on the code or by vibrations of the optical detector, for example. When reading codes having quiet zones, such as the UPC, the detector circuit is particularly susceptible to read errors caused by dirt or other debris in the quiet zones. Such errors can have dire consequences in critical applications such as identifying medication or test results with a particular patient, for example. An other known optical reader apparatus is disclosed by US Patent No. 4,158,435. The known apparatus provides for code readers means reading a conventional bar code and generating an electrical signal representative thereof ,a differentiator receiving the electrical signal, and a plurality of adaptive multilevel threshold comparators receiving the differentiated electrical signal so as to detect the occurrence of positive and negative peaks. A similar optical reader with a dual level clamping circuit is disclosed by German Patent Application No. 23 30 759. However, these known readers, when reading standard bar codes, are also susceptible to errors caused by dirt. Accordingly, it is imperative to prevent such errors. Thus, it is an object of the invention to provide an optical code reader system which overcomes the limitations and drawbacks identified with the prior art. Specifically, it is an object of the invention to provide an optical code reader system that accurately reads optical codes having error inducing characteristics such as those identified above which cause amplitude variations in the electrical signal representing the code. It is a further object to provide such a system that has an adaptively preset threshold value which further minimizes the occurrence of erroneous readings. It is a still further object to provide such a system wherein a specially designed optical code format cooperates with an optical code reader to adaptively preset the threshold value of the code reader detector circuit. SUMMARY OF THE INVENTION The foregoing objects and attendant advantages are obtained by providing an optical code reader system and a substrate marked with a corresponding optical code format as defined in the accompanying claims. BRIEF DESCRIPTION OF THE DRAWINGS The novel features that are believed to be characteristic of the invention are set forth in the appended claims. The invention itself, together with the foregoing objects and attendant advantages thereof, will be best understood by reference to the following detailed description of the presently preferred embodiment thereof, taken in conjunction with the drawing, in which: FIG. 1 illustrates a prior art bar code in the conventional UPC format; FIG. 2 illustrates a bar code embodying the optical code format of the invention; FIG. 3 is a schematic diagram illustrating the details of an optical code reader circuit including an adaptive threshold detector circuit which suitably forms part of the system of the invention; FIGS. 4a and 4c are corresponding timing diagrams illustrating the problematic effect of the prior art bar code of FIG. 1 on the circuit of FIG. 3; and FIGS. 4b and 4d are corresponding timing diagrams illustrating the advantageous effect of the optical code format of the invention on the circuit of FIG. 3. DETAILED DESCRIPTION OF THE PRESENTLY PREFERRED EMBODIMENT Referring to the drawing, FIG. 1 illustrates an example of a typical prior art optical bar code 10 in the conventional UPC format. Typically, the bar code 10 would be scanned by an optical code reader from left to right as shown by arrow 12. This type of code format typically comprises from left to right a first white quiet zone 14, a pair of start bars 16, a first code area 18 consisting of a plurality of encoded black and white bars, a pair of separation bars 20, a second code area 22 consisting of a second plurality of encoded black and white bars, a pair of stop bars 24, and a second white quiet zone 26. Variations on this format may or may not contain parity codes as well as data codes in the code areas 18 and 22. Also, some format variations may not employ start, separation, and stop bars 16, 20, and 24 respectively. However, typically this type of code format and variations thereon include at least one code area bounded by white quiet zones such as quiet zones 14 and 26. FIG. 2 illustrates an example of an optical bar code 30 in a format comprising a preferred embodiment of an aspect of the invention. The bar code 30 comprises from left to right a black reference or threshold setting bar 32, a first white quiet zone 34, a code area 36 consisting of a plurality of encoded black and white bars, a second white quiet zone 38, and a second black reference or threshold setting bar 40. The code area 36 may contain one or more parity codes as well as encoded data. In addition, the code area may contain start, separation, and stop bars (not shown) similar to those illustrated in FIG. 1, if desired. Although the code format of the invention is illustrated in a preferred bar code format, it is understood that the code format can also be embodied in other code types such as circular codes, for example. It is also understood that the code area 36 can be encoded in the UPC format or any other desired format. FIG. 3 illustrates an optical code reader circuit 50 that comprises a preferred embodiment of an aspect of the invention. The preferred components and component values of the circuit are as illustrated in the figure. The optical code reader circuit 50 comprises a photodiode 54 the output of which is connected to the input of a current to voltage amplifier 56 by a line 55. The output of the amplifier 56 is connected in parallel to the input of a positive signal peak detector 58 by a line 57 and to the input of a negative signal peak detector 60 by a line 59. The outputs of the positive and negative peak detectors 58 and 60 are connected to opposite ends of a voltage divider 65 comprised of resistors 62 and 64 by lines 61 and 63 respectively. The output 66 of the voltage divider 65 is connected to one input of a comparator 68. The other input of the comparator 68 is connected to the output of the current to voltage amplifier 56 through a resistor 69. The output of the comparator 68 is connected to the base of a bipolar NPN transistor 70 by a resistor 71. The emitter of the transistor 70 is connected to ground and the collector to an output line 52. In operation, the optical code reader circuit 50 converts the encoded black and white bars or other encoded areas of an optical code such as the codes 10 and 30 into a corresponding train of TTL logic level digital pulses representative of the code at the output 52. As the photodiode 54 of the optical code reader circuit 50 is scanned across an optical code such as the code 10 illustrated in FIG. 1, or as the code 10 is moved past the photodiode 54 if the reader is stationary, the photodiode 54 generates an analog current related to the intensity of the light reflected by the code 10 on line 55. The amplifier 56 converts this current into a corresponding analog voltage signal having a series of positive-going and negative-going peaks corresponding to the white and black areas of the code respectively on lines 57 and 59. The positive peak detector 58 detects the positive or white peaks of the signal and the negative peak detector 60 detects the negative or black peaks. The positive and negative peak detectors 58 and 60 apply the positive and negative peaks to opposite ends of the voltage divider 65 as described above. The voltage divider 65 generates an output signal which varies with the levels of the white and black peaks and which provides an adaptive threshold value for the comparator 68. In the preferred embodiment, the voltage divider sets the threshold value at approximately 65% of the difference between successive black and white peaks below the white peak level. The comparator 68 compares the analog voltage signal generated by the amplifier 56 with the adaptive threshold voltage and triggers the transistor 70 into conduction when the analog signal is greater than the threshold. Otherwise the transistor 70 is non-conductive. When the transistor 70 is non-conductive, the signal on the output 52 is a high TTL level signal and when the transistor is conductive, the signal is a low TTL level signal. Thus, the preferred circuit 50 generates a low TTL level output signal when the analog signal is above the threshold which corresponds to white areas of the code and a high TTL level signal when the analog signal is below the threshold which corresponds to black areas of the code. Alternatively, the comparator 68 can be configured to provide high TTL level output pulses corresponding to white areas and low TTL level pulses corresponding to black areas of the code, if desired. Since the transistor 70 switches on and off very rapidly compared to the comparator 68, the output signals essentially have square edges. In addition, the duration of the low and high output signals correspond essentially to the width of the respective white and black encoded bars or other encoded areas. It should be apparent from the foregoing description that when a prior art optical code such as the code 10 of FIG. 1 is read, the adaptive threshold level applied to the comparator 68 is initially set by the first white peak to black peak transition of the analog signal which results from the transition from the first white quiet zone 14 to the first start bar 16. Thereafter, the threshold 82 is adaptively adjusted by each white peak to black peak and black peak to white peak transition, i.e., each white to black and black to white transition of the code. When no transition is occurring, the threshold level tends to travel exponentially toward the value of the analog signal. Thus, before the code is read, when no transitions are occurring, the threshold level tends to float slightly below the level of the analog signal. This situation renders the circuit 50 very sensitive to negative going excursions in the analog signal. Such excursions are easily caused by dirt or smudging in the quiet zone of the code or even by vibration of the photodiode 54, for example, and can easily be large enough to drop below the threshold and cause the transistor 70 to output spurious pulses which may be erroneously interpreted as part of the code. It is understood that this situation is not particular to the preferred optical code reader circuit 50 described but is also present in many other optical code reader circuits of the type that adaptively set the threshold value as a function of the values of the white and black peaks and that rely on white to black and black to white transitions to set the threshold. Moreover, the problem occurs in both analog and digital adaptive threshold circuits of this type. FIGs. 4a and 4c are timing diagrams which illustrate the effect of the above situation on the output of the optical code reader circuit 50. As a typical prior art optical code is read, the analog voltage signal is generated having a series of positive peaks 84, 90, 94, and 98 corresponding to white code areas, and negative peaks 88, 92, and 96 corresponding to black code areas. The threshold 82 tends to adjust toward a level that is approximately 65% of the difference between successive white and black peaks below the white peak level. When the analog signal 80 is above the threshold 82, low logic signals 104, 106, and 108 corresponding to the white areas of the code are output by the circuit 50. When the analog signal 80 is below the threshold 82, high level logic signals 110, 112 corresponding to the black areas of the code are output. Prior to reading the code and before any black to white or white to black transitions occur, the reference level 82 tends to float slightly below the analog signal 80. During the white peak 84 corresponding to the first quiet zone 14, dirt or other debris, for example can cause a negative dip 86 in the analog signal 80. Since the threshold level 82 is floating just below the analog signal 80, the dip can cause a spurious output pulse 102 to be generated which can be erroneously interpreted as part of the code. FIGs. 4b and 4d are timing diagrams which illustrate the curative effect of the code format 30 embodying the present invention on the output of the optical code reader circuit 50. It is understood that in this example the circuit 50 is representative of all such circuits having adaptive threshold circuits of the type described above. The analog voltage signal represented in FIG. 4b is the same as that represented in FIG. 4a except that an initial negative peak 100 corresponding to the first black threshold setting bar 32 and a final negative peak 101 corresponding to the second black threshold setting bar 40 are introduced into the signal as the code is read. The introduction of the black peak 100 corresponding to the setting bar 32 prior to the white peak corresponding to the first white quiet zone 14 presets the threshold 82 to a known level having the 65% value described above. As a result, the negative dip 86 encountered during the white peak 86 does not approach the threshold and does not cause an erroneous pulse in the output signal. The second threshold setting bar 40 is included so that the threshold will be preset as described above regardless of which direction the bar code 30 is read in. In the preferred embodiment, it has been found that in the absence of black to white or white to black transitions, the threshold level tends to decay toward the analog signal level such that by about 50 milleseconds after the last transition the threshold level has decayed to about one half of the initial difference between the analog signal and the threshold value. As an example, therefore, positioning the first black threshold setting bar 32 approximately 6,35 mm (.25 inches) before the beginning of the code area 36 and scanning the code at a rate of approximately 127 mm (five inches) per second, a negative-going excursion in the analog signal would require a magnitude of approximately one half the initial difference between the analog voltage signal and the threshold value to cause any effect on the output of the circuit 50. However, spurious signals caused by dirt, vibration and other surface imperfections normally do not produce excursions having magnitudes of this level. Accordingly, the preferred optical code reader system embodying the invention minimizes the effect of such imperfections on the output of the circuit 50 and effectively solves the floating threshold problem inherent in many adaptive threshold optical code readers of the type described. What have been described are certain aspects of an optical code reader system comprising a presently preferred embodiment of the invention. It is understood that the foregoing description and accompanying illustrations are merely exemplary and that the scope of the invention is defined solely by the appended claims. Various changes and modifications to the preferred embodiment will be apparent to those skilled in the art. Such changes and modifications may include, but are not limited to embodying the preferred code format in other types of codes such as circular codes, for example. Where technical features mentioned in any claim are followed by reference signs, those reference signs have been included just for the sole purpose of increasing intelligibility of the claims and accordingly, such reference signs do not have any limiting effect on the scope of each element identified by way of example by such reference signs.

Claims: An optical code reader system, comprising optical code reader means (50) for converting an optical code into a corresponding digital signal, said optical code reader means (50) having means (54,56) for converting said optical code into at least one corresponding electrical signal, means (65) for generating an adaptive threshold related to said electrical signal, and means (68,70) for generating said digital signal so that said digital signal has a first state when said electrical signal is above said threshold value and a second state when said electrical signal is below said threshold value; and a corresponding optical code (30) for being read by said optical code reader means (50), said optical code (30) comprising a plurality of alternating encoded black and white areas (36), said areas being bounded on at least one side by a first substantially white quiet zone (34), CHARACTERIZED IN THAT at least one first black preset area (32) is associated with said first white quiet zone (34) for presetting said threshold to a known value when encountered by said optical code reader means (50), said first black preset area (32) being positioned so that it is read prior to the first white quiet zone (34) and to the encoded black and white areas (36). The optical code reader system according to claim 1, characterized in that said optical code reader means (50) comprises optical bar code reader means, and in that said corresponding optical code (30) comprises an corresponding bar code. The optical code reader system according to one or more of the preceding claims, characterized in that said means (54,56) for converting said optical code into at least one corresponding electrical signal comprises means (56) for converting said code into at least one signal having a positive-going peak corresponding to each white code area and a negative-going peak to corresponding to each black code area. The optical code reader system according to one or more of the preceding claims, characterized in that said means (65) for generating an adaptive threshold related to said electrical signal comprises means for generating an adaptive threshold related to the difference between successive positive-going and negative-going peaks of said electrical signal. The optical code reader system according to one or more of the preceding claims, characterized in that said plurality of alternating encoded black and white areas (36) is bounded on at least an opposite side to said first substantially white quiet zone (34) by a second substantially white quiet zone (38); and in that said at least one first black preset area (32) presets said threshold to a known value before said first white quiet zone (34) and encoded areas (36) are read in a first direction by said optical code reader means (50); and in that at least one second black preset area (40) is associated with said second white quiet zone (38) for presetting said threshold to a known value before said second white quiet zone (38) and encoded areas (36) are read in a second direction by said optical code reader means (50). The optical code reader system according to one of claims 1-4, characterized in that the encoded black and white areas (36), the first preset black area (32) and the first white quiet zone (34) are formed by providing a black pattern on a suitably contrasting background. A substrate marked with an optical code for being read by optical code reader means (50) generating an adaptive threshold, said optical code including code means (30) comprising a plurality of alternating encoded black and white areas (36), said areas being bounded on at least one side by a first substantially white quiet zone (34), CHARACTERIZED IN THAT said optical code further comprises threshold presetting means (32,40) comprising at least one first black preset area (32) associated with said first white quiet zone (34), said first black preset area (32) being positioned so that it is read prior to the first white quiet zone (34) and to the encoded black and white areas (36), for causing said optical code reader means (50) to preset said adaptive threshold to a known value. The substrate according to claim 7, characterized in that said code means (30) comprises bar code means. The substrate according to claims 7 or 8, characterized in that said plurality of alternating encoded black and white areas (36) is bounded on at least an opposite side to said first substantially white quiet zone (34) by a second substantially white quiet zone (38); and in that said at least one first black preset area (32) presets said adaptive threshold to a known value before said first white quiet zone (34) and encoded areas (36) are read in a first direction by said optical code reader means (50); and in that at least one second black preset area (40) is associated with said second white quiet zone (38) for presetting said threshold to a known value before said second white quiet zone (38) and encoded areas (36) are read in a second direction by said optical code reader means (50). The substrate according to one of claims 7 or 8, characterized in that the black and white areas (36), the first preset black area (32) and the first white quiet zone (34) are formed by providing a black pattern on a suitably contrasting background.

Inventors: EDELMANN, JOHN THOMAS, WINTER, GARY EDWARD
Applicants: ABBOTT LABORATORIES
Application year: 1988
Main classification: G06K7
IPC codes: G06K7, G06K19