This 220 V ON/OFF electronic relay switch can be toggled ON/OFF simply by alternately bringing your finger close to the reflection sensor CNY70.
CNY70 is an infrared reflecting sensor comprised of an infrared emitting diode and a phototransistor housed in a tiny plastic container. The sensor operates by generating infrared light and sensing how much of it is reflected back to the phototransistor.
When finger is brought near the sensor, the infrared light from the CNY70 LED hits the finger and is reflected back to the CNY70 phototransistor, generating a trigger signal to operate a flip flop relay. The relay contacts are then used for operating a connected 220 V appliance.
Sometimes it is convenient to be able to control a device connected to the mains without having to manipulate a small switch or a difficult-to-reach button.
It can also be safer not to come into contact with an electrical circuit or, more simply, because the user's hands are not completely free. Voice control is already known, but for this ON/OFF relay switch a simple proximity of anything will be sufficient using a special optoelectronic detector called a REFLECTION SENSOR.
By approaching at a distance of a meter, it will already be possible to switch on a device by using a classic bistable command.
A second identical maneuver will also deactivate the control device. With this command, it will be possible to activate a solenoid valve to control, for example, an automatic water faucet or to turn on and off a measuring device during delicate adjustments.
Of course, specific home automation applications will be possible, such as controlling a dimmer switch or adjusting the speed of a motor.
The sensitive device consists of a particular type of optical coupler which, unlike the classic model integrated into a DIP 6 package or a fork model, allows the infrared emitter and receiver to "look" outward at an angle of a few degrees for a limited range towards the convergence point of the two IR beams.
If no obstacle prevents the emitted beam from reaching the receiver, the sensor will remain completely inactive; any object or an approaching hand will suffice for reliable control.
In the circuit diagram of this ON/OFF switch relay using reflection sensor, as shown above, we use the small NE567 circuit, whose main function is an ultra-selective frequency decoder.
The LM567 makes sure that the circuit is triggered only through its own internal generated frequency reflected by an object close to the sensor, and not by any external interfering frequencies
For perfect operation of the sensor, a CNY70 model, even in bright light, it is sufficient to trigger the emission LED (marked A-K) by a high-frequency periodic signal emitted by the IC2 circuit itself.
This somewhat critical frequency has a value of f = 1 / R5.C2, which is about 2500 Hz in our diagram.
This signal is available on the pin of the IC2 circuit and will be frequency-compared with the one arriving at pin 3 of the same circuit.
Two NAND gates, associated with transistor T1 and resistors R1, R2, R3, and R4, provide the power supply for the OPTO sensor and shape the return signal, which, although attenuated, will arrive at the phototransistor (C-E) with an identical frequency.
In case of signal coincidence, output 8 of the IC1 circuit delivers a fast negative edge on its pin 8, which is then reversed by another NAND gate.
The resulting positive edge will trigger a monostable flip-flop upstream, constructed around two NOR gates according to a very classic diagram.
To finally control the bistable flip-flop that follows it, it is sufficient to apply a series of positive edges to pin 3 of the IC4 circuit through diode D1, a double JK flip-flop in CMOS version.
Connecting the two inputs J and K together through a resistor 10 to the positive pole produces a similar operation to that of the famous lighting tele-switch.
Output 0 (pin 1) controls the small 6V relay, in series with the red LED indicator L2. The complementary output Q/ (pin 2) is responsible for illuminating a green LED when the device is at rest.
Any other operation could have been obtained by adapting the principle diagram and the copper tracks.
The small printed circuit board as shown below will accommodate all the components of this ON/OFF electronic switch using reflection sensor schematic. The integrated circuits or the ICs will need to be mounted on an appropriate IC socket.
A few screw terminals will be used to connect the power supply and the output relay connectors. The CNY70 sensor will be connected using 4 flexible wires, taking care to correctly identify the A-K and C-E pins.
The main application of an ON/OFF relay switch using a CNY70 reflection sensor is to control the operation of an electrical device depending on the presence or absence of an object. The following are some examples of its applications:
Conveyor belt control: The CNY70 sensor could be positioned near the conveyor belt to detect the whether an object is placed on the belt or not.
If an object is detected, the relay switch would be toggled ON to power a motor responsible for moving the belt. When there is no object, the relay switch will remain turned OFF, and the motor will remain inactive.
Security systems: The CNY70 sensor could be used as a proximity sensor to detect the presence of a passing intruder. When the reflection sensor detects a moving human, the relay switch is be turned ON to trigger an alarm or activate a camera.
Lighting control: The CNY70 sensor could be implemented to switch ON or OFF the lights of a room. In case the reflection sensor detects the reflected light from a person, the relay switch will be switched to turn on the lights.
When there is no human present in the room, no light will be reflected on the sensor and the relay switch will remain turned OFF, and the lights will switched off.
Home automation: The CNY70 sensor could be used to switch ON/OFF different appliances such as fans, air conditioners, and televisions in a home automation system.
If the sensor detects a human in a room. For instance, the fan or air conditioner might be turned on by activating the relay switch. The relay switch is turned off and the appliances are switched off when no one is in the room to conserve electricity.
Faucet Water Control: The above explained ON/OFF relay switch using reflection sensor can be implemented to automatically control the water activation and deactivation of a faucet or a water tap.
When the reflection sensor detects the approaching hands of a human, the facet solenoid is toggled ON to release water from the tap, and as soon as the hand is removed the faucet water is turned OFF.