This experimental report details the design, implementation, and analysis of an infrared (IR) proximity sensor circuit utilizing the LM358 operational amplifier. The objective is to construct a reliable, low-cost sensing module capable of detecting object presence within a defined range, evaluating its performance characteristics, and documenting the findings for practical application reference in automation and safety systems.
The core sensing principle relies on the reflection of infrared light. An IR LED emits a beam of infrared radiation. When an object enters the detection field, a portion of this IR light is reflected back towards a photodiode, which acts as the receiver. The photodiode converts the received IR intensity into a corresponding minute photocurrent. The primary challenge lies in effectively amplifying this weak signal to a usable voltage level and distinguishing it from ambient light noise. This is where the LM358 dual op-amp becomes instrumental.

The LM358 was selected for its suitability in single-supply applications, low power consumption, and sufficient gain-bandwidth product for this low-frequency sensing task. The circuit design employs a two-stage amplification and filtering approach. The first stage, configured as a transimpedance amplifier, converts the photodiode's current signal into a voltage. Critical components here include a feedback resistor to set the gain and a capacitor in parallel to reduce high-frequency noise. The output of this stage is a voltage proportional to the received IR intensity but still contains undesirable noise from ambient light sources, such as fluorescent lamps or sunlight, which also emit in the infrared spectrum.

To mitigate this, the second stage of the LM358 is configured as an active band-pass filter or a comparator with hysteresis (Schmitt trigger), depending on the desired output. For analog distance estimation, a filter centered around the modulation frequency of the IR LED (if pulsed) is effective. For a simple digital on/off detection, the comparator configuration is more straightforward. In our experiment, we implemented the comparator setup. The output from the first stage is fed into the non-inverting input of the second op-amp. A reference voltage, set by a potentiometer divider network, is applied to the inverting input, defining the detection threshold. Hysteresis is introduced through positive feedback to prevent output oscillation when the sensor signal is near the threshold, ensuring a clean, debounced digital output signal that transitions from a logic low to a logic high state upon object detection.

The experimental procedure involved assembling the circuit on a breadboard. Components included the LM358 IC, an IR LED (TSAL6200), a photodiode (BPW34), resistors, capacitors, and a potentiometer. A 5V DC power supply was used. The IR LED was driven with a 100Hz pulsed signal at 50% duty cycle through a simple transistor switch to minimize power heating and enhance noise immunity, though the LM358 circuit itself can also be used to generate a simple pulse. Initial testing without modulation showed significant susceptibility to ambient light changes.
Performance was evaluated by measuring the detection range and consistency. A matte white test object was moved towards the sensor along a ruler guide. The potentiometer adjusted the sensitivity (threshold voltage). Key metrics recorded were: the minimum detectable distance (the point where the digital output reliably switched), the maximum reliable range, and the effect of different surface colors and materials. Dark, non-reflective surfaces significantly reduced the maximum range. The sensor demonstrated a consistent detection range of approximately 3 to 15 centimeters for a standard white object, with optimal stability achieved when the pulsed IR signal and proper hysteresis were applied. The LM358 provided stable amplification without noticeable drift over a one-hour continuous operation period.
In conclusion, the LM358 proved to be a highly effective and economical choice for building an IR proximity sensor. Its dual op-amp structure allows for a compact design integrating both signal conditioning and decision-making logic. The success of the sensor heavily depends on proper modulation of the IR source to reject ambient light and the careful design of feedback networks for gain and hysteresis. For applications requiring precise distance measurement, replacing the second-stage comparator with a peak-detection circuit followed by an ADC would be a logical advancement. This experiment validates a fundamental design that can be adapted for object counting, touchless switching, or obstacle avoidance in embedded systems.