Sensores Ópticos

Produtos visualizados

PIR Motion Sensor Ver maior

PIR Sensor de movimento HC-SR501

BE15000033

Novo produto

PIR Motion Sensor

Mais detalhes

4,92 € com IVA

Adicionar à Lista de desejos

Mais informação

Pin-out and Instruction Pamphlet
Technical Specifications:
Working Voltage : 5 VDC to 20 VDC
(recomended between 5 VDC and 12 VDC for thermal considerations).
Output voltage: 3.3V (LVTTL) transistor may be used to change output
Simple One Wire Device
Startup Time: 2 Seconds to get a measure on room volume
Left Knob: Controls output latch delay (Between left-most 2 and right-most 300 seconds)
Right Knob: Controls center of best detection (Between left-most 3M and right-most 7M)

Out Pin: High means the environment has changed (intruder, dog, etc…) Low means it will keep checking.

Pirardbb.gif

Code:

/*
 * PIR sensor tester
 */
 
int ledPin = 13;                // choose the pin for the LED
int inputPin = 2;               // choose the input pin (for PIR sensor)
int pirState = LOW;             // we start, assuming no motion detected
int val = 0;                    // variable for reading the pin status
 
void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare sensor as input
 
  Serial.begin(9600);
}
 
void loop(){
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, HIGH);  // turn LED ON
    if (pirState == LOW) {
      // we have just turned on
      Serial.println("Motion detected!");
      // We only want to print on the output change, not state
      pirState = HIGH;
    }
  } else {
    digitalWrite(ledPin, LOW); // turn LED OFF
    if (pirState == HIGH){
      // we have just turned of
      Serial.println("Motion ended!");
      // We only want to print on the output change, not state
      pirState = LOW;
    }
  }
}

Acessórios

Clientes que compraram este produto também compraram: