Arduino Nano PIR with dynamic presence control by matghir 3d model
3dmdb logo
Thingiverse
Arduino Nano PIR with dynamic presence control by matghir

Arduino Nano PIR with dynamic presence control by matghir

by Thingiverse
Last crawled date: 3 years, 1 month ago
Arduino Nano with PIR module and Solid State Ralay, PIR pin 3, Relay pin 4 (low level trigger)
//CODE
int sensore=0;
int spento=0;
void setup() {
Serial.begin(9600);
pinMode(4,OUTPUT);
pinMode(3,INPUT);
digitalWrite(4,HIGH);
}
void loop() {
Serial.println(sensore);
sensore=digitalRead(3);
if(sensore){
digitalWrite(4,LOW);
spento=0;}
else
spento++;delay(100);
if(spento >500) //TIME ON 500*100=50000millisec change as you need
digitalWrite(4,HIGH);
}
//END
Material:
https://www.aliexpress.com/item/ree-Shipping-HC-SR501-Adjust-Infrared-IR-Pyroelectric-Infrared-PIR-module-Motion-Sensor-Detector-Module-We/32710944048.html?spm=a2g0s.9042311.0.0.YVdXux
https://www.aliexpress.com/item/1pcs-Nano-V3-0-ATmega168P-CH340-MicroUSB-Compatible-for-Arduino-Nano-V3-0-hei/32691701798.html?spm=a2g0s.9042311.0.0.YVdXux
https://www.aliexpress.com/item/5V-1-Channel-SSR-G3MB-202P-Solid-State-Relay-Module-240V-2A-Output-with-Resistive-Fuse/32796321054.html?spm=a2g0s.9042311.0.0.YVdXux
You also need a 5v USB source

Tags