How to use PIR Motion Sensor with Arduino | Motion sensor light

hash include electronics
24 Jun 202105:35

Summary

TLDRIn this video, you'll learn how to use a PIR motion sensor with Arduino to detect human movement and automatically control lights. The tutorial covers the components needed, including a PIR sensor, relay, Arduino Uno, and more, to build a motion-activated lighting system. Detailed explanations on sensor operation, adjustments for sensitivity and time delay, and setting up H/L modes are provided. You'll also see a demo of the system, where the light turns on with movement and off when no motion is detected, offering energy-saving benefits. The video includes code and a wiring diagram for easy replication.

Takeaways

  • 🔌 The video demonstrates how to use a PIR motion sensor with Arduino to detect human movement and control a light automatically.
  • 🛠️ The PIR motion sensor used in the video is the HC-SR501, a passive infrared sensor that detects infrared radiation emitted by humans or animals.
  • 💡 The PIR sensor has three pins: VCC (5V power), OUT (digital output), and GND (ground). When motion is detected, it outputs a high signal.
  • ⚙️ The PIR sensor has two adjustable potentiometers for sensitivity (motion detection distance) and time (how long the signal stays high).
  • 🔁 The sensor has two modes: H mode (repeat retriggering) and L mode (non-retriggering), with H mode being used in this project to keep the light on as long as motion is detected.
  • 🔧 Components used include: Arduino Uno, PIR sensor, 5V relay, AC bulb, socket, plug, 7-12V DC battery, breadboard, and jumper wires.
  • ⚡ The relay is controlled by the Arduino to switch the AC bulb on or off based on the PIR sensor's output.
  • 📜 The Arduino code defines the sensor and relay pins, reads sensor values, and triggers the relay to turn the light on or off based on motion detection.
  • ⏳ After uploading the code and calibrating the PIR sensor (takes about 15-20 seconds), the system automatically controls the light based on detected motion.
  • 🏠 This system can be applied in locations like public toilets, hallways, and walk-in pantries, offering energy-saving benefits by automatically switching off lights when not needed.

Q & A

  • What is the main purpose of using a PIR motion sensor with Arduino in this project?

    -The main purpose is to detect human movement and automatically switch on or off a light based on motion detection, which can be applied for energy-saving purposes in various environments.

  • What does PIR stand for and how does the PIR sensor work?

    -PIR stands for Passive Infrared Sensor. It works by detecting infrared radiation emitted by or reflected from objects, such as humans or animals. When motion is detected, it outputs a high signal, and when no motion is detected, it outputs a low signal.

  • What are the three control pins on the PIR sensor and what are their functions?

    -The three control pins on the PIR sensor are VCC, Out, and Ground. VCC provides power (+5V), the Out pin gives the digital output (1 or 0) based on motion detection, and the Ground pin connects to the common ground.

  • What do the two potentiometers on the PIR sensor board control?

    -The two potentiometers control sensitivity and time. The sensitivity potentiometer adjusts the detection range, which can vary between 3 to 7 meters, while the time potentiometer sets how long the output signal stays high after detecting motion, ranging from 3 seconds to 5 minutes.

  • What is the difference between 'H mode' and 'L mode' on the PIR sensor?

    -'H mode' is the whole repeat retriggering mode, meaning the sensor continues to output a high signal as long as movement is detected. 'L mode' is the no-repeat mode, where the output stays high for the time set by the time potentiometer, even if more motion occurs.

  • Which mode is used in this project, and why?

    -The project uses 'H mode' because it continuously detects motion and keeps the light on as long as movement is present, which is ideal for this automatic lighting application.

  • What are the main components needed for this project?

    -The main components include an Arduino Uno, PIR sensor module, 5V relay, AC bulb, socket and plug, a 7-12V DC battery, a breadboard, and jumper wires.

  • How is the PIR sensor connected to the Arduino?

    -The PIR sensor is connected to the Arduino with the VCC and Ground pins connected to the breadboard, and the Out pin connected to the D2 pin of the Arduino.

  • How does the relay interact with the Arduino to control the AC bulb?

    -The relay is connected to the Arduino, with its VCC and Ground pins connected to the breadboard and its In pin connected to the D3 pin of the Arduino. The relay is triggered by a low signal, switching on or off the AC bulb based on motion detection.

  • What is the practical use of this project in everyday scenarios?

    -This project can be used in places like public toilets, hallways, and walk-in pantries where automatic lighting can provide energy savings by only turning the lights on when needed, eliminating the need for users to manually switch them off.

Outlines

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Mindmap

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Keywords

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Highlights

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن

Transcripts

plate

هذا القسم متوفر فقط للمشتركين. يرجى الترقية للوصول إلى هذه الميزة.

قم بالترقية الآن
Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
PIR sensorArduino projectmotion detectionautomatic lightingenergy savinghome automationsensor tutorialDIY electronicsrelay modulesmart lighting
هل تحتاج إلى تلخيص باللغة الإنجليزية؟