Загрузка страницы

HOW TO: Sense motion with the Arduino and HC-SR501 Infrared PIR Motion Sensor Detector Module

In 4 minutes I will show how to connect a cheap motion sensor up to an arduino and sense motion. Three wires, 4 minutes, very very simple. These are great for wildlife cameras, security systems, or other things that you want to activate upon detecting motion.
Here is the github:
https://github.com/LessonStudio/Arduino_PIR

Here is the source code:

int LED_PIN=13;
int INPUT_PIN=5;

void setup()
{
pinMode(LED_PIN, OUTPUT);
pinMode(INPUT_PIN, INPUT);
}

void loop()
{
int val=digitalRead(INPUT_PIN);
if(val==HIGH)
{
digitalWrite(LED_PIN, HIGH);
}
else
{
digitalWrite(LED_PIN, LOW);
}
}

Видео HOW TO: Sense motion with the Arduino and HC-SR501 Infrared PIR Motion Sensor Detector Module канала DonovanStudio
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
26 ноября 2015 г. 5:03:10
00:04:13
Яндекс.Метрика