Replace your Doorbell Switch with a DIY Touchless Gesture Control One, Amid COVID-19 Scare

COVID-19 has led to so many deaths and months of lockdown. But the only thing that can stop this is social distancing and hygiene. For this, we need to touch common surfaces as less as possible. One such common surface is our doorbell switch which is touched by multiple people and hence can be a common ground for virus to spread. Let’s replace this switch with our DIY touchless gesture control switch to keep corona out of your way.

Let’s get that bell ringing

Things that you need:

Arduino Board:

One readily available development board is the Arduino Uno, but you can use any similar board such as Arduino Nano, NodeMCU etc. This example uses Arduino Uno.

Ultrasonic Sensor:

Ultrasonic sensor is a simple distance measurement sensor and is really suitable for our application. In this example, we are using an Ultrasonic Sensor module Hc-Sr04.

Relay Module:

A relay module allows us to control High Voltage devices using the Arduino. It isolates the Powerline with the TTL logic. A relay module is nothing but a switch for high voltage devices that can be turned ON or OFF by the Arduino. It comes with three points for powerline connection, Normally Closed (NC), Normally Open (NO) and the third being the common. For our application, we will use the NC mode because, we need to keep the doorbell of in normal condition.

Connection Diagram:

Connect the circuit in the following way and try to keep it compact as you have to replace it with your doorbell switch.

Schematic Diagram for your Touchless Gesture Control Wave Doorbell Switch

Upload the Code:

Now upload the following code to your board and see the magic.

const int pingPin = 7;
//adjust this to set the min speed of wave gesture
const int waveBackWait = 5000;
//Range of detection from the sensor in cm
const int range = 7;
void setup() {
pinMode(10, OUTPUT);
}
void loop() {
long duration, cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

cm = microsecondsToCentimeters(duration);
if(cm < range && cm > 1){
for(int i=waveBackWait; i>0; i--){
long new_duration, new_cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(pingPin, INPUT);
new_duration = pulseIn(pingPin, HIGH);

new_cm = microsecondsToCentimeters(new_duration);
if(new_cm < range && new_cm > 1){
//ring the doorbell
digitalWrite(10,HIGH);
delay(500);
digitalWrite(10,LOW);
}
}
}
}
long microsecondsToCentimeters(long microseconds) {
return microseconds / 29 / 2;
}

Now just wave your hand in front of the new doorbell switch to ring the doorbell

picture by Rafael O Potenza — dribble

If you want us to explain the code and working, feel free to comment below.

Until then, Stay Tuned!

--

--