Image 4


In these days of Virus spread , automatic hand sanitizer and auto water tap are the need of the hour.

This is a very simple and low cost effective circuit without a Microcontroller.

Water pump or Water Solenoid can be controlled for dispensing sanitizer or water automatically when hand is brought near the sensor.

Sensor used here is an IR MODULE.

Image 3


The IR sensor module is built on  IR Transmitter and Receiver, Opamp, Variable Resistor &  output LED indicator. IR LED Transmitter is white or transparent in colour,and emits infra red light invisible to human eye.IR Receiver is a photo diode black in color to absorb more light.

IR rays reflected from object is sensed by this receiver and current flow is proportional to the amount of Light. This property makes it useful for IR detection.

A LM358 or 386 comparator is on board and gives a LOW signal while detecting IR.

Normally Output pin is HIGH and becomes LOW on any intruder object.The blue trimpot can be adjusted for sensitivity.

The board operates on 5V DC , and we need a 7805 regulator to convert 12v to 5v.

Image 2


The main device in the circuit is the 4 leg IC OPTOCOUPLER PC817.

It is the cheapest IC available and price is less than a 555 IC.


It has inbuilt  Infrared Emitting Diode (IR LED) and a photo transistor . It is Enclosed in a 4 pin package.

The photo transistor’s base becomes activated when LED conducts and throws light on it. When the current flowing through the LED is interrupted, the infra-red emitted light is cut-off, causing the photo-transistor to cease conducting. The photo-transistor can be used to switch current in the output circuit.

The black DOT is pin 1 which is ANODE of Diode.


The output of OPTO drives a Transistor and in turn the solenoid.

The transistor we use is a NPN  BD139.


Image 7

  • Continuous Collector current (IC) is 1.5A
  • Collector-Emitter voltage (VCE) is 80 V
  • Collector-Base voltage (VCB) is 80V
  • Emitter Base Breakdown Voltage (VBE) is 5V
  • DC current gain (hfe) is 40 to 160

To the collector of BD139 is added the load (solenoid or water pump) through supply voltage.

When BD139 conducts , it switches ON the solenoid.

A diode 1n4007 is used across the coil of solenoid.

A    FLY BACK Diode is placed with reverse polarity from the power supply and in parallel to the relay’s inductance coil. The use of a diode in a relay circuit prevents huge voltage spikes from arising when the power supply is disconnected. A flyback diode is sometimes called flywheel diode, relay diode, or snubber diode as a flyback diode circuit is a type of snubber circuit.

The solenoid used for water tap is the one widely used in water coolers.

Normal working voltage is 24v DC , but it works fine on 12v.

Image 5


The valve features a solenoid, which is an electric coil with a movable ferromagnetic core (plunger) in its center. In the rest position, the plunger closes off a small passage. An electric current through the coil creates a magnetic field. The magnetic field exerts an upwards force on the plunger opening the passage.

This is the basic principle that is used to open and close solenoid valves.

The hole size of 1/4 , 1/2 inches available.

Smaller size ones used for sanitizer dispenser and the bigger ones for water tap.

Instead of solenoid you can replace with a pump motor also.

Image 6

This is a low cost, small size Submersible Pump Motor which can be operated from a 2.5 ~ 6V power supply. It can take up to 120 liters per hour with very low current consumption of 220mA. Just connect tube pipe to the motor outlet, submerge it in water and power it. Make sure that the water level is always higher than the motor. Dry run may damage the motor due to heating and it will also produce noise.

The final circuit requires a 12v supply .

The IR module used here is sensitive to Sun Light.So always cover the IR LEDs with a black sleeve or tape and adjust sensitivity by turning the blue trimpot.

When hand is brought near the IR circuit , it sends a LOW signal to OPTO coupler.

This conducts the BD139 and in turn operates the solenoid or pump.