- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Lesson - 12: Interfacing HC-SR501 PIR Motion Sensor with Arduino
Lesson - 12: Interfacing HC-SR501 PIR Motion Sensor with Arduino
Hello and welcome to Electro Nerds Academy. In this tutorial, we’ll learn how to interface the HC-SR501 PIR sensor with Arduino and use it to build a simple motion-controlled light project.
The PIR (Passive Infrared) sensor detects motion by sensing infrared radiation emitted by warm objects like humans and animals. It’s widely used in motion detectors, automatic lighting systems, home security alarms, and IoT projects.
In this video, you’ll learn:
✅ How the HC-SR501 PIR sensor works
✅ What are pyroelectric sensors, Fresnel lenses, and on board electronics
✅ How to adjust sensitivity and time delay using onboard potentiometers.
✅ The difference between single trigger and multiple trigger modes.
✅ Step-by-step circuit connections with Arduino and a relay module.
✅ Writing and uploading the Arduino code to control a household light bulb with motion detection.
Code used in this video:
// HC-SR501 PIR Motion Sensor with Arduino and Relay
// Electro Nerds Academy
int RELAY = 5; // Relay control pin
int SENSOR = 4; // PIR sensor output pin
int value = 0; // PIR sensor value
void setup()
{
pinMode(RELAY, OUTPUT); // Relay pin as output
pinMode(SENSOR, INPUT); // PIR sensor pin as input
delay(40000); // 40 seconds for PIR sensor calibration
}
void loop()
{
value = digitalRead(SENSOR); // Read PIR sensor
if (value == 1)
{ // Motion detected
digitalWrite(RELAY, LOW); // Turn ON relay (active LOW)
delay(100);
}
if (value == 0)
{ // No motion
digitalWrite(RELAY, HIGH); // Turn OFF relay
delay(100);
}
}
⚡ Warning: This project involves working with AC mains voltage when connecting the light bulb to the relay. Please take proper safety precautions. And we are not responsible for any damage done.
By the end of this video, you’ll be able to create your own motion-activated light system using Arduino and the HC-SR501 PIR sensor.
If you found this helpful, don’t forget to Like 👍, Share and Subscribe 🔔 to Electro Nerds Academy for more Arduino and electronics tutorials like this!
#HCSR501 #pirsensor #ArduinoProjects #ElectronicsDIY #arduino #arduinotutorials #embeddedsystems #electronicsforbeginners #electronerdsacademy #arduinotutorials #ElectronicsForBeginners #arduinoprogramming #circuitbuilding
Видео Lesson - 12: Interfacing HC-SR501 PIR Motion Sensor with Arduino канала Electro Nerds Academy
Hello and welcome to Electro Nerds Academy. In this tutorial, we’ll learn how to interface the HC-SR501 PIR sensor with Arduino and use it to build a simple motion-controlled light project.
The PIR (Passive Infrared) sensor detects motion by sensing infrared radiation emitted by warm objects like humans and animals. It’s widely used in motion detectors, automatic lighting systems, home security alarms, and IoT projects.
In this video, you’ll learn:
✅ How the HC-SR501 PIR sensor works
✅ What are pyroelectric sensors, Fresnel lenses, and on board electronics
✅ How to adjust sensitivity and time delay using onboard potentiometers.
✅ The difference between single trigger and multiple trigger modes.
✅ Step-by-step circuit connections with Arduino and a relay module.
✅ Writing and uploading the Arduino code to control a household light bulb with motion detection.
Code used in this video:
// HC-SR501 PIR Motion Sensor with Arduino and Relay
// Electro Nerds Academy
int RELAY = 5; // Relay control pin
int SENSOR = 4; // PIR sensor output pin
int value = 0; // PIR sensor value
void setup()
{
pinMode(RELAY, OUTPUT); // Relay pin as output
pinMode(SENSOR, INPUT); // PIR sensor pin as input
delay(40000); // 40 seconds for PIR sensor calibration
}
void loop()
{
value = digitalRead(SENSOR); // Read PIR sensor
if (value == 1)
{ // Motion detected
digitalWrite(RELAY, LOW); // Turn ON relay (active LOW)
delay(100);
}
if (value == 0)
{ // No motion
digitalWrite(RELAY, HIGH); // Turn OFF relay
delay(100);
}
}
⚡ Warning: This project involves working with AC mains voltage when connecting the light bulb to the relay. Please take proper safety precautions. And we are not responsible for any damage done.
By the end of this video, you’ll be able to create your own motion-activated light system using Arduino and the HC-SR501 PIR sensor.
If you found this helpful, don’t forget to Like 👍, Share and Subscribe 🔔 to Electro Nerds Academy for more Arduino and electronics tutorials like this!
#HCSR501 #pirsensor #ArduinoProjects #ElectronicsDIY #arduino #arduinotutorials #embeddedsystems #electronicsforbeginners #electronerdsacademy #arduinotutorials #ElectronicsForBeginners #arduinoprogramming #circuitbuilding
Видео Lesson - 12: Interfacing HC-SR501 PIR Motion Sensor with Arduino канала Electro Nerds Academy
Комментарии отсутствуют
Информация о видео
4 сентября 2025 г. 2:25:29
00:07:35
Другие видео канала


![Lesson-5 : Master Conditional Logic [ if, else if, AND(&&), OR(||), NOT(!) Explained! ]](https://i.ytimg.com/vi/xSPRBO0VzU8/default.jpg)










![Lesson:1 - What is an Arduino? [ A Beginner's Friendly Introduction ]](https://i.ytimg.com/vi/ishxa5BSiss/default.jpg)






