Auto-Gain Control: The Reader's Self-Adjusting Eye |
Executive Summary |
This article provides a comprehensive, accessible exploration of automatic gain control (AGC) in barcode readers. We examine how this crucial feedback system continuously adjusts the signal amplification to compensate for variations in distance, surface reflectivity, barcode quality, and ambient lighting. Rather than focusing on abstract theory, we ground every concept in concrete design examples and real products from industry leaders including Microscan Systems, KEYENCE, Texas Instruments, and Omron. We explore the fundamental principle of the feedback loop, the use of modulation transfer function detection for intelligent gain decisions, the implementation of linear gain control with matched JFETs, and the practical considerations of specular reflection handling and multi-directional scanning. The article covers both the theoretical underpinnings and the real-world trade-offs between AGC and fixed gain operation. The closing summary synthesizes the key lessons and offers practical guidance for anyone designing or selecting AGC systems for barcode reading applications. |

|
Chapter 1: The Ever-Changing Signal |
A barcode reader faces a constantly changing world. The distance from the reader to the barcode varies as the user waves the device. The angle of the scan changes. The quality of the printed barcode ranges from pristine to faded and damaged. The ambient lighting shifts from dark warehouses to sun-drenched loading docks. And the surface on which the barcode is printed ranges from matte paper to shiny metal. |
The photodetector at the heart of the reader produces a current proportional to the amount of reflected light it receives. But the amplitude of that current can vary by orders of magnitude from one scan to the next. A fixed-gain amplifier simply cannot handle this dynamic range. If the gain is set too high, strong signals saturate the amplifier and clip the barcode waveform. If the gain is set too low, weak signals are buried in noise and cannot be decoded. |
The solution is automatic gain control (AGC). AGC is a feedback system that continuously monitors the signal amplitude and adjusts the gain of the amplifier to keep the signal within the optimal range for digitization and decoding. It is like a camera's automatic exposure system, constantly adjusting the aperture and shutter speed to produce a well-exposed image regardless of lighting conditions. |
The patent from Microscan Systems explains the fundamental challenge: 'the analog signal 108 should maintain constant amplitude in order to be accurately resolved into a digital signal representative of the barcode 102. Automatic gain control circuits are traditionally used to maintain the amplitude constant' . The AGC circuit provides a linear response to an input and can amplify or attenuate the analog signal accordingly. |

|
Chapter 2: The Basic AGC Feedback Loop |
At its simplest, an AGC system consists of four components: a variable gain amplifier, a detector that measures the signal amplitude, a comparator that compares the measured amplitude to a reference, and a feedback path that adjusts the gain based on the comparison. |
The variable gain amplifier is the heart of the system. Its gain is controlled by an external signal, typically a voltage or a digital value. The detector measures the amplitude of the amplifier's output, often using a peak detector or an integrator. The comparator determines whether the measured amplitude is above or below a target level. The feedback path then adjusts the gain to bring the amplitude toward the target. |
This is a classic negative feedback loop. If the signal is too strong, the gain is reduced. If the signal is too weak, the gain is increased. The loop continuously tracks changes in the input signal, maintaining a nearly constant output amplitude. |
The operation of a basic AGC system is described in an optical reading apparatus patent: the gain for the output signal of the detector in one scan direction is determined depending on the output signal level of the detector in the previous scan in the same direction. This ensures that the gain is not influenced by other scan directions, which might have different signal characteristics . |

|
Chapter 3: KEYENCE's AGC - A Practical Example |
KEYENCE, a leading manufacturer of barcode readers and sensors, provides a clear example of AGC in action. Their BL-1300 series of hi-speed digital laser barcode readers prominently features AGC as a key capability. |
KEYENCE explains the benefit of AGC in their FAQ: 'AGC regulates sensitivity of the receiving diode in the BL-700 series. When the barcode is too close to the barcode reader, the laser diode is flooded with light. On the other hand, when the barcode is on the extreme edge of reading range not enough light is reflected back into the receiving diode. AGC compensates for this increase or decrease in light quantity, thus making the reader more stable' . |
The real-world impact of AGC is documented in KEYENCE's application examples. The BL-1300 can reliably read PFA-coated barcode labels even at extreme angles, thanks to the AGC function . In engine block tracking applications, the AGC guarantees a reliable read even when the barcode labels are dirty or dusty . A stable reading is ensured even for barcodes on ceramic labels or those written by a laser marker . |
This demonstrates a key benefit of AGC: it extends the reader's operating range and makes it more forgiving of challenging conditions. The reader can handle barcodes that are close or far, clean or dirty, on matte or reflective surfaces, all without user intervention. |

|
Chapter 4: The AGC Implementation in TI's TRF7960 |
Texas Instruments' TRF7960 RFID reader IC provides a detailed example of AGC implementation in an integrated circuit. While designed for RFID, the principles are directly applicable to barcode readers. |
The TRF7960 includes a main receiver with a second receiver gain and digitizer stage which is included in the AGC loop . The AGC loop is activated by setting a bit in the Chip Status Control register. When activated, the AGC continuously monitors the input signal level. If the signal level is significantly higher than an internal threshold level, gain reduction is activated . |
A key feature of the TRF7960's AGC is its 'freeze' capability. By default, the AGC is frozen after the first four pulses of the subcarrier signal. This prevents the AGC from interfering with the reception of the remaining data packet . The patent also notes that 'the AGC action is fast, typically finishing after a few pulses' . |
The TRF7960 also provides a range of gain reduction settings. The receiver gain can be reduced by 5 dB, 10 dB, or 15 dB, selected via register settings. The AGC activation level can be changed from five times the minimum digitizing level to three times the minimum digitizing level . This granularity allows fine-tuning of the AGC response for different operating conditions. |

|
Chapter 5: Microscan's Advanced AGC with MTF Detection |
Microscan Systems developed a particularly sophisticated AGC system that uses modulation transfer function (MTF) detection to make intelligent gain decisions. This system, described in a patent, goes beyond simple amplitude detection to consider the frequency content of the signal. |
The problem that Microscan addressed is that the signal amplitude alone does not tell the whole story. Barcodes that are out of focus produce signals where the high-frequency components (the narrow bars and spaces) have lower amplitude than the low-frequency components (the wide bars and spaces). This is characterized by the MTF, which is the ratio of high-frequency amplitude to low-frequency amplitude. |
The Microscan patent describes an MTF detector that generates a value representative of a low frequency portion of the analog signal (wide or out of optical focus elements) and a second value representative of a high frequency portion (narrow elements or in optical focus elements) . The processor uses these values, along with a reference amplitude, to determine a gain signal. |
This approach allows the AGC to make smarter decisions. If the high-frequency amplitude is disproportionately less than the low-frequency amplitude (indicating that the barcode is out of focus), the system can amplify the signal to bring the high-frequency components into range. This is important because even if the overall signal amplitude is adequate, the high-frequency components may be too weak for reliable digitization. |
The patent describes the algorithm: 'the processor 308 determines that the Gain High signal is disproportionately less than the Gain Low signal and the reference amplitude 204. In this embodiment, the new gain signal can inform the AGC circuit 304 to amplify the analog signal 202/203 regardless of whether such amplification will cause the Gain Low signal to exceed the reference amplitude 204' . |

|
Chapter 6: Linear AGC with Matched JFETs |
A key innovation in the Microscan AGC system is the use of matched JFETs (junction field-effect transistors) to provide a linear response to the gain signal. Many traditional AGC circuits use complex control equations and can be nonlinear, making it difficult to predict the gain setting. |
The Microscan patent describes a circuit where 'the AGC circuit 304 can provide a linear response to an input and can amplify or attenuate the analog signal 202/203 accordingly' . The linear response is achieved using matched JFETs. |
The operation is described in the patent: 'Because the JFET Q4 is driven by and loaded with similar impedances as JFET Q7, and because it is in the regulating feedback path of U4, the output from the AGC circuit 304 can be linear over a very wide dynamic range (which in turn results in a very wide range of reading distances, e.g., close to the barcode 102 and far away from the barcode 102)' . |
The patent contrasts this with other known circuitry that 'requires complex control equations to implement and often limit predictive gain adjustments' . The AGC circuit implemented with matched JFETs uses inexpensive components to linearize the response to the gain signal input. As a result, 'the response of the AGC circuit 304 to the gain signal from the processor 308 can be predicted and deterministic' . |
This linearity is a significant advantage for barcode readers. A predictable, deterministic gain response simplifies the design of the control loop and makes it easier to achieve stable operation across a wide range of conditions. |

|
Chapter 7: Specular Reflection Control |
A common challenge for AGC in barcode readers is specular reflection. When the laser beam hits a metallic or mirrored surface, the strong reflected light can overwhelm the photodetector and confuse the AGC. |
KEYENCE addresses this with a feature called SRC, or Specular Reflection Control. As described in their FAQ: 'When the laser beam from the barcode hits a metallic or mirrored surface, the strong reflected light affects automatic gain control adjustment. To reduce this phenomenon SRC has been incorporated in the BL-700 series. When the reflected light over the given level is reflected back into the receiving diode, SRC cancels this reflected light and then turns AGC ON' . |
This is a clever solution: instead of trying to make the AGC immune to specular reflections (which can be difficult), the system cancels the reflected light before the AGC sees it. This ensures that the AGC adjusts the gain based on the signal from the barcode, not the glare from the surface. |
This is an important capability for industrial applications where barcodes are often on shiny surfaces. Without SRC or a similar technique, the AGC might reduce the gain in response to the glare, making it impossible to read the barcode. |

|
Chapter 8: AGC and Multi-Directional Scanning |
Some barcode readers use multi-directional scanning, where the laser beam scans in multiple directions to improve reading performance. AGC in multi-directional scanners presents unique challenges. |
A patent describes a symbol read device with automatic gain control where each scan direction has its own gain setting. The gain for the output signal of the detector in one scan direction is not influenced by the output signal in other scan directions . This is implemented with separate automatic gain control circuits for each scan direction, or with a single variable gain amplifier and multiple sample-and-hold circuits. |
The patent explains: 'A gain of the automatic gain control circuit AGC1 in the present alpha-direction scan is determined depending on the output signal level of the detector 22 in the previous alpha-direction scan, and hence it is not influenced by the output signals of the detector 22 in the beta-direction scan and the gamma-direction scan' . |
This is important because different scan directions may have different signal characteristics. If the AGC for one direction is affected by a strong signal in another direction (for example, a specular reflection), the gain for the first direction could be incorrectly adjusted. |
The patent also describes a unidirectional scan mode where only one AGC circuit is active, and the others are disabled. This is useful when multiple barcodes are arrayed side by side and the multi-directional scan mode might lead to misreading of an undesired barcode . |

|
Chapter 9: AGC and the Digitizer |
The AGC and the digitizer work closely together in a barcode reader. The digitizer converts the analog signal into a digital pulse stream, and its performance is optimum when the analog signal is within a certain amplitude range. |
The Microscan patent explains: 'The digitizer 306 receives the analog signal 202/203 and can convert it to a digital signal 314 (e.g. square wave) representative of the barcode 102. In one embodiment, the performance of the digitizer 306 is optimum when the analog signal 202/203 is within the reference amplitude 204' . |
The AGC maintains the signal within this reference amplitude, ensuring that the digitizer can accurately convert the analog signal to a digital pulse stream. If the signal is too weak, the digitizer may miss edges or introduce noise. If the signal is too strong, the digitizer may saturate and clip the waveform. |
The sample/hold circuit described in an optical reading apparatus patent is a key part of this chain. The AGC's output is transmitted via a diode to a capacitor that holds the peak value of the output signal. This peak value is then sampled and held for the digitizer . |

|
Chapter 10: AGC vs. Fixed Gain |
While AGC is the preferred mode for most barcode reading applications, there are situations where fixed gain operation is preferable. The Omron Microscan manual provides a clear explanation of the trade-offs. |
The manual states: 'The AGC settings (Leading Edge or Continuous) are preferable for most applications, as they provide the best overall scannable area. However, there are times when AGC will have difficulty locking onto the symbol of interest, especially when extraneous non-symbol objects in the field of view appear to be symbols. AGC can only base its measurements on one object. If that object is not the actual symbol, AGC performance and consistency are adversely affected' . |
The manual also describes the 'Leading Edge' and 'Continuous' AGC modes. 'Leading Edge bases its calculations on the first object it detects, even if the first object is not a symbol. This is helpful if the symbol is always at the leading edge of the decode direction. Continuous is the recommended setting for Omron Microscan scanners. Continuous always samples throughout the entire scan but is most interested in the object with the most sharply-defined bars. This can occasionally mislead the scanner when bar-like objects or specular reflection enter the field of view' . |
Fixed Gain is recommended 'if AGC repeatedly fails to choose the correct Gain Level setting for the application. In some applications, symbols might be surrounded by a greater number of symbol-like false candidates than actual symbols. The Fixed Gain setting will never change its value, so once it is set, surrounding objects in the field of view will not distract the scanner from decoding actual symbols' . Fixed Gain is also useful in applications using symbols that have very low bar counts, or in applications using Symbol Reconstruction on symbols with tilted or skewed placement . |

|
Chapter 11: Setting AGC Limits |
Another practical consideration is setting appropriate limits for the AGC. The Omron Microscan manual describes AGC Minimum and AGC Maximum parameters that are useful in applications with depth of field limitations that are not conducive to Fixed Gain operation . |
The manual provides guidance for determining the appropriate minimum and maximum gain: 'Set AGC Sampling Mode to Disabled (Fixed Gain) and find the range of gain levels that yields successful decodes in the application (both the lowest and the highest gain levels). Enter those values in the AGC Minimum and AGC Maximum fields. This will leave the scanner room for gain changes to increase depth of field (within the limitations of what works for the application)' . |
The manual also warns about the risks of setting the gain too high: 'Maximum gain may be too high for symbols on white backgrounds, because it may attempt to process false bars. Especially in applications using symbologies that require more processing, setting gain too high can slow decode performance substantially. Setting a minimum gain can prevent the system from occasionally 'under-gaining' because of previous false candidates that appear very bright' . |
Chapter 12: The SETPOINT Concept |
The Omron Microscan manual introduces the concept of SETPOINT in the AGC system. 'The actual attenuation factor is determined by the return light from the symbol and the 'SETPOINT' value that the control system is attempting to hold. (SETPOINT is an abstracted number range that has to do with the feedback system's dynamic range.) A very low SETPOINT value of 0-20 would tend to keep the symbol amplitude low. A very high SETPOINT value of 150-255 would tend to keep the symbol amplitude high. The gain will change to hold the feedback value equal to the user SETPOINT setting of amplitude (Gain Level) at all times' . |
This SETPOINT concept is common in feedback control systems. The SETPOINT is the target value that the system tries to maintain. In a barcode reader, the SETPOINT corresponds to the desired signal amplitude. The AGC adjusts the gain to keep the actual amplitude as close to the SETPOINT as possible. |
The manual also describes the 'Fixed Gain' mode where 'the system takes the total gain range and divides it into 255 steps. Then the value of the Gain Level setting is converted directly into the gain value. Nothing will change this value unless the user changes the Gain Level setting' . |

|
Chapter 13: The AGC and the Modulation Transfer Function (MTF) |
The modulation transfer function (MTF) is a key concept in the Microscan AGC system. The MTF describes the ratio of high-frequency (narrow bars and spaces) signal amplitude to low-frequency (wide bars and spaces) signal amplitude. |
The Microscan patent explains the importance of the MTF: 'One characteristic of barcode scanning platforms and the focus point is that sometimes the amplitudes of the portions of the analog signal 108 associated with the narrow bars and spaces are different from (e.g., less than) the amplitudes of the portions of the analog signal 108 associated with the wider bars and spaces. This commonly occurs when the optical spot size is larger than the narrowest bars and spaces. The ratio of amplitudes of the portions of the analog signal 108 associated with the narrow bars and spaces to the amplitudes of the portions of the analog signal 108 associated with the wide bars and spaces is referred to as a 'modulation transfer function' or MTF and it can be used to describe the characteristics of the analog signal 108' . |
When the MTF is less than one hundred percent, it can be difficult for the analog signal to be accurately resolved into a digital signal representative of the barcode. This is because the narrow elements (which contain the high-frequency information) are attenuated relative to the wide elements. |
The Microscan AGC uses the MTF to make intelligent gain decisions. If the high-frequency components are weak, the AGC can amplify the signal to bring them into range, even if the low-frequency components are already at the correct amplitude. This ensures that both the low-frequency and high-frequency components are properly digitized. |
Chapter 14: Paper Noise and the AGC |
The Microscan patent also addresses the issue of 'paper noise.' When the optical spot size becomes very small (at the focus point), the energy in the optical signal is more concentrated on the material carrying the barcode. The fibers, grains, pits, etc. themselves begin to absorb and reflect the energy, causing what is commonly referred to as 'paper noise' . |
Paper noise tends to degrade the signal-to-noise ratio (SNR) of the analog signal. When the SNR is degraded, it can be difficult for the analog signal to be accurately resolved into a digital signal. |
The Microscan system includes a selectable noise filter that can be enabled or disabled based on the MTF values and/or the read rate. This provides an additional layer of signal conditioning, ensuring that the signal reaching the AGC and digitizer is as clean as possible. |

|
Chapter 15: Sample/Hold and Peak Detection |
The sample/hold circuit is a critical component in the AGC feedback loop. It captures the amplitude of the signal and holds it for the duration of the gain adjustment cycle. |
An optical reading apparatus patent describes a sample/hold circuit that uses an analog switch and a capacitor. The peak value of the output signal is held by a capacitor, and then an analog switch intermittently transmits this peak value to another capacitor where it is stored until the next sampling instant . |
The patent describes both average and peak detection approaches. The sampling and holding means can 'successively sample and hold a respective average voltage of said electrical signal for each of successive scanning operations' or 'successively sample and hold a respective peak voltage of said electrical signal for each of successive scanning operations' . |
The choice between average and peak detection depends on the application. Peak detection is common in barcode readers because the peaks of the signal (the bars and spaces) contain the most important information. Average detection may be more appropriate in some cases, such as when the signal is noisy or when the barcode has low contrast. |
Chapter 16: The Integrator in the AGC Loop |
An integrator is often used in the AGC feedback loop to smooth the control signal and prevent rapid gain changes. The integrator averages the error signal over time, providing a stable control voltage. |
The optical reading apparatus patent describes an integrator comprising a resistor and a capacitor. The output of the integrator is sampled and held by the sample/hold circuit, and then used to control the gain of the amplifier . |
The time constant of the integrator is an important design parameter. If the time constant is too short, the gain will change too quickly, potentially responding to noise or transient signals. If the time constant is too long, the gain will change too slowly, potentially missing changes in the signal amplitude. |
The patent describes a 'control circuit having a voltage follower providing an output signal responsive to the output voltage across said circuit capacitor, and having an inverting amplifier, responsive to the output signal from said voltage follower' . This control circuit converts the sampled voltage into a control signal for the variable gain amplifier. |

|
Chapter 17: The FET as a Variable Impedance Element |
A field-effect transistor (FET) can be used as a variable impedance element in the AGC circuit. The FET's drain-source impedance is controlled by the voltage on its gate, making it a convenient way to implement a voltage-controlled gain stage. |
The optical reading apparatus patent describes an AGC circuit where the gate of an N-channel FET receives the output signal from the control circuit. 'In receipt of such a signal at the gate, the impedance between the drain and source of the FET 11a will be determined by the voltage at the gate' . |
The FET is used in a voltage divider configuration with a resistor. The output voltage of the operational amplifier is divided by the voltage divider comprising the resistor and the FET. This divided voltage is fed back to the amplifier, controlling its gain. |
The patent notes that 'the automatic gain control circuit comprises an element whose impedance varies in accordance with said sampled voltage' . This element is the FET, which provides a simple and effective way to control the gain. |
This is a different implementation from the matched JFET approach described in the Microscan patent, but it serves the same purpose: controlling the gain with a voltage signal derived from the feedback loop. |
Chapter 18: Waveform Shaping and Filtering |
After the AGC, the signal is typically passed through a waveform shaping circuit. This circuit removes noise and prepares the signal for digitization. |
The optical reading apparatus patent describes a waveform shaping circuit comprising a sample-and-hold circuit and a low pass filter . The sample-and-hold circuit samples the AGC output, and the low pass filter removes high-frequency noise. |
The low pass filter's cutoff frequency is set to a value 'which is lower than the frequency of the continuous signal corresponding to a wide bar of the bar code 1a, from the sample-and-hold circuit 15A' . This ensures that the barcode signal is passed while higher-frequency noise is rejected. |
The output of the low pass filter is then applied to a comparator that converts the analog signal into a binary signal corresponding to the black bars and white bars. The comparator uses inverse-parallel connected diodes and a capacitor to produce a reference signal for comparison . |

|
Chapter 19: AGC in UHF RFID Readers |
The principles of AGC are not limited to barcode readers. UHF RFID readers, which share many of the same signal conditioning challenges, also use AGC to handle varying signal strengths. |
A paper on a UHF RFID reader system based on the AS3992 UHF Reader chip describes the design of the AGC circuit. 'By designing the automatic gain control(AGC) circuit and the antenna impedance automatic matching circuit, the transmit power is up to 33dBm and the receiver SNR is improved at the same time' . The reader system achieved high-speed identification of RFID tags with a stable reading range up to 10 meters . |
This demonstrates the broader applicability of AGC techniques. The same principles that allow a barcode reader to adapt to varying distances and surface reflectivity also allow an RFID reader to adapt to varying tag responses. |
Chapter 20: The Future of AGC in Barcode Readers |
The future of AGC in barcode readers is likely to involve greater integration and more sophisticated control algorithms. The trend toward integration, already evident in devices like the TRF7960, will continue, with AGC being combined with other signal processing functions on a single chip. |
The use of advanced detection algorithms, like the MTF detection described in the Microscan patent, will become more common. These algorithms allow the AGC to make smarter decisions, optimizing the signal not just for amplitude but also for frequency content. |
Digital signal processing will play an increasing role in AGC. Instead of analog control loops, digital processors can implement complex algorithms that adapt to changing conditions. This allows for more flexible and adaptive AGC systems. |
The integration of AGC with other functions, such as automatic focusing and illumination control, will create more intelligent barcode readers that can automatically optimize their performance for any scanning condition. |

|
Chapter 21: AGC and the Digitizer's Reference Amplitude |
The AGC and the digitizer share a common goal: producing a clean, reliable digital signal from the analog barcode waveform. The digitizer's performance is optimum when the analog signal is within a specific amplitude range, which is the reference amplitude. |
The Microscan patent explains this relationship: 'The digitizer 306 receives the analog signal 202/203 and can convert it to a digital signal 314 (e.g. square wave) representative of the barcode 102. In one embodiment, the performance of the digitizer 306 is optimum when the analog signal 202/203 is within the reference amplitude 204' . |
The AGC maintains the signal within this reference amplitude. The reference amplitude is the target for the feedback loop. The AGC adjusts the gain to keep the signal's amplitude as close to the reference amplitude as possible. |
If the signal is too weak, the digitizer may have difficulty detecting the edges of the barcode. If the signal is too strong, the digitizer may saturate, clipping the waveform and distorting the pulse widths. |

|
Chapter 22: AGC and the Selectable Noise Filter |
The Microscan system includes a selectable noise filter that can be enabled or disabled based on various conditions. The filter is coupled to the input of the AGC circuit and to the processor . |
The selectable noise filter can be used to attenuate noise and improve the signal-to-noise ratio (SNR) of the analog signal. The filter can be enabled or disabled based on the MTF values (Gain High and Gain Low) and/or the read rate . |
This provides an additional layer of signal conditioning. If the signal is noisy (for example, due to paper noise), the filter can be enabled to remove the noise. If the signal is clean, the filter can be disabled to preserve the signal's bandwidth. |
The ability to selectively enable the noise filter is a valuable feature. It allows the reader to adapt to different conditions without sacrificing performance. |
Chapter 23: The AGC in the Sample/Hold Circuit of the Waveform Shaper |
The waveform shaping circuit in the optical reading apparatus patent includes a sample/hold circuit that is an integral part of the AGC loop. The sample/hold circuit captures the peak value of the AGC output and holds it for the digitizer. |
The patent describes the operation: 'the analog output signal from the AGC circuit 11 is transmitted via a diode 15a to a capacitor 15b so that the peak value of the output signal is held by the capacitor 15b. An analog switch 15c performs on-off operation in response to the sampling pulse signal from the sampling pulse generator 22a so that the peak value stored in the capacitor 15b is intermittently transmitted to a capacitor 15d' . |
This sample/hold circuit ensures that the peak values of the signal (the bars and spaces) are captured and held for the digitizer. The buffer 'is adapted to discharge the capacitor 15b after the analog switch 15c opens with the voltage across the capacitor 15b being transmitted to the capacitor 15d, in synchronism with the sampling pulse so that the capacitor 15b is prepared to holding operation on next sampling' . |
The output of the sample/hold circuit is then passed through a low pass filter to remove noise and provide a continuous signal for the digitizer. |

|
Chapter 24: The AGC and the Comparator Reference |
The comparator in the digitizer uses a reference signal to determine the threshold between bars and spaces. This reference signal is derived from the analog signal itself. |
The optical reading apparatus patent describes how the reference signal is generated: 'In the comparator 16, the references 16a and 16b are inverse-parallel connected diodes, 16c a capacitor, with both diodes and capacitor being connected to a noninverting input terminal of an operational amplifier 16d. Namely, the amplitude of the input signal is reduced by the forward voltage drop of the diodes 16a and 16b, while the phase of the input signal is shifted by the capacitor 16c to provide a reference signal for the comparison with the input signal' . |
The operational amplifier compares the output signal from the low pass filter with the reference signal to obtain a binary signal at its output. This binary signal corresponds to the black and white bars of the barcode. |
The AGC ensures that the signal amplitude is within the range where the comparator can operate effectively. If the signal is too weak, the comparator may not be able to distinguish bars from spaces. If the signal is too strong, the comparator may saturate. |
Chapter 25: The AGC and the Control Circuit |
The control circuit is the 'brain' of the AGC system. It takes the sampled signal from the sample/hold circuit and generates the control voltage for the variable gain amplifier. |
The optical reading apparatus patent describes a control circuit with a voltage follower and an inverting amplifier. 'A control circuit 14 having a voltage follower providing an output signal responsive to the output voltage across said circuit capacitor, and having an inverting amplifier, responsive to the output signal from said voltage follower' . |
The voltage follower provides a buffered version of the sampled voltage. The inverting amplifier amplifies and inverts this signal, producing a control voltage that is applied to the gate of the FET in the AGC circuit. |
This control circuit is a simple but effective implementation of the AGC feedback loop. The sampled signal determines the gain, and the gain determines the sampled signal, creating a stable feedback loop. |

|
Chapter 26: AGC and the Scan Direction Detector |
In multi-directional scanners, the scan direction detector informs the AGC which scan direction is active. This allows the AGC to select the appropriate gain setting for that direction. |
The symbol read device patent describes a scan direction detector that determines which scan direction (alpha, beta, or gamma) is active. This information is used to select the appropriate sample/hold circuit and gain setting . |
The controller receives the output signal of the scan direction detector and controls the selectors and the automatic gain control circuits accordingly. During the period of the alpha-direction scan, the circuits are connected to the sample/hold circuit for the alpha-direction. During the beta-direction scan, they are connected to the sample/hold circuit for the beta-direction, and similarly for the gamma-direction . |
This ensures that the gain for each scan direction is determined independently, based on the signal level in that direction only. |
Chapter 27: AGC and the Gain Setting in Multi-Directional Scanners |
The symbol read device patent describes the operation of the automatic gain controller in detail. The gain for the output signal of the detector in one scan direction is not influenced by that for the output signal in other scan directions . |
The patent explains: 'Even if the regular reflection light from the symbol surface or an object of high reflectivity, for example, metal, in the beta-direction scan or gamma-direction scan is incident on the detector 22, a gain set by the automatic gain control circuit AGC1 corresponding to the alpha-direction scan will not be extremely small. As a result, the bar code read device can recognize the bar code 18 read through alpha-direction scan, free from the influence by the regular reflection light' . |
This is a key benefit of independent gain control for each scan direction. Specular reflections in one direction do not affect the gain in other directions, ensuring reliable reading even when glare is present. |

|
Chapter 28: AGC and the Unidirectional Scan Mode |
The symbol read device patent also describes a unidirectional scan mode where only one scan direction is active. This is useful when multiple barcodes are arrayed side by side and the multi-directional scan mode might lead to misreading of an undesired barcode. |
The patent explains: 'When a plurality of bar codes are arrayed side by side, if the symbol recognition is performed through all of the alpha, beta, and gamma-direction scans, the bar code read device may mistakenly read a bar code, which is not the bar code to be read' . |
In the unidirectional scan mode, an operator selects the desired scan direction. 'In response to this, the controller 32 permits only the automatic gain control circuit corresponding to the selected scan direction in the automatic gain controller 81 to operate, which prohibits the remaining automatic gain control circuits from operating' . |
This ensures that the gain is set only for the active scan direction, and that the other directions do not interfere with the reading process. |
Chapter 29: AGC and the Selector Circuit |
The symbol read device patent describes selector circuits that route the gain control signals. The selector circuits can be configured in different states, depending on the scan mode. |
The patent explains: 'The selector circuits having terminals not connected to any of the automatic gain control circuits AGC1 to AGC3 are used for the select circuits 61 and 63. Under control of the controller 32, the control circuits are set up in either of two states, one in which they are connected to the automatic gain control circuit corresponding to the scan direction selected by selector 34, and the other in which they are not connected to any of the automatic gain control circuits' . |
In the unidirectional scan mode, the selector circuits are connected to the automatic gain control circuit corresponding to the selected scan direction. In the multi-directional scan mode, the selector circuits are connected to the appropriate automatic gain control circuit based on the current scan direction. |

|
Chapter 30: AGC and the Modified Unidirectional Mode |
The symbol read device patent describes a modified unidirectional scan mode where the gain for the non-selected directions is not set to zero but is set to a fixed value. This is useful when the distance between the bar code and the device is short. |
The patent explains: 'the gain corresponding to the scan direction not selected by the selector 34 is not set to 0, but is set to a fixed value given when the symbol surface 4 is located close to the device' . |
This allows the reader to operate in a mixed mode. When the distance is short, the multi-directional scan mode is used. When the distance is long, the unidirectional scan mode is used. This provides flexibility and improves reading performance in different conditions. |
The patent notes: 'when the distance between the bar code and the symbol surface is short, the multi-directional scan mode is selected and the bar code recognition processing is performed using the data gathered through the scan. When the distance is long, the unidirectional scan mode is selected and the bar code recognition processing is performed using the data gathered through the scan' . |
Chapter 31: AGC and Multiple Scan Lines Grouping |
The symbol read device patent also describes grouping multiple scan lines into groups, with one automatic gain control circuit per group. This is useful when a large number of scan lines (e.g., eight) are used. |
The patent explains: 'In this case, the positions scanned by the scan lines closely located are little different from each other. Therefore, use of equal gains for the output signals of the detector for two to three scan lines closely located, becomes little problematic in practical use' . |
The scan lines are gathered into groups, and the automatic gain control circuit is provided for each group. In the arrangement of the symbol read device, the sample/hold circuit is provided for each group . |
This reduces the number of automatic gain control circuits required, lowering the cost of the device. The trade-off is that the gain is not independently controlled for each scan line, but the practical impact is small because the scan lines in a group are closely located and have similar signal characteristics. |

|
Chapter 32: AGC and the FET as a Variable Resistor in the Feedback Path |
The Microscan patent describes a different implementation of the AGC circuit using an FET in the feedback path. The FET acts as a variable resistor, controlling the gain of the amplifier. |
The patent describes the circuit: 'R26 and the equivalent resistance of JFET Q7 determine the gain of U3A. JFET Q4 and Q7 are matched transistors. R41, R43, and C24 are bias elements for the main gain JFET Q7. R35, R39, and C17 are similar bias elements for the regulating JFET Q4' . |
The gain signal from the processor controls U4. U4 buffers the gain signal and drives JFET Q7 and JFET Q4. The JFET Q4 is in the positive feedback path of U4 . |
This configuration provides a linear response to the gain signal over a wide dynamic range. The matched JFETs ensure that the response is predictable and deterministic. |
Chapter 33: AGC and the Bias Elements |
The bias elements in the AGC circuit are critical for proper operation. The bias elements set the operating point of the JFETs and ensure that they are in the correct region for linear operation. |
The Microscan patent describes the bias elements: 'R41, R43, and C24 are bias elements for the main gain JFET Q7. R35, R39, and C17 are similar bias elements for the regulating JFET Q4' . |
The bias elements provide the correct DC voltages to the gates and sources of the JFETs. The capacitors provide filtering and stabilization, ensuring that the JFETs operate in a stable and predictable manner. |
The patent also describes filters for power supply stability: 'R19 and C10, R4, and C4 are power supply (e.g., 5 volts) filters for U3A' . These filters remove noise from the power supply, ensuring that the AGC circuit is not affected by power supply variations. |

|
Chapter 34: AGC and the High-Frequency Compensation Filter |
The Microscan patent describes a high-frequency compensation filter (C21) that is used to roll off noise and provide signal stability. This filter is essential for maintaining the stability of the AGC feedback loop. |
The patent explains: 'C21 provides a high-frequency compensation filter to roll off noise and provide signal stability for amplifier U3A' . |
The high-frequency compensation filter prevents the AGC loop from oscillating at high frequencies. The filter reduces the gain at high frequencies, ensuring that the loop remains stable. |
The patent also describes a low-frequency DC blocking filter: 'C22 and R24 provide a low-frequency DC blocking filter to reduce bias voltages for U4 and FET Q7 from interacting to produce inappropriate DC output offset and asymmetry for the analog signal 202/203' . |
This DC blocking filter prevents DC offsets from accumulating in the signal path, ensuring that the AGC output is centered around the correct reference level. |
Chapter 35: AGC and the Gain Control Signal from the Processor |
The Microscan patent describes the role of the processor in the AGC loop. The processor generates the gain control signal based on the MTF values and the reference amplitude. |
The patent explains: 'the processor 308 can decode the digital signal 314, can measure and convert the Gain High signal and the Gain Low signal into digital values, measure the digital values, compare the digital values to the reference amplitude 204, and determine whether the analog signal 202/203 should be amplified, or attenuated, or remain the same' . |
The processor then provides the gain signal to the AGC circuit. The AGC circuit uses the gain signal as the basis for amplifying or attenuating the analog signal . |
This digital control of the AGC is a key feature of the Microscan design. It allows for sophisticated control algorithms and easy reconfiguration, making the AGC adaptable to different conditions. |

|
Chapter 36: AGC and the Linear Response |
The linear response of the AGC circuit is a key advantage of the Microscan design. Unlike many traditional AGC circuits that have nonlinear responses, the Microscan AGC provides a linear response to the gain signal. |
The patent explains: 'the AGC circuit 304 can provide a linear response to an input and can amplify or attenuate the analog signal 202/203 accordingly' . |
This linear response is achieved using the matched JFETs. The linear response makes it easier to control the gain and ensures that the gain adjustments are predictable. |
The patent notes that 'the response of the AGC circuit 304 to the gain signal from the processor 308 can be predicted and deterministic' . This predictability is a significant advantage for system design and performance. |
Chapter 37: AGC and the Wide Dynamic Range |
The wide dynamic range of the AGC circuit is another key advantage. The AGC can handle a very wide range of input signal amplitudes, from very close to the reader (strong signal) to very far away (weak signal). |
The patent explains: 'the output from the AGC circuit 304 can be linear over a very wide dynamic range (which in turn results in a very wide range of reading distances, e.g., close to the barcode 102 and far away from the barcode 102)' . |
This wide dynamic range is essential for barcode readers, which must handle a wide range of distances and surface reflectivities. The AGC ensures that the signal is always within the range of the digitizer, regardless of the reading conditions. |
The wide dynamic range is achieved through the careful design of the AGC circuit, including the matched JFETs and the feedback configuration. |

|
Chapter 38: AGC and the Predictable Gain Adjustments |
The predictable gain adjustments of the Microscan AGC are a significant advantage over other AGC implementations. The gain adjustments are deterministic, meaning that they can be predicted and controlled. |
The patent explains: 'Unlike other known circuitry that requires complex control equations to implement and often limit predictive gain adjustments, the AGC circuit 304 implemented according to embodiments of the present invention uses inexpensive matched JFETs to linearize the response to the gain signal input. As a result, the response of the AGC circuit 304 to the gain signal from the processor 308 can be predicted and deterministic' . |
This predictability simplifies the design of the control loop and makes it easier to achieve stable operation. The processor can calculate the required gain adjustment and apply it with confidence, knowing that the AGC will respond in a predictable manner. |
Chapter 39: AGC and the Specular Reflection Challenge |
Specular reflection is a significant challenge for AGC in barcode readers. When the laser beam hits a shiny surface, the strong reflected light can saturate the photodetector and cause the AGC to reduce the gain, making it impossible to read the barcode. |
KEYENCE's SRC (Specular Reflection Control) feature addresses this challenge by canceling the reflected light before it reaches the AGC. 'When the reflected light over the given level is reflected back into the receiving diode, SRC cancels this reflected light and then turns AGC ON' . |
This is a different approach from simply trying to make the AGC immune to specular reflections. By canceling the reflected light, the SRC ensures that the AGC sees only the signal from the barcode, not the glare. |
This is an important capability for industrial applications where barcodes are often on shiny surfaces, such as metal parts or plastic packaging. |

|
Chapter 40: AGC and the Dirty or Damaged Barcode |
Dirty or damaged barcodes present another challenge for AGC. The dirt or damage can reduce the contrast of the barcode, making it harder to distinguish bars from spaces. |
KEYENCE's application examples demonstrate that AGC can help with this challenge. The BL-1300 can reliably read barcodes even if they are 'dirty or dusty' . The AGC compensates for the reduced contrast by increasing the gain, bringing the signal into the range of the digitizer. |
This is a significant benefit for industrial environments where barcodes are often subjected to dirt, dust, and wear. The AGC ensures that the reader can continue to operate reliably even when the barcodes are not in perfect condition. |
Chapter 41: AGC and the Reading of Wafer Carriers |
A specific application example from KEYENCE illustrates the power of AGC in demanding environments. The BL-1300 can reliably read PFA-coated barcode labels even at extreme angles . |
PFA (perfluoroalkoxy) is a type of plastic coating that can be highly reflective and difficult to read. The extreme angles make the reading even more challenging. The AGC function ensures that the reader can compensate for the reduced reflected light, even at extreme angles. |
This is important for semiconductor manufacturing, where wafer carriers often have barcodes that must be read reliably. The AGC ensures that the reader can operate in this demanding environment. |

|
Chapter 42: AGC and the Reading of Test Tubes |
Another application example is the reading of medical test tubes. The BL-1300's compact body and high speed reading capability allow it to easily read the barcodes on medical test tubes . |
Medical test tubes often have curved surfaces, which can distort the barcode image. The AGC compensates for the variations in reflected light caused by the curvature, ensuring a reliable read. |
This is important for medical laboratories, where accurate tracking of test tubes is essential. The AGC ensures that the reader can operate reliably in this application. |
Chapter 43: AGC and the Reading of Ceramic Labels |
The BL-1300 can also read barcodes on ceramic labels or those written by a laser marker . Ceramic labels can have low contrast and high reflectivity, making them difficult to read. |
The AGC compensates for the low contrast by increasing the gain, bringing the signal into the range of the digitizer. The AGC also compensates for the high reflectivity by adjusting the gain to prevent saturation. |
This is important for manufacturing and tracking applications where barcodes are often marked on ceramic or metal parts. |

|
Chapter 44: AGC and the Engine Block Tracking |
In automotive manufacturing, engine blocks are often tracked using barcodes. The barcode labels can be dirty or dusty from the manufacturing process. The BL-1300's AGC guarantees a reliable read even if the barcode labels are dirty or dusty . |
This is important for automotive manufacturing, where accurate tracking of engine blocks is essential for quality control and traceability. The AGC ensures that the reader can operate reliably in this challenging environment. |
Chapter 45: Summary --- Auto-Gain Control in Perspective |
Automatic gain control is the reader's self-adjusting eye. It continuously adapts the signal amplification to compensate for variations in distance, surface reflectivity, barcode quality, and ambient lighting, ensuring that the signal is always at the optimal level for digitization and decoding. |
We have examined how different companies and technologies have approached the challenges of AGC: |
KEYENCE provides a practical example of AGC in action with their BL-1300 series. The AGC function compensates for increases or decreases in light quantity, making the reader more stable. SRC (Specular Reflection Control) enhances AGC by canceling reflected light from metallic surfaces . |
Microscan Systems developed a sophisticated AGC system that uses MTF (modulation transfer function) detection to make intelligent gain decisions based on both low-frequency and high-frequency components of the signal. The AGC circuit provides a linear response using matched JFETs, and a selectable noise filter can be enabled or disabled based on MTF values and/or the read rate . |
Texas Instruments implemented AGC in their TRF7960 RFID reader IC. The AGC loop continuously monitors the input signal level and activates gain reduction when needed. A key feature is the 'AGC freeze' that prevents the AGC from interfering with data packet reception . |
Omron Microscan provides guidance on when to use AGC versus Fixed Gain. AGC is preferable for most applications, but Fixed Gain may be better in applications with many symbol-like false candidates . |
Optical reading apparatus patents describe AGC implementations with sample/hold circuits, integrators, and FETs as variable impedance elements. These circuits sample peak or average voltages and use them to control the gain . |
Symbol read device patents describe AGC in multi-directional scanners, with independent gain control for each scan direction. This prevents specular reflections in one direction from affecting the gain in other directions . |

|
The key lessons from our exploration are: |
AGC extends the reader's operating range. By compensating for variations in signal strength, AGC allows the reader to handle barcodes that are close or far, clean or dirty, on matte or reflective surfaces. |
AGC adapts to changing conditions. The feedback loop continuously monitors the signal and adjusts the gain, ensuring that the digitizer always receives a signal within its optimal range. |
AGC can be implemented with analog or digital control loops. Analog AGC circuits use peak or average detectors and variable gain stages. Digital AGC circuits use processors and digital-to-analog converters. |
AGC must be used with care in certain applications. Specular reflections and symbol-like false candidates can confuse the AGC, leading to incorrect gain settings. Features like SRC and AGC limits can help mitigate these challenges. |
AGC is a key enabler of reliable barcode reading. Without AGC, barcode readers would be limited to a narrow range of reading conditions. AGC makes the reader adaptable, forgiving, and reliable. |
In the end, auto-gain control is a testament to the power of feedback. It is the mechanism that allows a barcode reader to see clearly in a world of changing conditions, adjusting its 'eye' to the perfect setting for every scan. The art of AGC lies in the careful balance of speed, accuracy, and robustness, creating a reader that is always ready to read. |