Compacte PIR bewegingssensor voor eenvoudige detectie in kleine projecten.
SKU: OT2047-B81 Número do artigo: NB111 EAN: 4765791479546 Localização: B08.01
Alternativa
Sensor PIR HC-SR501 Sensor de movimento
€ 2,00
Ver esta alternativa
Como ligar o Mini sensor de movimento infravermelho piroelétrico PIR a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project detects motion using a Mini PIR sensor and triggers the Arduino's built-in LED. When movement is detected, the LED turns on and a notification is printed to the Serial Monitor. Allow a brief warm-up period after powering on for the sensor to stabilize.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : Mini PIR Motion Detector
* Board : Arduino UNO (arduino:avr:uno)
* Parts : Mini PIR
* 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.
* ==================================================================
*/
// Pin definitions
const int pirPin = 2;
const int ledPin = 13;
void setup() {
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
Serial.println(F("Mini PIR Sensor Initializing..."));
Serial.println(F("Waiting 5 seconds for sensor to settle..."));
delay(5000);
Serial.println(F("Ready! Monitoring for motion..."));
}
void loop() {
int motionDetected = digitalRead(pirPin);
if (motionDetected == HIGH) {
digitalWrite(ledPin, HIGH);
Serial.println(F("Motion detected!"));
} else {
digitalWrite(ledPin, LOW);
Serial.println(F("Scanning... No motion."));
}
delay(300);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project detects human motion using a Mini PIR motion sensor. When motion is detected, the ESP32 turns on the onboard LED (GPIO 2) and logs a message to the Serial Monitor. Powering the sensor with 3.3V ensures safe signal levels for the ESP32 input.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : Mini PIR Motion Detector with ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : Mini PIR
* 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.
* ==================================================================
*/
// Mini PIR Motion Detection with ESP32
const int PIR_PIN = 13; // Connected to Mini PIR OUT
const int LED_PIN = 2; // ESP32 onboard LED
int lastState = LOW;
void setup() {
Serial.begin(115200);
pinMode(PIR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
Serial.println("PIR Sensor Initializing... Please wait 10-30s for sensor warm-up.");
}
void loop() {
int currentState = digitalRead(PIR_PIN);
if (currentState != lastState) {
lastState = currentState;
if (currentState == HIGH) {
digitalWrite(LED_PIN, HIGH);
Serial.println("Motion detected!");
} else {
digitalWrite(LED_PIN, LOW);
Serial.println("Motion ended.");
}
}
delay(50);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
O irmão mais pequeno do sensor PIR normal; a cabeça tem um diâmetro de apenas 1,1cm
Pinos:
- Vin (indicado com "+" e/ou "U1")
- Out (pino do meio)
- GND/ground/min (indicado com "-" e/ou "C1")
Dimensões
Comprimento: 2,8cm
Largura: 1,4cm
Altura: 1,4cm
| Largura | 1,4 cm |
|---|---|
| Temperatura de trabalho | -20°C - +60°C |
| Tensão de entrada | DC 2.7-12V |
| Tensão de saída | High 3.3 V /Low 0V |
| Comprimento | 2,8 cm |
| Diâmetro | 1,1 cm |
| Altura | 1,4cm |
| Dimensões da PCB | 10mm*8mm |
| Corrente em repouso | <100uA |
| Distância de deteção | 3 m |
| Tempo de atraso | cerca de 2 segundos (± 30% de desvio) |
| Dimensão total | 12mm*27mm |
| Ângulo do sensor | <100° |
| Tipo de lente | Pequeno |
A potência é muito fraca, dois metros
Top.......
funciona bem, mas às vezes deteta movimento inexistente
Funciona bem. Zona de deteção mediana, por isso é bom para um projetinho mas menos bom para uma solução a sério.
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Mini sensor de movimento infravermelho piroelétrico PIR