How to use Sensor (HC-SR501) with Arduino
In this tutorial we will learn how to use Sensor (HC-SR501) with Arduino.
For this tutorial we will use Relay Module, Lamp, Sensor HC-SR501, Buzzer and Arduino UNO.
Hardware Required :
- HC-SR501 PIR
- 5V 1 Way Relay
- Jumper Wires
Project circuit :
Project circuit diagram is shown below.
For most of our Arduino projects that require to detect when an individual has left or entered the world , or has approached, HC-SR501 PIR sensors are an excellent choice. they’re low power and low cost, pretty rugged, have a good lens range, easy to interface with and are insanely popular among hobbyists.
HC-SR501 PIR sensor has three output pins VCC, Output and Ground. it’s a built-in transformer so it are often powered by any DC voltage from 4.5 to 12 volts, typically 5V is employed . aside from this, there are a few options you’ve got together with your PIR.
Here, I used a really simple PIR motion detector. This sensor will measure the infrared (IR) light that’s emitted by moving objects in its field of view, for instance , people traveling . it’s very easy and quite cheap to interface with Arduino. you’ll use any brand that you simply want for this sensor, it just needs a voltage level of 5V so as to be compatible with the Arduino Uno board.
Link to the Code :