Having wet or dirty hands it is easier to turn on the light approaching the sensor than touching a typical switch. The proximity switch module is a component of home automation, whose operation is based on the principle of infrared light emitting by the transmitter and its reception by the receiver. The infrared light from transmitter illuminates the object and bounces off of its surface. A portion of the reflected infrared light goes to the receiver, where it is used to form the signal that activates the output of the module.
• Uses infrared radiation.
• Range about 15 centimeters.
• Switching time is adjustable from 0...8 seconds.
• Output relay with 5A/230VAC contacts (NO/NC).
• Power supply: 12V DC.
• pcb dimension: 37×79mm.
• Electronic Kit – soldering required.
Schematic of the proximity sensor is shown in Figure 1. The proximity switch module is powered by a voltage of 8…12V. Diode D2 protects the module against reverse polarity of the supply voltage. The power supply is stabilized by US2 integrated circuit. For the functionality of the switch is responsible the ATtiny25 microcontroller. As infrared receiver was used integrated circuit TSOP4836.
The microcontroller periodically generates a series of pulses with a frequency of 36 kHz, which illuminates the IR LED. If a part of the emitted IR radiation is reflected from the object, at the output of the TSOP4836 infrared receiver, a pulse sequence will occur. Then microcontroller measures the voltage on the PR1 potentiometer slide and activates the output relay. The time of the turn of delay depends on the voltage measured on the potentiometer. If the potentiometer slide is in position "-", the output is switched off without delay.
Assembly and test
The assembly is typical and It starts from smallest components and ends up with relay. The IR transmitter and the IR receiver must be separated in such a way, that the IR receiver cannot be illuminated by the IR diode via the side light. Thanks to the terminal connectors, the IR transmitter and the IR receiver can be connected via the cable and mounted away from the proximity switch board. The typical operating range for objects of a size close to the size of a hand is 15 centimeters. Air pollution and dirt of the optical system can reduce the range of the sensor. Figure 2 in the user manual shows an example of using a module for switching on LED lighting.
R2, R4: 10kΩ
R3, R5: 390Ω
C1, C2: 100nF
LD1: LED diode
T1, T2: BC547
US1: ATtiny25 with 8-pin IC socket
NAD, LED, X1: 2-pin terminal block connector
ODB, X2: 3-pin terminal block connector