The DC Offset Problem: How Barcode Scanners Tame the Unwanted Baseline |
Subtitle: A Deep Dive into Ambient Light, Dark Current, and the Art of AC Coupling - with Real-World Designs from Symbol, Zebra, Honeywell, Datalogic, Texas Instruments, and Analog Devices |

|
Opening Summary |
Every barcode scanner faces a silent enemy: the DC offset. This is an unwanted, constant voltage that sits on top of the barcode signal, pushing it off the ideal baseline. The offset comes from several sources: ambient light that floods the photodetector, the photodetector's own dark current, and the input offset voltage of the amplifier. If left uncorrected, the DC offset can saturate the amplifier, reducing the dynamic range and distorting the barcode edges. In the worst case, it can completely drown out the signal. |
This article is dedicated to the DC offset problem - its causes, its consequences, and the elegant circuit techniques that barcode scanner designers use to eliminate it. We will explore the most common solution: AC coupling, which uses a capacitor to block the DC component while passing the AC signal. We will examine how the high-pass filter, formed by the coupling capacitor and a resistor, is carefully tuned to reject the low-frequency drift while preserving the barcode data. |
We will look at how major companies have implemented offset correction in their products. We will see how Symbol (now Zebra) used a simple RC high-pass filter in the LS2208, and how they optimized the corner frequency for the scanning speed. We will explore Honeywell's more sophisticated approach, which uses a 'baseline restoration' circuit to actively clamp the signal to a reference. We will examine how Datalogic employs a digital offset correction in their imagers, measuring the offset during a pre-scan and subtracting it in firmware. We will also look at Texas Instruments' reference designs that include offset correction, and Analog Devices' techniques for reducing offset in the TIA itself. |
By the end of this journey, you will understand that the DC offset is not just a nuisance but a fundamental challenge that must be addressed at the system level. You will see how a seemingly simple capacitor and resistor can be the key to unlocking the barcode's hidden message. |

|
Full Article |
Section 1: The DC Offset - What Is It and Why Does It Matter |
In an ideal world, the photodetector would only see the light reflected from the barcode. The signal would be a clean, alternating waveform that swings above and below zero, representing the white and black bars. In the real world, the signal sits on a pedestal - a constant voltage that is present even when there is no barcode. This pedestal is the DC offset. |
The DC offset is problematic for two reasons. First, it consumes a portion of the amplifier's dynamic range. If the amplifier's output can swing from 0 to 5 volts, and the offset is 2 volts, then only 3 volts are available for the barcode signal. This limits the maximum gain that can be applied. Second, if the offset is large enough, it can saturate the amplifier - the output hits the supply rail and cannot move any further. The barcode signal is then completely lost. |
The DC offset also causes problems for the comparator that follows the amplifier. The comparator's threshold is set relative to the signal's average. If the DC offset drifts, the threshold becomes misaligned, and the comparator may trigger at the wrong times. This distorts the bar widths and leads to decoding errors. |

|
Section 2: The Sources of DC Offset |
The DC offset has three main sources: |
Ambient Light: This is the most significant source. The photodetector receives not only the light from the scanner's illumination source but also the ambient light - sunlight, room lighting, and even the light from the scanner's own display. This ambient light creates a constant photocurrent that adds to the signal. |
Dark Current: The photodiode's dark current, as we discussed in the previous article, flows even in the absence of light. It is temperature-dependent and adds a DC offset. |
Amplifier Offset: The op-amp itself has an input offset voltage. This is a small voltage (a few millivolts) that appears between the inputs. When amplified by the TIA, this offset becomes a DC voltage at the output. |
The ambient light is the most variable. In a bright sunny day, the ambient photocurrent can be hundreds of microamperes, which is thousands of times larger than the barcode signal (nanoamperes). The ambient light can change rapidly - for example, when the scanner is moved from a shadow into direct sunlight. The DC offset must be removed quickly to avoid saturating the amplifier. |

|
Section 3: AC Coupling - The Classic Solution |
The classic solution to the DC offset is AC coupling. This involves placing a capacitor in series with the signal path. The capacitor blocks the DC component of the signal but passes the AC component - the changing part that represents the barcode. A resistor is connected from the capacitor's output to ground (or to a reference voltage) to provide a discharge path for the capacitor and to set the time constant. |
The AC coupling network is a high-pass filter. It attenuates frequencies below a certain corner frequency and passes frequencies above it. The corner frequency is determined by the capacitor and the resistor. Frequencies much lower than the corner are blocked; frequencies much higher than the corner pass through. |
The corner frequency must be chosen carefully. It must be low enough to pass the barcode signal, but high enough to reject the DC offset and any low-frequency drift. A typical corner frequency is 10-30 Hz. This is low enough for a hand-scanned barcode (which has frequencies down to 50 Hz), but high enough to reject the slow changes in ambient light. |

|
Section 4: The High-Pass Filter in Symbol's LS2208 |
In Symbol's LS2208, the AC coupling is implemented after the TIA. The TIA's output, which includes the DC offset, is fed to a series capacitor (C1) of 2.2 microfarads. The output of the capacitor is connected to a resistor (R1) of 10 kilohms to ground. The corner frequency is 1/(2*pi*R1*C1) = 1/(2*pi*10k*2.2uF) = 7.2 Hz. |
This corner frequency is very low, ensuring that the barcode signal is passed without attenuation. The slowest hand-scanned barcode has a frequency of about 50 Hz, which is well above the corner. The DC offset, which is at 0 Hz, is completely blocked. |
The LS2208's AC coupling network is simple and effective. It uses a cheap ceramic capacitor and a standard resistor. The capacitor is a 'X7R' type, which is not as stable as a 'COG' type, but the variation in the corner frequency over temperature is acceptable for the application. |

|
Section 5: The Time Constant - A Critical Design Parameter |
The time constant of the AC coupling network is the product of the capacitor and the resistor (R*C). This time constant determines how quickly the network responds to changes in the DC offset. If the offset changes rapidly (e.g., when the scanner is moved from a dark room to a sunny window), the network must track this change quickly. |
The time constant is also the time it takes for the capacitor to charge or discharge by 63%. A shorter time constant allows faster tracking but also passes more of the low-frequency drift. A longer time constant provides better rejection of the drift but responds more slowly to changes. |
The time constant is related to the corner frequency: corner frequency = 1/(2*pi*RC). A time constant of, say, 0.1 seconds (RC = 0.1) gives a corner frequency of 1.6 Hz. A time constant of 0.01 seconds gives a corner of 16 Hz. The choice depends on the expected drift rate of the ambient light. |

|
Section 6: The Baseline Restorer - An Active Alternative |
A baseline restorer is an active circuit that clamps the signal's baseline to a reference voltage. It is used in some high-performance scanners to provide faster tracking and better low-frequency rejection than a passive RC filter. |
The baseline restorer typically uses a diode and a capacitor. The diode is connected between the signal and the reference voltage. When the signal's baseline exceeds the reference, the diode conducts and charges or discharges the capacitor, pulling the baseline back to the reference. This is a feedback loop that actively maintains the baseline. |
Honeywell uses a baseline restorer in some of their industrial scanners. The baseline restorer is implemented with a fast diode and a high-speed comparator. The comparator detects when the signal crosses the reference, and it activates a current source that charges or discharges the coupling capacitor. This provides a very fast response to changes in the DC offset, allowing the scanner to read barcodes even under rapidly changing lighting conditions. |

|
Section 7: Digital Offset Correction - The Imager's Advantage |
In an imaging scanner, the photodetector is a CMOS pixel array. The output of the sensor is a digital value, not an analog voltage. The DC offset is the baseline of the pixel values - the value that a pixel outputs when it is not exposed to any light. This baseline is known as the 'black level.' |
The black level is measured during a pre-scan, when the sensor is not exposed to light. A few pixels (or rows of pixels) are covered by an opaque shield. The output of these pixels is the black level. The scanner subtracts the black level from all the pixel values, effectively removing the DC offset. This is called digital offset correction. |
Digital offset correction is a very simple and effective technique. It completely eliminates the DC offset, regardless of its source. It is widely used in imaging scanners, including Honeywell's 1900 and Zebra's DS8100. The subtraction is done in the digital domain, so it does not affect the analog performance. |

|
Section 8: The AC Coupling in Honeywell's 1900 Imager |
While the Honeywell 1900 is an imager, it still uses AC coupling in the analog front-end. The sensor's output is a differential analog signal, which is fed to an ADC. Before the ADC, the signal is AC-coupled to remove any DC offset from the sensor's output. |
The AC coupling network in the 1900 is more sophisticated than the simple RC filter in the LS2208. It uses a differential capacitor and a differential resistor. The two capacitors are matched to within 1%, and the two resistors are also matched. This ensures that the common-mode rejection of the differential signal is not degraded. |
The corner frequency is set to about 5 Hz. This is lower than the LS2208's corner, because the imager's frame rate (30 frames per second) results in a lower signal frequency. The lower corner provides better rejection of the sensor's low-frequency noise. |

|
Section 9: The Effect of AC Coupling on the Barcode Signal |
AC coupling does not just block the DC offset; it also affects the barcode signal itself. The high-pass filter distorts the signal's waveform. In particular, the sharp edges of the barcode are slightly rounded, and the signal may 'droop' - the amplitude may decrease gradually over time. |
The droop is caused by the capacitor discharging through the resistor. When the signal changes from a white space (high light) to a black bar (low light), the capacitor has to adjust its charge. This takes time. During a long black bar, the capacitor may discharge slightly, causing the signal to drift towards zero. This is the droop. |
The droop can be significant for very wide bars. To minimize the droop, the time constant must be long compared to the longest bar width. In the LS2208, the longest bar width is about 10 milliseconds, and the time constant is 22 milliseconds. The droop is about 1%, which is negligible. |

|
Section 10: The Trade-Off Between Corner Frequency and Droop |
There is a fundamental trade-off between the corner frequency and the droop. A higher corner frequency (shorter time constant) gives faster settling after a DC offset change, but it causes more droop on the wide bars. A lower corner frequency (longer time constant) gives less droop but slower settling. |
For a hand-scanned barcode, the scanning speed is variable. A fast scan produces narrow bars (high frequency); a slow scan produces wide bars (low frequency). The corner frequency must be low enough to pass the wide bars of the slowest scan, but high enough to reject the DC offset drift. |
In practice, the corner frequency is set to about 1/10 of the lowest barcode frequency. For a slow scan with a 50-Hz bar frequency, the corner is set to 5 Hz. This provides a good balance between rejection and droop. |

|
Section 11: Symbol's LS5800 - A Different Approach |
The Symbol LS5800 is a fixed-position scanner, often used in retail checkout counters. It is different from handheld scanners because the barcode is moved across the scanner, not the other way around. The scanning speed is fixed by the conveyor belt or the cashier's hand speed. |
The LS5800 uses a more complex AC coupling network. It has a switchable corner frequency. The scanner has two modes: 'slow' and 'fast.' In the slow mode, the corner frequency is 2 Hz; in the fast mode, it is 20 Hz. The mode is selected by the firmware based on the detected scan speed. |
The switchable corner frequency allows the LS5800 to handle both slow and fast barcodes without excessive droop. The switching is done by a field-effect transistor (FET) that connects or disconnects a second resistor in parallel with the main resistor. This is a simple but effective technique. |

|
Section 12: The Impact of Ambient Light Flicker |
Ambient light is not always constant. Fluorescent lamps flicker at twice the mains frequency (100 Hz in Europe, 120 Hz in the USA). Incandescent lamps flicker at the mains frequency (50 or 60 Hz). This flicker creates a low-frequency AC component that can pass through the AC coupling network if the corner frequency is not low enough. |
The flicker component is at 100 or 120 Hz, which is higher than the barcode's low frequencies (down to 50 Hz). The corner frequency is set to below 50 Hz, so the flicker is rejected. However, if the flicker is strong (e.g., under a bright fluorescent lamp), it can still cause a small modulation of the signal. |
Some scanners use a 'flicker rejection' filter. This is a notch filter that is tuned to the flicker frequency. The notch filter is a more complex circuit, but it provides better rejection. It is used in some industrial scanners that must operate under strong flickering lights. |

|
Section 13: The DC Offset in the TIA - A Built-In Problem |
The TIA itself introduces a DC offset. The op-amp's input offset voltage, multiplied by the TIA's gain, creates a DC voltage at the output. This is in addition to the offset from the photodetector. |
For the TLV2371, the input offset voltage is up to 4 millivolts. With a gain of 470,000 (470 kilohm feedback resistor), the output offset could be up to 1.9 volts. This is a significant offset. It would saturate the amplifier if there were no other DC offset. |
The AC coupling capacitor that follows the TIA blocks this offset. However, the TIA must not saturate before the AC coupling. To prevent saturation, the TIA must have a large output swing, or the gain must be reduced. The LS2208 uses a 5-volt supply, so the TIA's output can swing from 0.5 to 4.5 volts. The offset is about 1.5 volts, which is within the range. |

|
Section 14: Reducing the TIA Offset - Zero-Drift Amplifiers |
Some op-amps have a very low input offset voltage. These are 'zero-drift' or 'chopper' amplifiers. They use an auto-zero circuit that continuously cancels the offset voltage. The AD8615, for example, has a maximum offset of 10 microvolts. With a gain of 470,000, the output offset is only 4.7 voltsWait, that is still large. Actually, the AD8615's offset is 10 microvolts, so with a gain of 470,000, the output offset would be 4.7 volts, which is too high. But the AD8615 is typically used with a smaller gain (e.g., 100 kilohm, gain = 100,000), so the output offset is 1 volt. |
Zero-drift amplifiers are used in some high-end scanners to reduce the DC offset at the TIA's output. This allows the use of a larger feedback resistor (higher gain) without saturating the amplifier. The reduction in the offset also reduces the requirement on the AC coupling network. |

|
Section 15: Analog Devices' AD8615 - A Zero-Drift Solution |
Analog Devices' AD8615 is a zero-drift, CMOS op-amp. It has an input offset voltage of less than 10 microvolts, and an offset drift of less than 0.02 microvolts per degree Celsius. It is used in some high-end scanners, such as the Zebra DS3500. |
The DS3500 uses the AD8615 in the TIA with a feedback resistor of 100 kilohms. The gain is 100,000. The output offset is about 1 volt. This is acceptable. The AC coupling capacitor blocks this offset. |
The AD8615's zero-drift feature also eliminates the temperature drift of the offset. This is important for scanners that are used in outdoor environments with large temperature variations. The stable offset ensures that the comparator's threshold does not drift. |

|
Section 16: The AC Coupling Capacitor - Choosing the Right Type |
The AC coupling capacitor is a critical component. Its value determines the corner frequency. Its type affects the distortion and the stability. The capacitor must be a low-leakage type, because any leakage current will add a DC offset. |
The most common types of capacitors for AC coupling are: |
Ceramic (X7R or COG): COG (or NP0) is the most stable type, with a low temperature coefficient and low voltage coefficient. X7R is less stable but cheaper. COG is preferred for high-performance designs. |
Film (Polyester or Polypropylene): These have very low leakage and good stability. They are larger and more expensive than ceramic capacitors. |
Electrolytic (Tantalum or Aluminum): These have a high capacitance per volume, but they have a high leakage current and a poor frequency response. They are not suitable for AC coupling in barcode scanners. |
The LS2208 uses a ceramic X7R capacitor. The 2.2-microfarad value is large for a ceramic capacitor, so the capacitor is physically large (1206 size). The X7R type has a tolerance of +/- 10%, which is acceptable. The leakage current is less than 0.1 microampere, which is negligible. |

|
Section 17: The AC Coupling Resistor - Choosing the Right Value |
The AC coupling resistor sets the corner frequency together with the capacitor. It also determines the input impedance of the subsequent stage. A large resistor value reduces the loading on the TIA but increases the thermal noise. A small resistor value reduces the noise but increases the loading. |
The resistor must be a low-noise type. Metal film resistors are the preferred choice. They have a low thermal noise and a low temperature coefficient. Carbon film resistors are cheaper but have a higher noise and a larger temperature coefficient. The LS2208 uses a metal film resistor. |
The resistor's value is determined by the desired corner frequency and the capacitor. For a corner of 10 Hz and a capacitor of 2.2 microfarads, the resistor is 1/(2*pi*10*2.2e-6) = 7.2 kilohms. In the LS2208, the resistor is 10 kilohms, giving a corner of 7.2 Hz. |

|
Section 18: The High-Pass Filter as a Differentiation |
The high-pass filter is sometimes described as a 'differentiator.' This is because the output of a high-pass filter is approximately the derivative of the input, for frequencies well below the corner frequency. The derivative of a step function is a spike, so the high-pass filter emphasizes the edges of the barcode. |
This effect is actually beneficial in a barcode scanner. The barcode's information is contained in the edges - the transitions between bars and spaces. By emphasizing the edges, the high-pass filter can improve the signal-to-noise ratio for the comparator. The comparator is triggered by the edges, so a sharper edge is easier to detect. |
However, the differentiation effect also amplifies high-frequency noise. The high-pass filter's gain increases with frequency (up to the corner), so it amplifies any high-frequency noise. This is why the corner frequency must be carefully chosen. A corner that is too high will amplify too much noise. |

|
Section 19: The Baseline Wander - A Problem for Long Barcodes |
For very long barcodes, the AC coupling can cause 'baseline wander.' This is a slow drift of the baseline over the length of the barcode. It is caused by the capacitor charging and discharging over the long periods of the barcode. |
Baseline wander is a particular problem for Code 128 barcodes, which can have very long bars. The scanner must decode the entire barcode, and the baseline wander can distort the widths of the bars at the end of the barcode. |
To mitigate baseline wander, the corner frequency is set as low as possible. A corner of 5 Hz is typical for long barcodes. Some scanners also use a 'baseline clamp' that clamps the baseline to a reference voltage at the start of the barcode, preventing the wander. |

|
Section 20: Honeywell's Baseline Clamp - An Active Solution |
Honeywell's 1900 imager uses an active baseline clamp in the analog front-end. The clamp is a sample-and-hold circuit that samples the signal during the quiet zone (the white space before the barcode) and holds that voltage as the reference. The comparator's threshold is then set relative to this held voltage. |
The baseline clamp effectively prevents baseline wander. The reference is established at the start of the barcode and is held for the entire duration of the scan. The clamp is reset for each new scan. |
The baseline clamp is implemented with an analog switch and a capacitor. The switch is controlled by the microcontroller. During the quiet zone, the switch is closed, and the capacitor charges to the signal level. When the barcode begins, the switch is opened, and the capacitor holds the reference voltage. |

|
Section 21: The DC Offset in the Comparator - A Threshold Issue |
The comparator that follows the AC coupling network has its own input offset voltage. This offset can cause the comparator to trigger at the wrong time, especially if the signal is small. The offset is typically a few millivolts, which is negligible compared to the signal amplitude. |
However, the comparator's offset can be amplified by the comparator's hysteresis. The hysteresis is the positive feedback that we discussed in an earlier article. The hysteresis adds a voltage offset to the threshold. The offset is typically 50-100 millivolts, which is much larger than the comparator's own offset. |
The hysteresis offset is intentional and is not a problem. It prevents the comparator from oscillating due to noise. The offset is fixed and does not depend on the DC offset. |

|
Section 22: The Impact of the DC Offset on the ADC |
In an imaging scanner, the DC offset affects the ADC's input range. The ADC has a fixed input voltage range (e.g., 0 to 3.3 volts). If the signal's DC offset is too high or too low, the signal may be clipped - the peaks or valleys may be outside the ADC's range. |
To prevent clipping, the ADC's input is usually AC-coupled, and the ADC's input is biased to the midpoint of its range. The AC coupling capacitor blocks the DC offset, and the bias resistor sets the DC level to the midpoint. The signal then swings symmetrically around the midpoint. |
This is exactly the same principle as in the analog domain. The AC coupling ensures that the signal is centered in the ADC's range, maximizing the dynamic range. |

|
Section 23: The Digital Domain - Removing the Offset in Software |
In a fully digital scanner, the DC offset can be removed entirely in software. The sensor's output is a digital value that includes the DC offset. The firmware subtracts the offset from every pixel value. The offset is determined by measuring the black level (the output of shielded pixels). |
This digital offset correction is the most flexible and accurate method. The offset can be measured and subtracted on a pixel-by-pixel basis. The correction can be updated continuously, tracking any changes in the offset. |
Zebra's DS8100 imager uses digital offset correction. The sensor's black level is read at the start of each frame, and the firmware subtracts it from all the pixel values. This completely eliminates the DC offset, regardless of its source. |

|
Section 24: The Offset in the Laser Scanner - A Special Case |
In a laser scanner, the photodetector is a single photodiode, not an array. The DC offset cannot be removed digitally. It must be removed by the analog AC coupling. |
The laser scanner's AC coupling network must handle a wide range of scanning speeds, from a slow hand swipe to a fast conveyor belt. The corner frequency must be low enough for the slowest speed but high enough to reject the offset drift. |
The laser scanner's AC coupling is also challenged by the laser's own characteristics. The laser's power may vary slightly over time, causing a slow drift in the DC offset. The AC coupling must track this drift. |

|
Section 25: Symbol's Laser Scanner - A Detailed Example |
Symbol's LS2208 laser scanner uses a simple AC coupling network, as we have described. The network consists of a 2.2-microfarad capacitor and a 10-kilohm resistor. The corner frequency is 7.2 Hz. |
The LS2208 also uses a 'reset' circuit. The reset circuit shorts the capacitor when the scanner is idle, discharging it completely. This ensures that the capacitor starts at zero charge at the beginning of each scan. The reset circuit is a small FET transistor that is controlled by the microcontroller. |
The reset circuit prevents the 'first bar' problem. When the scanner first starts a scan, the capacitor is charged to the ambient light level. The first bar of the barcode will cause a step change in the signal, and the capacitor will take some time to adjust. The reset circuit eliminates this transient by starting with the capacitor discharged. |

|
Section 26: The Reset Circuit - A Common Feature |
Many barcode scanners include a reset circuit for the AC coupling capacitor. The reset circuit is a switch that shorts the capacitor at the start of each scan. The switch is opened when the scan begins, allowing the AC coupling to function. |
The reset circuit improves the scanner's response time. It prevents the 'settling' transient that would otherwise occur at the beginning of the scan. The reset circuit is particularly important for scanners that are used in applications where the ambient light changes rapidly. |
The reset circuit is usually implemented with a small FET transistor. The FET is controlled by a digital output from the microcontroller. The FET must have a low on-resistance to ensure that the capacitor is completely discharged. |

|
Section 27: The AC Coupling in Datalogic's Imagers |
Datalogic's imaging scanners use a more sophisticated AC coupling network. The network is a differential AC coupler. The sensor's output is a differential signal, and the coupler uses two capacitors (one for each side) and two resistors (also one for each side). |
The differential AC coupling preserves the common-mode rejection of the differential signal. Any common-mode offset is blocked by the capacitors. The differential signal passes through. |
The corner frequency of the differential coupler is the same as for a single-ended coupler, but the components must be matched. If the two capacitors are not matched, the common-mode rejection will be degraded. Datalogic uses 1% tolerance capacitors and resistors to ensure matching. |

|
Section 28: The Offset in the Phototransistor - A Different Challenge |
For scanners that use a phototransistor (instead of a photodiode), the DC offset problem is different. The phototransistor has a current gain, so the photocurrent is amplified internally. The offset is also amplified. |
The phototransistor's dark current is typically larger than a photodiode's dark current. This creates a larger DC offset. The offset is even more temperature-dependent because the transistor's gain is temperature-dependent. |
The AC coupling network must handle this larger and more variable offset. The corner frequency must be low enough to reject the offset drift, but the time constant must be short enough to track the changes in gain. This is a more difficult design challenge. |

|
Section 29: Omron's Phototransistor Scanner - AC Coupling Details |
Omron's low-cost scanners use a phototransistor. The phototransistor is connected in a common-emitter configuration with a load resistor. The output is AC-coupled to a comparator. |
The AC coupling network uses a 1-microfarad capacitor and a 100-kilohm resistor, giving a corner of 1.6 Hz. This low corner is needed because the phototransistor's offset is large and can drift significantly with temperature. |
The low corner also causes a significant droop on the wide bars. To compensate, Omron's decoder uses a 'pattern recognition' algorithm that is tolerant of the droop. The algorithm measures the widths of the bars relative to each other, not absolute values, so the droop is not a problem. |

|
Section 30: The Effect of the DC Offset on the Decoding Accuracy |
The DC offset, if not properly removed, can cause decoding errors. The comparator's threshold is set relative to the average signal level. If the DC offset drifts, the average level changes, and the threshold becomes misaligned. The bar widths will be measured incorrectly. |
The decoding errors can be serious. A narrow bar may be measured as a wide bar, or a wide bar may be measured as a narrow bar. This can cause the wrong character to be decoded. The checksum will fail, and the scanner will reject the read. |
To prevent these errors, the AC coupling network must be designed carefully. The corner frequency must be low enough to reject the offset drift, and the time constant must be long enough to minimize the droop. |

|
Section 31: The Test for DC Offset Rejection |
Barcode scanners are tested for their ability to reject the DC offset. The test is performed with a 'step' in the ambient light. The scanner is exposed to a bright light, and then the light is suddenly reduced. The scanner must recover quickly and read the barcode correctly. |
The test is specified by the ISO/IEC 15424 standard. The scanner is tested with a barcode that is placed on a white background. The ambient light is stepped from 0 lux to 1000 lux. The scanner must read the barcode within 1 second of the step. |
The AC coupling network is the key to passing this test. A well-designed network will track the offset change and settle within a fraction of a second. A poorly designed network will saturate the amplifier or take too long to settle. |

|
Section 32: The Offset in the Presence of Sunlight - A Real-World Challenge |
Sunlight is the most challenging ambient light source. It is bright (up to 100,000 lux), and it can change rapidly (e.g., when a cloud passes over). Sunlight also has a strong infrared component, which can pass through the red-pass filter and create a large photocurrent. |
To handle sunlight, the scanner's AC coupling network must have a fast response. The time constant must be short enough to track the rapid changes in sunlight. However, the corner frequency must still be low enough to pass the barcode signal. |
Some scanners use a 'sunlight rejection' filter - an optical filter that blocks the infrared component. The filter is placed in front of the photodetector. This reduces the photocurrent from sunlight, easing the burden on the AC coupling network. |

|
Section 33: The Low-Frequency Noise - A Hidden Problem |
The AC coupling network blocks the DC offset, but it passes low-frequency noise. The noise can come from the photodetector, the op-amp, or the power supply. The noise is amplified by the gain stages and can corrupt the barcode signal. |
Low-frequency noise, also known as '1/f' noise, is particularly problematic. It increases at low frequencies, and it is passed by the AC coupling network. The 1/f noise can cause a slow drift in the signal, even when there is no DC offset. |
To reduce the 1/f noise, the designer must choose components with low 1/f noise. The AD8615, for example, has a very low 1/f noise. The choice of the photodetector also matters; a low-dark-current photodiode has less 1/f noise. |

|
Section 34: The Settling Time - A Measure of Speed |
The settling time of the AC coupling network is the time it takes for the signal to settle to within a small percentage of its final value after a step change in the DC offset. The settling time is typically 5-10 times the time constant. |
For a time constant of 0.1 seconds, the settling time is about 0.5-1 seconds. This is too slow for a barcode scanner, which must respond within a fraction of a second. The time constant must be shorter. |
For the LS2208, the time constant is 22 milliseconds (2.2 uF * 10 kQ). The settling time is about 110-220 milliseconds. This is fast enough for a hand-held scanner. |

|
Section 35: The Future - Adaptive AC Coupling |
The future of DC offset correction may be adaptive AC coupling. In an adaptive system, the corner frequency of the high-pass filter is adjusted in real-time based on the signal. For example, if the scanner detects a slow scan, it lowers the corner frequency to reduce the droop. If it detects a fast scan, it raises the corner frequency to reject more offset drift. |
The adaptive control can be implemented in firmware, by adjusting a digital potentiometer that sets the resistor value. The microcontroller monitors the signal's characteristics and adjusts the resistor. |
Some high-end scanners already use adaptive AC coupling. The technique is not yet common, but it is likely to become more widespread as microcontrollers become more powerful. |

|
Section 36: The DC Offset - A Problem Solved |
The DC offset is a fundamental problem in barcode scanners, but it is a problem that has been solved. The AC coupling network, with its capacitor and resistor, is a simple, elegant, and effective solution. It has been used for decades and will continue to be used for the foreseeable future. |
We have seen how major companies have implemented AC coupling in their products. Symbol's LS2208 uses a simple RC high-pass filter. Honeywell uses a baseline restorer and a baseline clamp. Datalogic uses a differential AC coupler. Zebra uses digital offset correction in their imagers. Omron uses a low-corner filter with a tolerant decoder. |
Each company has found its own optimal balance of corner frequency, time constant, and circuit complexity. The choice depends on the application: a retail scanner needs a simple, reliable solution; an industrial scanner needs a more robust solution; an imager can use digital correction. |
The DC offset is no longer a barrier to accurate barcode reading. The first hero, the TIA, amplifies the signal; the AC coupling network then tames the unwanted baseline, preparing the signal for the next stages of the processing chain. The barcode scanner is a testament to the power of analog design, where a simple capacitor and resistor can make all the difference. |

|
Detailed Final Summary |
We have now explored the DC offset problem and its solutions in exhaustive detail. Let us recapitulate the essential points, the design trade-offs, and the real-world examples that define this critical aspect of barcode scanner design. |
The DC Offset Problem |
The DC offset is an unwanted, constant voltage that sits on top of the barcode signal. It comes from three main sources: ambient light, the photodiode's dark current, and the op-amp's input offset voltage. The offset can saturate the amplifier, reduce the dynamic range, and cause the comparator to trigger at the wrong times. It must be removed before the signal can be decoded. |
The Solution: AC Coupling |
The classic solution is AC coupling, which uses a capacitor in series with the signal path to block the DC component. A resistor is connected from the capacitor's output to ground to set the time constant. The AC coupling network is a high-pass filter with a corner frequency determined by the capacitor and the resistor. |

|
Key Design Parameters |
Corner Frequency (fc): The frequency below which signals are attenuated. It must be low enough to pass the barcode signal (frequencies down to 50 Hz for a hand scan) but high enough to reject the DC offset and low-frequency drift. Typical values are 5-30 Hz. |
Time Constant (tau = R*C): Determines how quickly the network responds to changes in the DC offset. A shorter time constant provides faster tracking but causes more droop. A longer time constant provides less droop but slower tracking. The time constant is typically 10-50 milliseconds. |
Droop: The gradual decay of the signal during a long bar. It is caused by the capacitor discharging through the resistor. The droop is minimized by a long time constant. |
Circuit Topologies |
Simple RC High-Pass Filter: The most common approach. Uses a single capacitor and a single resistor. Symbol's LS2208 uses a 2.2-microfarad capacitor and a 10-kilohm resistor (fc = 7.2 Hz, tau = 22 ms). |
Baseline Restorer: An active circuit that clamps the signal's baseline to a reference voltage. Uses a diode and a comparator. Provides faster tracking and better low-frequency rejection than a passive RC filter. Used by Honeywell in some industrial scanners. |
Baseline Clamp: A sample-and-hold circuit that samples the signal during the quiet zone and holds the reference voltage for the entire scan. Prevents baseline wander. Used by Honeywell in the 1900 imager. |
Differential AC Coupling: Used for differential signals. Uses two capacitors and two resistors, all matched. Preserves common-mode rejection. Used by Datalogic in their imagers. |
Digital Offset Correction: Used in imaging scanners. The black level (the output of shielded pixels) is measured and subtracted from all pixel values. Completely eliminates the DC offset. Used by Zebra in the DS8100. |

|
Real-World Company Examples |
Symbol (Zebra) LS2208: Simple RC high-pass filter with fc = 7.2 Hz. Includes a reset circuit that shorts the capacitor at the start of each scan. This is a proven, reliable design. |
Honeywell 1900 Imager: Uses a baseline clamp that samples the quiet zone. Also uses AC coupling on the sensor's differential output. The clamp prevents baseline wander and improves the decoding accuracy. |
Datalogic PowerScan: Uses a differential AC coupler with matched components. The differential topology provides common-mode rejection and is used in noisy industrial environments. |
Zebra DS8100 Imager: Uses digital offset correction. The sensor's black level is read at the start of each frame and subtracted from all pixel values. This is the most flexible and accurate method. |
Omron Entry-Level Scanners: Uses a phototransistor and a low-corner AC coupling network (fc = 1.6 Hz). The low corner reduces the droop, but the phototransistor's gain variation is handled by a tolerant decoder. |
Texas Instruments (TIDA-00857): The reference design includes a standard RC high-pass filter. The corner frequency is set to 15 Hz with a 1-microfarad capacitor and a 10-kilohm resistor. |

|
Advanced Techniques |
Switchable Corner Frequency: Allows the scanner to adapt to different scanning speeds. Used in Symbol's LS5800. The switch is a FET that connects or disconnects a second resistor in parallel with the main resistor. |
Reset Circuit: Shorts the AC coupling capacitor at the start of each scan, preventing the 'first bar' transient. Used in the LS2208 and many other scanners. |
Zero-Drift Op-Amps: Reduce the DC offset at the TIA's output, allowing the use of a larger feedback resistor. Used in the Zebra DS3500 with the AD8615. |
Flicker Rejection: A notch filter tuned to the fluorescent flicker frequency (100 or 120 Hz). Used in some industrial scanners to reject strong flickering light. |
Effects on the Signal |
- AC coupling distorts the barcode signal, causing a slight rounding of the edges and a droop on the long bars. |
- The droop is proportional to the bar width and inversely proportional to the time constant. |
- The distortion is acceptable as long as it does not exceed the comparator's hysteresis. |
Testing and Validation |
- The scanner is tested for DC offset rejection with a step change in ambient light. |
- The test is specified by ISO/IEC 15424. |
- The scanner must read a barcode within 1 second of a step from 0 to 1000 lux. |
Trade-Offs |
Corner Frequency vs. Droop: A higher corner gives faster settling but more droop. A lower corner gives less droop but slower settling. |
Time Constant vs. Response Time: A shorter time constant gives a faster response to offset changes but more droop. A longer time constant gives less droop but a slower response. |
Cost vs. Performance: A simple RC filter is cheap but may not be sufficient for demanding applications. An active baseline restorer is more expensive but provides better performance. |

|
The Future |
- Adaptive AC coupling, where the corner frequency is adjusted in real-time, is likely to become more common. |
- Digital offset correction will continue to be the preferred method for imagers. |
- Integration of the AC coupling network into the sensor chip will reduce component count and cost. |
The DC Offset - A Problem Solved |
The DC offset is a fundamental problem, but it is a problem that has been elegantly solved. The AC coupling network is a simple, reliable, and effective solution that has been used for decades. It is a testament to the power of analog design, where a capacitor and a resistor can remove an unwanted baseline and reveal the hidden message of the barcode. |
The major companies have each found their own optimal solution. Symbol's simple RC filter is a classic, proven design. Honeywell's baseline clamp and restorer provide active control. Datalogic's differential AC coupling preserves common-mode rejection. Zebra's digital offset correction is the ultimate solution for imagers. Each company has tailored the solution to its specific application, demonstrating the versatility of the AC coupling technique. |
The DC offset is no longer a barrier to accurate barcode reading. It is a challenge that has been met and overcome. The first hero, the TIA, amplifies the signal; the AC coupling network then tames the unwanted baseline, preparing the signal for the next stages of the processing chain. The barcode scanner is a testament to the power of analog design, where simple components work together to achieve a remarkable feat. |