The PIR sensor is used in home automation, but also to can be used for many applications, here I'm going to explain only the basics about this sensor, and I'm going to use Arduino Uno, some Jumpers, one PCB, one red LED, cable type D, a computer and Arduino software. the Sketch: const int sensorPir = 2;
const int ledPin = 13;
int buttonState = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(sensorPir, INPUT);
Serial.begin(9600);
}
void loop(){
buttonState = digitalRead(sensorPir);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
Serial.println(buttonState);
delay(500);
} This works only in a simple way to detect movement. Let's see how it works. const int sensorPir = 2; it's about where is going to be put in the digital input on the Arduino Board. const int ledPin = 13; I put...
The technology give us a great opportunity in all the areas we have as a humans, Farming, Medic, Militar, Space, and so on. Here in this blog I'm going to research and develop many applications in different ways, and see if this small application can work beyond the laboratory or house applications, and put them in the field for massive production, or is only for laboratory application.