Hackster is hosting Hackster Holidays, Ep. 4: Livestream & Giveaway Drawing. Start streaming on Wednesday!Stream Hackster Holidays, Ep. 4 on Wednesday!
hrbhadrappa
Published © GPL3+

Automatic Gate opener using arduino and IR Sensor

It is automatically opened when anybody comes near to the door/Gate

IntermediateFull instructions provided18,973
Automatic Gate opener using arduino and IR Sensor

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
×1
LM293D H BRIDGE MOTOR DRIVER
×1
OLD CD DRIVE
×1
Jumper wires (generic)
Jumper wires (generic)
×1
USB-A to B Cable
USB-A to B Cable
×1
infrared proximity sensor
×1
CARDBOARDS
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Wire Stripper & Cutter, 30-10 AWG Solid & Stranded Wires
Wire Stripper & Cutter, 30-10 AWG Solid & Stranded Wires
Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Soldering Iron Tip, Knife
Soldering Iron Tip, Knife

Story

Read more

Schematics

SCHEMATIC

ASSEMBLY

Code

DOOR_DC

Arduino
THE CODE
#define doorsensor A0
#define m1 0
#define m2 1

void setup() 
{
  pinMode(m1, OUTPUT);
  pinMode(m2, OUTPUT);
  pinMode(doorsensor, INPUT);
  delay(300);
  }

void loop() 
{
  if(digitalRead(doorsensor))
  {
    digitalWrite(m1, HIGH);         // gate opening
    digitalWrite(m2, LOW);
    delay(350);
    digitalWrite(m1, LOW);          // gate stop for a while
    digitalWrite(m2, LOW);
    delay(300);
    digitalWrite(m1, LOW);           // gate closing
    digitalWrite(m2, HIGH);
    delay(350);
    digitalWrite(m1, LOW);            // gate closed
    digitalWrite(m2, LOW);
    delay(1000);
  }
  
  else 
  {
    digitalWrite(m1, LOW);
    digitalWrite(m2, LOW);
  }
}

Credits

hrbhadrappa

hrbhadrappa

0 projects • 1 follower

Comments