MakerWorld
Decor
Go to Model
Night lamp with movement sensor
13
Downloads
8
Likes
2
Makes
Necessary material:Wamos D1PIR sensorLedsRelayWelderArdunino Code: PENDING IMPROVEMENTint 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:
Did you print this model? Sign in and share your make!
Sign in to leave a comment
Sign inNo comments yet – be the first!