Night lamp with movement sensor

Copyright Claim

Night lamp with movement sensor

Boost
0
1
0

Print Profile(0)


Add the first print profile to earn points

Boost
0
1
0
0
0
0
Released

Description

Necessary material:

  • Wamos D1
  • PIR sensor
  • Leds
  • Relay
  • Welder

Ardunino Code: PENDING IMPROVEMENT

int pirPin = D7;
int rele = D6;
int val;

void setup()
{
   Serial.begin(9600);
   pinMode(rele, OUTPUT);
}

void loop()
{
   val = digitalRead(pirPin);
   if (val == LOW)
   {
      Serial.println("light off");
      digitalWrite(rele, LOW);
   }
   else
   {
      Serial.println("light on");
      digitalWrite(rele, HIGH);
      delay(60000);//secons light 60s
   }
   delay(500);
}

 

It is not the right plate that of the scheme, it simply serves as guidance for wiring:

Comment & Rating (0)

Please fill in your opinion
(0/5000)

No more