The Modulated Illumination Trick: How Synchronous Demodulation Conquers Ambient Light in Barcode Readers |
Executive Summary |
This article provides a comprehensive, accessible exploration of modulated illumination and synchronous demodulation --- a powerful technique that allows barcode readers to see clearly even in bright sunlight, under flickering fluorescent lights, and in other challenging ambient conditions. We examine how this elegant method 'tags' the reader's own light with a unique signature, then extracts that signature from the noisy mix of ambient and reflected light. Rather than focusing on abstract theory, we ground every concept in concrete design examples and real products from industry leaders including Hewlett-Packard, Texas Instruments, Motorola, and other pioneering companies. We explore the fundamental principle of modulating the illumination, the design of bandpass filters and demodulators, the practical implementation of phase-locked sampling, and the use of heterodyning for extreme noise rejection. The article covers both the analog and digital domains, with special attention to the practical trade-offs between cost, power consumption, and rejection effectiveness. The closing summary synthesizes the key lessons and offers practical guidance for anyone designing circuits that must distinguish signal from overwhelming environmental noise. |

|
Chapter 1: The Fundamental Idea |
Imagine trying to have a conversation in a crowded stadium. Thousands of voices create a deafening roar, making it nearly impossible to hear a single speaker. Now imagine that the speaker has a unique voice --- a distinctive pitch and rhythm --- and you have a device that can filter out all other sounds and isolate that voice. This is exactly what modulated illumination with synchronous demodulation does for barcode readers. |
The modulated illumination trick is elegantly simple. Instead of shining a steady light on the barcode, the reader pulses its LED or laser at a known frequency --- typically tens of kilohertz. The light that reflects from the barcode carries this same frequency signature, along with a slow variation that represents the bar and space pattern. The ambient light from the sun, fluorescent lamps, and other sources is steady or fluctuates at different frequencies. |
The reader then uses a circuit that is 'tuned' to the modulation frequency. This circuit amplifies signals at the modulation frequency while rejecting signals at all other frequencies. The result is that the reader's own reflected light is amplified, while the ambient light is rejected. It is like having a radio receiver that is tuned to a specific station, ignoring all other stations. |
A patent from Hewlett-Packard explains the advantage: 'The present invention overcomes this limitation of the prior art. In addition, the present invention requires very low power, typically a tenth of the power consumed by prior art bar code readers' . By pulsing the LED at a low duty cycle, the reader dramatically reduces power consumption while maintaining excellent signal quality through synchronous detection. |

|
Chapter 2: The Pulses That Beat the Sun |
The Hewlett-Packard patent describes a particularly elegant implementation of the modulated illumination technique. The LED is driven with short, intense pulses --- just 1 microsecond long --- at a duty cycle of about 3%. This means the LED is on for only 1 microsecond out of every 33 microseconds, corresponding to a modulation frequency of approximately 30 kHz . |
The short pulses are crucial for power efficiency. The peak current through the LED is about 30 milliamps, but because the duty cycle is only 3%, the average current is just about 1 milliamp. This represents a tenfold reduction in power consumption compared to prior art readers . |
The high peak current also provides a strong signal, making it easier to detect the reflected light even in bright sunlight. The short pulses allow the photodetector to capture a brief snapshot of the reflected light, with the ambient light appearing as a relatively constant background. |
The patent explains the complete signal chain: the reflected light pulses are received by a photodiode, amplified by a high-gain transimpedance preamplifier, and then passed through high-pass filters to remove the low-frequency ambient light components . The signal is then amplified further and peak-detected by a transistor detector before being digitized. |

|
Chapter 3: Filtering Out the Noise |
Once the reflected signal has been modulated and detected, the next challenge is to extract the barcode information while rejecting the ambient light. This is accomplished through a combination of filtering and synchronous demodulation. |
The Hewlett-Packard patent describes a multi-stage filtering approach. The output of the photodiode is first amplified by a transimpedance preamplifier, then passed through a high-pass filter with a cutoff frequency around 5 kHz . This high-pass filter removes the DC component and low-frequency variations caused by ambient light, including the 50/60 Hz hum from fluorescent lamps. |
The signal then passes through additional gain stages and another high-pass filter, before being peak-detected and passed through a 5 kHz low-pass filter. This low-pass filter recovers the barcode frequencies (which are below 5 kHz) while rejecting components above 5 kHz, including the 30 kHz modulation frequency . |
The use of both high-pass and low-pass filtering is essential. The high-pass filters remove the low-frequency ambient components, while the low-pass filter removes the high-frequency modulation components. The result is a clean signal that represents only the barcode pattern. |

|
Chapter 4: The Balanced Demodulator Approach |
A patent from a barcode reader manufacturer describes a double-balanced demodulator that offers superior rejection of ambient light. This technique uses a carrier oscillator to drive the LED, and a demodulator that multiplies the photodetector signal by the carrier signal. |
The patent explains: 'The carrier oscillator produces rectangular or square waves, and the output of the detector is converted into a sine wave using a circuit which is tuned to the carrier frequency. The rectangular or square wave carrier signal and the detected and converted sine wave signal are both applied to the double balance demodulator to produce the output' . |
The double-balanced demodulator has several advantages over simpler detection schemes. It rejects steady background lighting, rejects 60 Hz or other background pulsing, offers good signal-to-noise ratio, and offers a wide dynamic range . |
The underlying principle is that the barcode variations create sidebands on the carrier signal. By demodulating the signal synchronously with the carrier, the sidebands are recovered while the carrier itself and any off-carrier frequencies are rejected. The patent explains that 'the carrier signal itself washes out as does sunlight (bias), and off carrier frequencies (60Hz, etc.)' . |

|
Chapter 5: The Carrier Oscillator and Modulation |
The carrier oscillator is the heart of the modulated illumination system. It generates the periodic signal that drives the LED and provides the reference for the demodulator. |
The double-balanced demodulator patent describes a carrier oscillator that 'provides an alternating current energizing signal for an emitter, such as an LED' . The oscillator produces rectangular or square waves, which are used to drive the LED and to provide the reference for the demodulator. |
The frequency of the carrier oscillator must be chosen carefully. It must be high enough to be above the frequency range of the ambient light (including 50/60 Hz hum and its harmonics), but low enough to be compatible with the photodetector and amplifier bandwidth. The carrier frequency also must be sufficiently high to accurately resolve the narrowest bars in the barcode. |
The patent also describes a dual-frequency technique where the oscillator can operate at either a low frequency (around 40 Hz) or a high frequency (around 200 kHz) . When the detector sees a very low level of reflectance, the low frequency is used to conserve power. When a higher level of reflectance is detected, the oscillator switches to the higher frequency to increase detection resolution . |

|
Chapter 6: The Demodulator and Phase Shift Compensation |
The demodulator is the circuit that extracts the barcode information from the modulated signal. It compares the photodetector signal to a reference derived from the carrier oscillator, and produces an output that is proportional to the strength of the modulated component. |
A patent from Symbol Technologies describes a demodulator with phase shift compensation. The demodulator is a synchronous detector that compares the signal to a reference signal derived from the LED drive. A phase shift compensation circuit adjusts the phase of the reference signal to maximize the demodulated signal amplitude . |
The phase shift compensation is programmable, typically using data stored in a PROM. The delay has a range of 0 to 12.5 microseconds and a resolution of 0.78 microseconds . This allows the circuit to be tuned during manufacturing to compensate for variations in the optical and electrical components. |
The phase shift compensation is important because any phase error reduces the demodulated signal amplitude. By compensating for the phase shift, the circuit ensures that the demodulated signal is maximized, improving the signal-to-noise ratio . |

|
Chapter 7: The Paper Detector and Power Management |
A key feature of the Symbol Technologies design is the paper detector, which determines whether a surface is present from which the light pulses can be reflected. This feature saves power by reducing the duty cycle of the light pulses when no surface is present . |
The paper detector receives the output signal of the demodulator and processes it to determine whether any pulses correspond to light pulses reflected from a surface. If no surface is detected, the LED's duty cycle is reduced from 50% to 0.8%, significantly reducing power consumption . |
The paper detector uses a comparator and a synchronizer to detect the pulses. The synchronizer prevents the paper detect circuitry from responding to stray noise or glitches that may occur at times when the LED is not being pulsed . |
Once a pulse has been detected, the reader enters operational mode. The LED begins modulating at the operating 40 kHz, 50 percent duty cycle level, and the system is ready to scan the barcode . |

|
Chapter 8: Calibration and Configuration |
The Symbol Technologies patent describes how the modulated illumination system can be calibrated during manufacturing. Calibration and configuration information are stored in a 12-bit programmable read-only memory (PROM) . |
Five bits of the PROM control the digital-to-analog converter which sets the peak LED current . This allows the LED power to be adjusted to compensate for variations in the efficiency of the optics due to alignment variations. |
Four other bits of the PROM control the presettable counter which adjusts the demodulator phase . These nine bits represent the calibration portion of the function of the PROM . |
The PROM also controls other parameters, such as the cutoff frequency of the low-pass filter. The cutoff frequency can be set to 5 kHz or 10 kHz, depending on the application requirements . |

|
Chapter 9: The Heterodyne Approach |
A patent from a barcode reader manufacturer describes a heterodyne approach that takes modulated illumination to the next level. Instead of simply pulsing the LED at a single frequency, the heterodyne system uses a local oscillator to create a signal that is shifted in frequency. |
The patent explains: 'A local oscillator frequency source configured to generate a local oscillator signal at a local oscillator frequency, wherein the local oscillator frequency is an intermediate frequency selected to be above an upper frequency threshold of the ambient light noise' . |
The heterodyning circuit modulates the local oscillator signal with the initial laser signal to produce at least one modified laser signal. The modified laser signal has components at the sum and difference of the local oscillator frequency and the barcode frequencies . |
The reflected signal is then filtered with a bandpass filter centered at the local oscillator frequency. The filter attenuates the ambient light noise components while passing the modified laser signal components . |

|
Chapter 10: Undersampling and Digital Filtering |
The heterodyne patent also describes a sophisticated approach to digitizing the modulated signal. Instead of using a high-speed analog-to-digital converter, the system uses undersampling synchronized with the local oscillator. |
The patent explains: 'By dividing the clock for the local oscillator frequency source with a digital n-counter, an undersampling clock synchronous with the heterodyne carrier is obtained that helps to minimize jitter and phase errors during demodulation' . |
The undersampling technique uses a low-speed ADC to capture the signal, with the sampling rate chosen to satisfy the Nyquist criterion for the signal bandwidth. The patent provides the conditions: 'The sampling frequency f_s should be chosen such that f_s >= 2(f_H - f_L)' . |
Once the signal is downconverted through undersampling, a digital low-pass filter is applied to retain only the original baseband signal. The digital filtering provides high-order low-pass filtering, thus helping to improve the signal gain process . |
Chapter 11: Optical and Electrical Filtering |
The heterodyne patent describes both optical and electrical filtering to reject ambient light. An optical filter can be used prior to the photodetector, while an electrical filter can be used after the photodetector . |
The optical filter attenuates unwanted ambient noise frequencies in the optical domain before the reflected signal is received by the receiver. This reduces the ambient light that reaches the photodetector, improving the signal-to-noise ratio . |
The electrical filter is used after the receiver has converted the signal to the electrical domain. The filter may be a bandpass filter centered at the local oscillator frequency, which passes the modulated signal while rejecting the ambient light . |
The combination of optical and electrical filtering provides two levels of rejection, making the system highly immune to ambient light. |

|
Chapter 12: The Texas Instruments DMD Laser Symbolization |
Texas Instruments has developed a unique application of modulated light for creating barcodes, using a digital micro-mirror device (DMD) to control laser light. This technology, based on Texas Instruments' Digital Light Processing (DLP) technology, can create two-dimensional, finely detailed symbolization including barcodes . |
The DMD is a programmable, circuit-controlled device that guides laser light to create two-dimensional symbolization sets. The laser light changes the optical reflectivity of selected surface regions from a first reflectivity to a second, contrasting reflectivity . |
The programming of the DMD may include time-dependent encrypted codes that shine the laser light onto portions of the surface for variable periods of time, creating shadow and three-dimensional effects . This allows the creation of sophisticated, secure barcodes directly on semiconductor packages. |
The DMD technology allows for batch processing, where a plurality of devices can be symbolized simultaneously. The patent describes an array of packaged semiconductor devices still forming a continuous group, with the DMD programmed to perform the symbolization of all devices concurrently . |
Chapter 13: Synchronous Sampling Demodulation |
A Chinese patent describes a synchronous sampling demodulation method and circuit that is particularly relevant to modulated illumination in barcode readers. The method involves sampling the input modulation signal at a fixed time in each carrier cycle, typically at or near the peak of the carrier . |
The key advantage of this method is that it reduces the fluctuation in the output signal compared to other demodulation techniques. The patent notes that diode envelope detection can cause distorted signals, and multiplier synchronous demodulation requires complex filtering . |
The synchronous sampling demodulation circuit includes a phase adjustment module that adjusts the phase of the sampling clock. The phase adjustment can be changed by changing corresponding configuration signals or parameters, allowing the circuit to be optimized for different operating conditions . |
The circuit uses a local clock as the source for the sampling clock, rather than extracting the clock from the received signal. This reduces phase noise and eliminates the need for complex clock recovery circuitry . |

|
Chapter 14: The Non-Overlapping Clock Generation |
The synchronous sampling demodulation circuit uses a non-overlapping clock generation module to produce two-phase clocks for the sampling switches. The two clocks have the same frequency as the carrier frequency of the input modulating signal, with a duty ratio of about 25% . |
The non-overlapping clocks ensure that the two sampling switches are not closed simultaneously, preventing charge sharing and other parasitic effects. The clocks drive the first and second sampling switches, which sample the input signal and hold the sampled value on capacitors . |
The use of non-overlapping clocks is a standard technique in switched-capacitor circuits, ensuring reliable operation and minimizing errors. The patent describes how the clocks are generated from the phase-adjusted local clock . |
Chapter 15: The Lock-In Amplifier Concept |
A lock-in amplifier is a specialized instrument that uses synchronous demodulation to extract a signal from a noisy environment. A paper on lock-in amplifiers for authentication of luminescent materials describes how this technique can be used for long-distance optical detection . |
The paper describes a novel lock-in amplifier that uniquely identifies a phosphor at a distance of several feet in a noisy environment of daylight, sunlight, and electronic noise. The lock-in amplifier differs from a conventional one by sampling the detector out of synchronization with the source to avoid reflections that could mask the phosphor luminescence . |
The lock-in amplifier achieves excellent noise rejection with only 40 milliseconds of integration. This integration will block noise of frequencies differing by more than 1% from the modulation frequency, allowing authentication over a meter . |
This demonstrates the power of synchronous demodulation: even in extremely noisy environments, a signal can be recovered by locking onto its modulation frequency. |

|
Chapter 16: The Spatial Light Modulator Scanner |
Texas Instruments has also developed a spatial light modulator (SLM) scanning system that uses modulated light for barcode reading. The system uses a light source, a spatial light modulator, and appropriate optics to direct light to the object being scanned . |
The SLM, typically a deformable mirror device, replaces the moving mirror in conventional scanners. Individual elements upon the modulator are activated to reflect those pixels' width of the light to the object. A detector is mounted such as to receive reflections from the object to be processed . |
The elimination of moving mechanical parts is a key advantage. The patent notes that 'mechanical drivers such as the one to spin the mirror are expensive and consume a relatively large amount of power' and that 'these mechanical parts wear out and start giving consistently bad readings' . |
The SLM scanner can be hand-held, mounted into a counter, or used in other applications such as edge detector scanners . |
Chapter 17: The Dual-Frequency Modulation Technique |
The double-balanced demodulator patent describes a dual-frequency energization technique for conserving power during barcode detection. The technique uses a carrier oscillator that operates at a low frequency (such as around 40 Hz) and a high frequency (such as around 200 kHz) . |
When the detector detects a very low level of reflectance, the switch causes the carrier oscillator to produce a low carrier frequency. This conserves power because the LED is pulsed less frequently. When a higher level of reflectance is detected, the carrier oscillator is switched to a higher frequency to increase detection resolution . |
This adaptive frequency control is a clever power management technique. It ensures that the reader uses only the power needed for the current operating conditions, extending battery life in handheld devices. |

|
Chapter 18: The Synthetic Barcode Module |
A patent from a barcode reader manufacturer describes a synthetic barcode module that uses modulated light to simulate the reflections from a printed barcode. The module includes a microcontroller that causes an LED driver to energize the LED and transmit light pulses in a fashion to simulate the reflections from printed barcodes . |
The microcontroller modulates the light emission period by sending control signals to the LED driver. Periods during which light is emitted represent white spaces between bars, and periods during which no light is emitted represent black bars . |
The timing works well across a wide range of barcode scanners. The barcode scanner interprets the emitted light as an analog signal waveform of more or less rectangular-shaped pulses . |
The synthetic barcode module can be reprogrammed to send out different codes on successive laser hits, allowing it to communicate a larger volume of information or to be reconfigured for new information . |
Chapter 19: The Signal Conditioning Circuit |
The synthetic barcode module includes a signal conditioning circuit that filters and amplifies the signal from the photodetector. The signal conditioning circuit communicates filtered and amplified signals to the microcontroller, which causes the LED driver to drive the LED in a manner that emits a predefined series of light flashes . |
The microcontroller includes an analog-to-digital converter to convert input analog voltage signals to discrete digital data. It may also include a digital-to-analog converter to perform the reverse operation for output signals . |
The microcontroller is programmed to cause the LED driver to energize the LED and transmit light pulses in a fashion to simulate the reflections from printed barcodes using standard barcode systems, so that the emitted pulses can be read using a conventional barcode reader . |

|
Chapter 20: The Future of Modulated Illumination |
The future of modulated illumination in barcode readers is bright. As ambient light sources become more varied and more modulated, the need for robust rejection techniques will only increase. |
The combination of modulated illumination with digital signal processing offers the potential for even better performance. The analog filtering can remove the bulk of the ambient light, while the digital processing can remove any residual interference. |
The synthetic barcode module demonstrates how modulated illumination can be used not just for reading barcodes but for creating them. This opens up new possibilities for barcode communication and authentication. |
The heterodyne approach, with its sophisticated undersampling and digital filtering, represents the state of the art in ambient light rejection. As processors become more powerful and less expensive, these techniques will become more widely available. |
Chapter 21: The Practical Implementation Challenges |
Implementing a modulated illumination system in a commercial barcode reader presents several practical challenges. The modulation frequency must be chosen carefully, the filtering must be well-designed, and the demodulation must be precisely synchronized. |
The modulation frequency must be high enough to be above the ambient light frequencies, but low enough to be compatible with the photodetector and amplifier bandwidth. The frequency also must be sufficiently high to accurately resolve the narrowest bars in the barcode. |
The filtering must be carefully designed to reject the ambient light while preserving the barcode signal. The high-pass filter must remove the DC component and low-frequency variations, while the low-pass filter must remove the modulation carrier. |
The demodulation must be precisely synchronized with the modulation. Any phase error will reduce the amplitude of the demodulated signal, degrading the signal-to-noise ratio. |

|
Chapter 22: The Power Consumption Consideration |
Power consumption is a critical consideration for handheld barcode readers. The modulated illumination technique can significantly reduce power consumption by using short pulses at a low duty cycle. |
The Hewlett-Packard patent describes a reader that uses only a tenth of the power of prior art readers . This is achieved by pulsing the LED with a duty cycle of just 3%, reducing the average current from 10 mA to 1 mA. |
The dual-frequency modulation technique described in the double-balanced demodulator patent further reduces power consumption by using a lower frequency when the signal is weak . |
The paper detector in the Symbol Technologies design reduces power consumption by reducing the LED duty cycle when no surface is present . |
Chapter 23: The Signal-to-Noise Ratio Improvement |
The signal-to-noise ratio is a key measure of reader performance. The modulated illumination technique can significantly improve the SNR by rejecting ambient light and amplifying only the modulated signal. |
The double-balanced demodulator patent claims that the technique 'has been shown to reject steady background lighting, reject 60 Hz or other background pulsing, offer good signal to noise ratio, and offer a wide dynamic range' . |
The heterodyne approach improves the SNR by using a bandpass filter centered at the local oscillator frequency. This filter attenuates the ambient light noise components while passing the modulated signal components . |
The lock-in amplifier described in the authentication paper achieves excellent noise rejection with only 40 milliseconds of integration. This integration blocks noise of frequencies differing by more than 1% from the modulation frequency . |

|
Chapter 24: The Comparison with Other Techniques |
The modulated illumination technique offers several advantages over other ambient light rejection techniques. It is more effective than simple AC coupling, more robust than differential optical architecture, and more power-efficient than continuous illumination. |
AC coupling with a high-pass filter can reject the DC component of the ambient light, but it cannot reject modulated ambient light that is close in frequency to the barcode signal. The modulated illumination technique rejects all ambient light that is not at the modulation frequency. |
Differential optical architecture cancels ambient light by subtraction, but it requires matched photodetectors and precise optical alignment. The modulated illumination technique is more tolerant of component variations. |
Continuous illumination provides a steady light, but it consumes more power and does not provide the same level of ambient light rejection. The modulated illumination technique offers superior rejection with lower power consumption. |

|
Chapter 25: Summary --- The Modulated Illumination Trick in Perspective |
The modulated illumination trick is a powerful technique that allows barcode readers to see clearly in even the most challenging ambient light conditions. By 'tagging' the reader's own light with a unique frequency signature, the reader can extract its own signal from the noisy mix of ambient and reflected light. |
We have examined how different companies and technologies have approached the challenges of modulated illumination: |
Hewlett-Packard developed a low-power, high-ambient-light bar code reader circuit using pulse-modulated light at a 3% duty cycle. The circuit uses high-pass filters, multi-stage amplification, and peak detection to recover the barcode signal . |
Symbol Technologies developed a demodulator with phase shift compensation, a paper detector for power management, and a PROM for calibration and configuration. The design uses a 40 kHz modulation frequency and includes programmable LED current and demodulator phase . |
A barcode reader manufacturer developed a double-balanced demodulator that uses a carrier oscillator and a double-balanced mixer to reject steady background lighting, 60 Hz hum, and other interference. The design also includes dual-frequency modulation for power conservation . |
Texas Instruments developed a heterodyne scanner that uses a local oscillator to create a frequency-shifted signal. The system uses bandpass filtering and undersampling with digital filtering to reject ambient light . |
Texas Instruments also developed DMD-based laser symbolization, using a digital micro-mirror device to create two-dimensional barcodes directly on semiconductor packages . |
A Chinese patent describes a synchronous sampling demodulation method that samples the input signal at the peak of each carrier cycle, providing excellent demodulation with low output fluctuation . |

|
The key lessons from our exploration are: |
Modulation tags the signal. By pulsing the LED or laser at a known frequency, the reader's own light carries a unique signature that can be distinguished from ambient light. |
Synchronous demodulation extracts the signal. A demodulator that is synchronized with the modulation frequency extracts the modulated signal while rejecting all other frequencies. |
Filtering removes the noise. High-pass filters remove the DC and low-frequency ambient components, while low-pass filters remove the high-frequency modulation components. |
Phase compensation is essential. Any phase error between the modulation and demodulation reduces the signal amplitude. Programmable phase compensation allows the circuit to be tuned for maximum performance. |
Power consumption can be minimized. Short pulses at a low duty cycle reduce average power consumption by an order of magnitude compared to continuous illumination. |
Calibration is important. Storing calibration data in PROM allows the reader to compensate for variations in the optical and electrical components. |
In the end, the modulated illumination trick is a testament to the ingenuity of engineers who have turned a simple idea into a powerful technique. It is the secret weapon that allows barcode readers to work reliably in sunlight, under fluorescent lights, and in other challenging conditions. The art of modulated illumination lies in the careful balance of modulation frequency, filtering design, and demodulation precision. |