PIR Motion Human Sensor AM312
-
RM8.50
- Product Code: 001-0035
- Availability: 10-14 Days
Description:
the AM312 PIR Motion Sensor is a cutting-edge and compact passive infrared (PIR) motion sensor specifically designed to enhance security and efficiency in a wide array of applications, including burglar alarms and automated lighting systems. Harnessing the power of advanced technology, this remarkable sensor boasts an exceptional capability to effortlessly interface with microcontrollers such as the ESP8266 or ESP32, accepting a direct supply of 3.3 volts. Embodying precision and reliability, the AM312 PIR Motion Sensor stands as a beacon of innovation, empowering your projects with heightened responsiveness and accuracy to detect even the subtlest movements in their surroundings. Unleash the potential of your security setups and automation endeavors with this state-of-the-art sensor, making safety and convenience an ever-accessible reality.
Features:
Technical Parameters:
Pinout of the Module:
Pin on the PCB | Description |
---|---|
VIN | Positive DC power supply between 2.7-12V |
Out | Digital output (HIGH: 3.3V or LOW: 0V) |
GND | Ground |
Circuit:
Code:
int led = 13; // the pin that the LED is atteched to int sensor = 2; // the pin that the sensor is atteched to int state = LOW; // by default, no motion detected int val = 0; // variable to store the sensor status (value) void setup() { pinMode(led, OUTPUT); // initalize LED as an output pinMode(sensor, INPUT); // initialize sensor as an input Serial.begin(9600); // initialize serial } void loop(){ val = digitalRead(sensor); // read sensor value if (val == HIGH) { // check if the sensor is HIGH digitalWrite(led, HIGH); // turn LED ON delay(500); // delay 100 milliseconds if (state == LOW) { Serial.println("Motion detected!"); state = HIGH; // update variable state to HIGH } } else { digitalWrite(led, LOW); // turn LED OFF delay(500); // delay 200 milliseconds if (state == HIGH){ Serial.println("Motion stopped!"); state = LOW; // update variable state to LOW } } }
Documents: