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
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
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
HOW TO: Use Lithium 3.7v batteries in small Arduino projects.HOW TO: Develop an iOS C++ app in two days.A comparison of many common Arduino types and their uses.HOW TO: Get an arduino to turn off its own power.HOW TO: Control an Arduino with an iPhone using BLEHOW TO: Use a NRF24L01 + Arduino to remotely control a motorHOW TO: Bluetooth Arduino connecting to Python on desktopHOW TO: Easy GPS connection to an ArduinoHOW TO: Arduino programming via a Raspberry Pi from a PC DesktopHOW TO: Arduino control of DC, Stepper, and servo motorsHOW TO: Unit Test the UI in Cocos2d-x applicationsHOW TO: Measure distance wth the Arduino and HC SR04 ultrasonic sensorEasy TI 84 Plus Operating System UpgradeHOW TO: Quick and Dirty Arduino Mini Programming With FTDI232HOW TO: LM7805 vs LM2940 voltage regulator Comparison plus setup howtoHOW TO: control DC Motors with Arduino + L298NHOW TO: Programming an Arduino ATTiny85 made simple