IR-Infrared Sensor Switch Module
Infrared (IR) Sensor Module is a distance proximity sensor “switch”.
When there is an object or obstacles that are close enough to block the view in front of 2 LEDs, it triggers the infrared trans-receiver module.
The clear LED is the IR emitter while the black LED is the IR receiver.
It uses the electromagnetic reflection principle where when the reflective surface (object) is closer, the receiver will receive stronger signal from transmitter due to shorter distance traveled of reflected of wave.
When there is a object that is close enough, the IR electromagnetic detection received by the IR receiver is higher than the threshold level (user pre-set level), the sensor will change the output switch mode so that microprocessor board such as Arduino can execute what is going to do next.
IR Sensor Module has only 1 main output signal which is Digital Output.
Digital Output either go high (5V or 3.3V depends on the input voltage) or low (0V), thus this module cannot be used as a distance measurement but just as a trigger switch.
When there is no obstacles or object within the detection distance, the output is at HIGH position (5V or 3.3V).
When the distance shorter than or equal to the threshold set, the output signal will change to position LOW (0V).
The distance threshold can be set by adjusting the potentiometer / trimpot on the board. This sensor module only able to detect distance between 2cm and 30cm within the view of the IR LED and Photoresistor.
The trigger distance is somehow very subjective to object’s surface material, color and shape. Practically I would recommend this sensor switch for application less than 10cm distance.
Thus this module is suitable for very close range of detection such as obstacle avoidance and virtual touch switch application.
Arduino has the ability to detect voltage value as a ON/OFF switch by using Digital input pin.
For Arduino UNO, there are 12 digital input / output pins (2-13) where you can use one of the pins to detect voltage switch.
Arduino NANO has 11 pins while Arduino MEGA has 54 pins.
The voltage input pins will map input voltages between 0 (LOW) and 3.3V / 5V (HIGH).
Voltage more than 3.3V is consider high.