Muhammad_Munir
Published © GPL3+

Touch Less Switch

How to make Touch Less Switch using Arduino UNO for Corona Safety

BeginnerFull instructions provided5,089
Touch Less Switch

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
IR obstacle sensor
×1
Relay (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
5 volt Relay
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Code

Arduino
#define r1 13
int relay1 = LOW;

int obstaclePin = 7;  // This is our input pin
int hasObstacle = HIGH;

void setup()
{
  pinMode(r1, OUTPUT);
  pinMode(obstaclePin, INPUT);
  Serial.begin(9600);  
}
void loop() {
  hasObstacle = digitalRead(obstaclePin);
  if (hasObstacle == LOW)
  {
            relay1 = ~ relay1;
            digitalWrite(r1,relay1);
            delay(1000);
   }
 
  delay(200);
}

Credits

Muhammad_Munir
79 projects • 56 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.

Comments