The project is one of the various methods of getting hand wash without touching the the pump in it. The person has to simply stand in front of the IR sensor and the soap will be released itself (but in the video, as I am shooting it, I am not able to stand in front. Rather, I use my hand as an obstacle.).
2. Demonstration3. Circuit- 3.1 Components
1. IR Transceiver
2. Micro Servo
- 3.2 Connections
>>Connect the 'red' wire of both the servos to +5V and the 'brown' wire to Gnd.
>>Connect the PWM wire of one servo to GPIO pin 3 and the other to pin 4.
>>Connect the output of the IR transceiver to pin 5 (and also make the power and ground connections respectively.).
3. SetupTake the hand wash bottle and stick two servo motors on the either sides of the pump using the glue gun. Attach a hook on the top of the pump head and tie thread to both the servo arms tightly so that no thread is loose. Make sure that both servos are st 0 degrees initially. Place the IR sensor along side the bottle.
4. Code#include<Servo.h>
Servo s1,s2;
void setup()
{
s1.attach(3);
s2.attach(4);
pinMode(5,INPUT);
}
void loop()
{
s1.write(0);
s2.write(0);
if(digitalRead(5)==1)
{
s1.write(180);
s2.write(180);
delay(500);
}
}
Comments