To process the signal from an ultrasonic or infrared sensor, a sensitive amplifier with a properly designed filter is essential. Today, I'll show you how to make one using the GL3274 IC.
This IC was originally designed for infrared receivers in remote control systems. Infrared photodiode signals are also very weak and need filtering to remove noise.
The GL3274 IC can operate at supply voltages up to 17 volts, but the optimal range is between 4.7 and 5.3 VDC. The typical current consumption is 1.8 mA and can reach up to 2.8 mA.

Inside its tiny 8-pin package, the IC contains seven functional blocks.

ABLC stands for Automatic Bias Level Control. It minimizes the input offset for the head amp, which is necessary for directly connecting a photodiode to pin 1 (IN).

The head amp is essentially a standard operational amplifier in a non-inverting configuration. Its output connects to the inverting input via an internal resistor with an unusually low resistance of just a few ohms.
Such low resistance protects the amplifier from interference, which was especially important when used in CRT televisions, where the flyback transformer generated noise.
The diagram shows the gain of the head amp as a function of the resistance between pin 2 and ground. A capacitor in series with the resistor creates a high-pass filter (HPF).

These HPFs are common in guitar overdrive pedals. For example, in the DOD OD 250 circuit, the potentiometer adjusts not just the gain but also the cutoff frequency.

This is fitting, as a transparent overdrive that preserves the full tonal range is ideal for a clearer sound.
At higher gain, a guitar signal needs to be more "tight," taming low frequencies. Otherwise, a tube amp may "choke," producing fuzz rather than drive.
Bill Finnegan took a more sophisticated approach in his Klon Centaur design. A transparent overdrive is achieved by blending the processed signal with the original, routing it through two intricate filter networks.

It took Finnegan's team four years to perfect this masterpiece. Today, both original Klon Centaurs and limited-edition reissued Klon KTRs are highly collectible.
Dozens, if not hundreds, of companies now produce and sell pedals based on the Klon Centaur design, with or without modifications, at various price points, all in high demand on the market.
All signal pins of the GL3274 IC are protected from overvoltage by internal diodes.

A diode with its cathode to ground and anode to the pin protects against negative voltages. A second diode with its cathode connected to the pin and anode to the power supply protects against excessive positive voltage.
In CRT televisions, anode voltages reached tens of thousands of volts. Dust and humidity could cause leakage currents, so TV chips were typically well protected against overvoltage.
The signal transmitted by an infrared LED in a remote control looks like a pulse train of a specific frequency. To process it further, noise is filtered out using a band-pass filter (BPF).

The center frequency of the BPF is set by a resistor between pin 5 of the IC and the positive supply.

To reliably detect the signal from a remote control or the desired ultrasonic frequency, a precise frequency response is required.

To recover the original digital pulses from an infrared remote or ultrasonic transmitter, the signal after the BPF passes through an amplitude detector.

This detector is essentially the same as in an AM radio receiver. A half-wave rectifier cuts off the lower half-wave of the signal. To complete demodulation, the carrier frequency is removed using an integrator.
The integrator is a low-pass filter (LPF). Its cutoff frequency is set by the capacitance connected between pin 3 and ground.

The signal from the detector's integrator then goes to a comparator, followed by another integrator to filter out noise that may occur when the input signal fluctuates around the comparator's threshold.
The second integrator's cutoff frequency is set by a capacitor between pin 6 and ground.

The last comparator with hysteresis ensures immunity to such input signal level fluctuations.
This type of comparator, with positive feedback, was previously used in a PWM controller circuit for LED brightness control.

Pin 7 of the GL3274 IC provides an open-collector output, delivering sharp pulse edges.

This results in a typical circuit for an infrared signal receiver using a photodiode.

Replacing the photodiode with an ultrasonic receiver creates an excellent amplifier for a rangefinder. In my DIY rangefinder with an amplifier based on this design, a microcontroller sends bursts of ultrasonic pulses and measures the time between transmission and reception of the reflected signal.
The speed of sound in air is well-known, enabling distance measurement to the reflecting object. It varies with temperature. At 68°F, the speed of sound in air is about 767 mph. At 32°F, it drops to 740 mph.
Including an electronic thermometer in the rangefinder circuit or a preset for handheld devices can account for air temperature differences.
Atmospheric pressure also affects sound speed, but its impact within natural variation ranges is minimal.
Ultrasonic rangefinders are most commonly used in automotive parking assist systems. They're also widely used in construction and finishing work.
Additionally, ultrasonic rangefinders help robovacuums navigate spaces, much like bats use echolocation to "see" obstacles in complete darkness.