PIR-liiketunnistin liikkeen havaitsemiseen, säädettävällä ajalla ja tunnistusetäisyydellä.
SKU: OT704-C87 Tuotenumero: AB039 EAN: 8029313760373 Sijainti: C08.07
Vaihtoehto
Liiketunnistin mikroaaltotutkalla RCWL-051
€ 2,45
Katso tämä vaihtoehto
Näin kytket PIR-anturi HC-SR501 liiketunnistin:n Arduino UNOon tai ESP32:een, mukana esimerkkisketsi, jonka voit ladata heti.
Tämä projekti tunnistaa ihmisen liikkeen HC-SR501 PIR -sensorilla. Kun liikettä havaitaan, sensorin lähtöpinni menee HIGH-tilaan, jolloin onboard LED syttyy ja varoitus tulostetaan Serial Monitoriin. Avaa Serial Monitor 115200 baud -nopeudella nähdäksesi liikkeen tilan reaaliajassa.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : HC-SR501 Motion Detection with Arduino Uno
* Board : Arduino UNO (arduino:avr:uno)
* Parts : HC-SR501 PIR Motion Sensor
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// HC-SR501 PIR Motion Sensor Demo
const int PIR_PIN = 2;
const int LED_PIN = 13;
int lastState = LOW;
void setup() {
pinMode(PIR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(115200);
Serial.println(F("HC-SR501 PIR Motion Sensor Initialized"));
Serial.println(F("Warming up sensor (approx. 30-60 seconds)..."));
}
void loop() {
int motionState = digitalRead(PIR_PIN);
if (motionState != lastState) {
if (motionState == HIGH) {
digitalWrite(LED_PIN, HIGH);
Serial.println(F("Motion detected!"));
} else {
digitalWrite(LED_PIN, LOW);
Serial.println(F("Motion ended."));
}
lastState = motionState;
}
delay(100);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Tämä projekti tunnistaa liikettä HC-SR501 PIR-anturin avulla. Anturi saa käyttövirtansa 5V VIN -nastasta, ja 1kΩ/2kΩ vastuksista tehty jännitejakaja sovittaa anturin ulostulon turvallisesti ESP32:n 3.3V-sisääntuloon. Kun liikettä havaitaan, onboard LED syttyy ja ilmoitus lähetetään Serial Monitoriin.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : Motion Detection with HC-SR501 and ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : HC-SR501 PIR Motion Sensor
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// HC-SR501 PIR Motion Sensor Demo
const int PIR_PIN = 13; // Connected to HC-SR501 OUT via divider
const int LED_PIN = 2; // Onboard LED
int lastState = LOW;
void setup() {
Serial.begin(115200);
pinMode(PIR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.println("HC-SR501 Sensor warming up (approx. 30-60s)...");
delay(2000);
Serial.println("Ready to detect motion.");
}
void loop() {
int motion = digitalRead(PIR_PIN);
if (motion != lastState) {
if (motion == HIGH) {
digitalWrite(LED_PIN, HIGH);
Serial.println("Motion detected!");
} else {
digitalWrite(LED_PIN, LOW);
Serial.println("Motion ended.");
}
lastState = motion;
}
delay(50);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
HC-SR501 PIR-liiketunnistin on infrapunaliiketunnistin, jonka tekniset tiedot ovat seuraavat:
– Tunnistusetäisyys: 3-7m.
– Viive: 5-200s
– Ulostulojännite: 3.3V
- Toimii jännitteellä: 4.5-20V
– Tunnistuskulma: <140°.
HC-SR501 PIR-liiketunnistin tunnistaa liikettä infrapunan avulla. Kun liikettä havaitaan, se antaa 3.3v signaalin ulostulonastalle; aika on säädettävissä potentiometrillä VR1. Tunnistusetäisyys on säädettävissä 3-7 metrin välillä potentiometrillä VR2.
| Lähtöjännite | 3.3 V |
|---|---|
| Tunnistusetäisyys | 3-7 m |
| Viive | 5-200 s |
Toimii täydellisesti ja näyttää upealta asetelmassa.
Tämä versio ei valitettavasti tule mukana jumpereilla H- ja L-asennon valitsemista varten. Muuten se toimii kuitenkin erinomaisesti.
Etkö ole tyytyväinen? Sinulla on 30 päivää aikaa vastaanotosta palauttaa tuote.
Kaikki palautuksista
PIR-anturi HC-SR501 liiketunnistin