Arduino nano motion sensor wiring diagram. Motion sensor with Arduino, HC-SR04 and LED. Changing pulse time and time between pulses
HC-SR501 Space Sensor Overview
The HCSR501 motion (or presence) sensor module based on the pyroelectric effect consists of a 500BP PIR sensor (Fig. 1) with additional electrical isolation on the BISS0001 chip and a Fresnel lens, which is used to increase the viewing radius and amplify the infrared signal (Fig. 2). The module is used to detect the movement of objects emitting infrared radiation. The sensing element of the module is a 500BP PIR sensor. The principle of its operation is based on pyroelectricity. This is the phenomenon of the appearance of an electric field in crystals when their temperature changes.The sensor operation is controlled by the BISS0001 chip. There are two potentiometers on the board, with the help of the first the object detection distance is set (from 3 to 7 m), with the help of the second - the delay after the first sensor operation (5 - 300 sec). The module has two modes - L and H. The operating mode is set using a jumper. L mode is a single operation mode, when a moving object is detected, a high signal level is set at the OUT output for the delay time set by the second potentiometer. During this time, the sensor does not respond to moving objects. This mode can be used in security systems to give an alarm signal to the siren. In H mode, the sensor is triggered every time motion is detected. This mode can be used to turn on the lighting. When the module is turned on, it is calibrated, the calibration duration is approximately one minute, after which the module is ready for operation. Install the sensor preferably away from open light sources.
Figure 1. PIR Sensor 500BP
Figure 2. Fresnel lens
Specifications HC-SR501
- Supply voltage: 4.5-20V
- Current consumption: 50 mA
- Output voltage OUT: HIGH - 3.3 V, LOW - 0 V
- Detection interval: 3-7m
- Delay duration after firing: 5 - 300 sec
- Viewing angle up to 120
- Blocking time until the next measurement: 2.5sec.
- Operating modes: L - single operation, H - operation on each event
- Operating temperature -20 to +80C
- Dimensions 32x24x18 mm
Connecting an Infrared Motion Sensor to an Arduino
The module has 3 outputs (Fig. 3):- VCC - power supply 5-20 V;
- GND - ground;
- OUT - digital output (0-3.3V).
Figure 3. Pin Assignment and HC-SR501 Setup
Let's connect the HC-SR501 module to the Arduino board (Connection diagram in Fig. 4) and write a simple sketch that signals with a sound signal and a message to the serial port when a moving object is detected. To fix the triggers by the microcontroller, we will use external interrupts on input 2. This is an int0 interrupt.
Figure 4. Connection diagram for connecting the HC-SR501 module to the Arduino board
Let's upload the sketch from Listing 1 to the Arduino board and see how the sensor reacts to obstacles (see Figure 5). Set the module to work mode L. Listing 1 // Sketch for an overview of the motion/presence sensor HC-SR501 // site // contact for connecting the sensor output #define PIN_HCSR501 2 // trigger flag boolean flagHCSR501=false; // speaker connection pin int soundPin=9; // sound signal frequency int freq=587; void setup() ( // initialize serial port Serial.begin(9600); // start interrupt handling int0 attachInterrupt(0, intHCSR501,RISING); ) void loop() ( if (flagHCSR501 == true) ( // Message to serial port Serial.println("Attention!!!"); // sound signal for 5 sec tone(soundPin,freq,5000); // reset flag flagHCSR501 = false; ) ) // handle interrupt void intHCSR501() ( // setting the sensor trigger flag flagHCSR501 = true; )
Figure 5 Serial Monitor Output
Using potentiometers, we experiment with the duration of the signal at the OUT output and the sensitivity of the sensor (the distance of fixing the object).
Usage example
Let's create an example of sending sms when a motion/presence sensor is triggered on a protected object. To do this, we will use a GPS / GPRS shield. We will need the following details:- arduino uno board
- GSM/GPRS shield
- npn transistor, for example C945
- resistor 470 ohm
- speaker 8 ohm 1W
- wires
Figure 6. Connection diagram
When the sensor is triggered, we call the procedure for sending sms with a text message Attenaction!!! to the PHONE number. The contents of the sketch are shown in Listing 2. The GSM/GPRS shield consumes up to 2 A in sms sending mode, so we use an external 12V 2A power supply. Listing 2 // Sketch 2 for an overview of the HC-SR501 motion/presence sensor // sending sms when the sensor is triggered // site // contact for connecting the sensor output #define PIN_HCSR501 2 // trigger flag boolean flagHCSR501 false; // speaker connection pin int soundPin=9; // sound signal frequency int freq=587; // SoftwareSerial library #include
Frequently Asked Questions FAQ
1. The module does not work when the object moves- Check if the module is connected correctly.
- Set the sensing distance with the potentiometer.
- Adjust the signal duration delay with the potentiometer.
- Set the jumper to single operation mode L.
PIR (passive infrared sensors) sensors allow you to capture movement.
Very often used in alarm systems. These sensors are small in size, inexpensive, consume little energy, are easy to operate, and are practically not subject to wear. In addition to PIR, such sensors are called pyroelectric and infrared motion sensors.
Pirloelectric motion sensor - general information
PIR motion sensors essentially consist of a pyroelectric sensing element (cylindrical part with a rectangular crystal in the center) that detects the level of infrared radiation. Everything around emits a small level of radiation. The higher the temperature, the higher the radiation level. The sensor is actually divided into two parts. This is due to the fact that it is not the level of radiation that is important to us, but directly the presence of movement within its sensitivity zone. The two parts of the sensor are set up so that if one half picks up more radiation than the other, the output will either be high or low.
The module itself, on which the motion sensor is installed, also consists of additional electrical piping: fuses, resistors and capacitors. Most inexpensive PIR sensors use inexpensive BISS0001 ("Micro Power PIR Motion Detector IC") chips. This chip perceives an external source of radiation and performs minimal signal processing to convert it from analog to digital form.
One of the basic models of pyroelectric sensors of this class looks like this:
Newer models of PIR sensors have additional outputs for additional configuration and pre-installed connectors for signal, power and ground:
PIR sensors are great for projects that need to detect the presence or absence of a person within a specific workspace. In addition to the advantages of such sensors listed above, they have a large sensitivity zone. However, please note that pyroelectric sensors will not give you information about how many people are around and how close they are to the sensor. In addition, they can work on pets.
General technical information
These specifications apply to PIR sensors sold in the Adafruit store. The principle of operation of similar sensors is similar, although the technical specifications may differ. So before working with a PIR sensor, check out its datasheet.
- Shape: Rectangle;
- Price: around $10.00 at the Adafruit store;
- Output signal: digital pulse high (3V) when there is movement and digital signal low when there is no movement. The pulse length depends on the resistors and capacitors on the module itself and is different in different sensors;
- Sensitivity range: up to 6 meters. Viewing angle 110° x 70°;
- Power supply: 3V - 9V, but the best option is 5 volts;
>To order from Aliexpress:
The principle of operation of pyroelectric (PIR) motion sensors
PIR sensors are not as simple as it might seem at first glance. The main reason is the large number of variables that affect its input and output signals. To explain the basics of how PIR sensors work, we use the figure below.
The pyroelectric motion sensor consists of two main parts. Each part includes a special material that is sensitive to infrared radiation. In this case, the lenses do not particularly affect the operation of the sensor, so we see two areas of sensitivity of the entire module. When the sensor is at rest, both sensors detect the same amount of radiation. For example, it can be the radiation of a room or an outdoor environment. When a warm-blooded object (human or animal) passes by, it crosses the sensitivity zone of the first sensor, as a result of which two different radiation values are generated on the PIR sensor module. When a person leaves the sensitivity zone of the first sensor, the values are aligned. It is the changes in the readings of the two sensors that are recorded and generate HIGH or LOW pulses at the output.
PIR sensor design
The sensitive elements of the PIR sensor are installed in a metal hermetic case, which protects against external noise, temperature changes and humidity. The rectangle in the center is made of a material that transmits infrared radiation (usually a material based on silicone). Behind this plate are two sensitive elements.
Figure from Murata datasheet:
Figure from RE200B datasheet:
The figure from the RE200B datasheet shows two sensitive elements:
The figure above shows the internal connection diagram.
lenses
Infrared motion sensors are almost identical in their structure. The main differences are sensitivity, which depends on the quality of the sensitive elements. In this case, optics play a significant role.
The figure above shows an example of a plastic lens. This means that the sensitivity range of the sensor consists of two rectangles. But, as a rule, we need to provide large viewing angles. To do this, you can use lenses similar to those used in cameras. In this case, the lens for the motion sensor should be small, thin and made of plastic, although it adds noise to the measurements. Therefore, most PIR sensors use Fresnel lenses (figure from Sensors Magazine):
Fresnel lenses concentrate radiation, significantly expanding the sensitivity range of pyro sensors (Figure from BHlens.com)
Figure from Cypress appnote 2105:
Now we have a much larger sensitivity range. At the same time, we remember that we have two sensitive elements and we need not so much two large rectangles as a large number of small sensitivity zones. To do this, the lens is divided into several sections, each of which is a separate Fresnel lens.
In the figure below you can see the individual sections - Fresnel lenses:
In this macro shot, notice that the texture of the individual lenses is different:
As a result, a whole set of sensitive areas is formed that interact with each other.
Pictures from NL11NH datasheet:
Below is another drawing. Brighter, but less informative. Also, note that most sensors have a 110 degree field of view, not 90.
Figure from IR-TEC:
PIR motion sensor connection
Most infrared motion sensor modules have three connectors on the back. The pinout may vary, so check it before connecting! Usually, corresponding inscriptions are made next to the connectors. One connector goes to the ground, the second gives the signal we are interested in from the sensors, the third - the ground. The supply voltage is typically 3-5 volts DC. However, sometimes there are sensors with a supply voltage of 12 volts. Some large sensors do not have a separate signal pin. Instead, a relay with ground, power, and two switches is used.
For a prototype of your device using an infrared motion sensor, it is convenient to use a circuit board, since most of these modules have three connectors, the distance between which is calculated exactly for the breadboard holes.
In our case, the red cable corresponds to power, black to ground, and yellow to signal. If you connect the cables incorrectly, the sensor will not fail, but it will not work.
PIR Motion Sensor Testing
Assemble the circuit according to the picture above. As a result, when the PIR sensor detects movement, a HIGH signal will be generated at the output, which corresponds to 3.3 V, and the LED will light up.
Please note that the pyroelectric sensor must "stabilise". Install batteries and wait 30-60 seconds. During this time, the LED may flash. Wait until the blinking stops and you can start waving your arms and walking around the sensor, watching the LED light up!
Sensor restart setting
The pyroelectric motion sensor has several tinctures. We'll look at "restart" first.
After connecting, look at the back of the module. Connectors must be installed in the upper left corner L, as shown in the figure below.
Please note that with this connection option, the LED does not burn constantly, but turns on and off when you move near it. This is the "non-retriggering" option.
Now set the connector to position H. After testing, it will turn out that the LED is constantly on if someone moves within the sensor's sensitivity zone. This is the restart mode.
The figure below is from the datasheet of the BISS0001 sensor:
For most cases, the "restart" mode (connector in position H as shown in the figure below) is better.
Setting the sensitivity
Many infrared motion sensors, including those from Adafruit, have a small potentiometer to adjust the sensitivity. Turning the potentiometer clockwise adds sensitivity to the sensor.
Changing pulse time and time between pulses
When we consider PIR sensors, two "delay" times are important. First time -Tx: how long the LED stays on after motion is detected. On many pyroelectric modules, this time is controlled by a built-in potentiometer. The second time interval is Ti: how long the LED is guaranteed not to light up when there was no movement. Changing this parameter is not so easy, you may need a soldering iron for this.
Let's take a look at the BISS datasheet:
Sensors from Adafruit have a potentiometer marked TIME. This is a variable resistor with a resistance of 1 megaohm, which is added to the 10 kilohm resistors. Capacitor C6 has a capacity of 0.01 microfarads, so:
Tx = 24576 x (10 kOhm + Rtime) x 0.01 uF
When the Rtime potentiometer is in the "zero" - fully counter-clockwise - position (0 megohms):
Tx = 24576 x (10 kΩ) x 0.01 uF = 2.5 seconds (approx.) When the Rtime pot is turned fully clockwise (1 megaohm):
Tx = 24576 x (1010 kΩ) x 0.01 uF = 250 seconds (approx.)
In the middle position of RTime, the time will be about 120 seconds (two minutes). That is, if you want to track the movement of an object at a rate of once per minute, turn the potentiometer 1/4 turn.
For older/other models of PIR sensors
If your sensor does not have potentiometers, you can adjust using resistors.
We are interested in resistors R10 and R9. Unfortunately, the Chinese know how to do a lot. Including confused inscriptions. The figure above shows an example that shows that R9 is confused with R17. Track the connection on the datasheet. R10 is connected to pin 3, R9 is connected to pin 7.
For example:
Tx is = 24576 * R10 * C6 = ~1.2 seconds
R10 = 4.7K and C6 = 10 nanofarads
Ti = 24 * R9 * C7 = ~1.2 seconds
R9 = 470K and C7 = 0.1 microfarad
You can change the delay time by installing different resistors and capacitors.
Connecting PIR Motion Sensor to Arduino
Let's write a program for reading values from a pyroelectric motion sensor. Connecting the PIR sensor to the microcontroller is simple. The sensor outputs a digital signal, so all you need to do is read the HIGH (motion detected) or LOW (no motion) signal from the Arduino pin.
When doing this, do not forget to set the connector to position H!
Apply 5 volts to the sensor. The earth is connected to the earth. After that, connect the signal pin from the sensor to the digital pin on the Arduino. In this example, pin 2 is used.
The program is simple. In fact, it monitors the state of pin 2. Namely: what signal is on it: LOW or HIGH. In addition, a message is entered when the state of the pin changes: there is movement or there is no movement.
* check PIR motion sensor
int ledPin = 13; // initialize the pin for the LED
int inputPin = 2; // initialize the pin to receive a signal from the pyroelectric motion sensor
int pirState = LOW; // start the program, assuming there is no movement
intval = 0; // variable for reading pin state
pinMode(ledPin, OUTPUT); // declare LED as OUTPUT
pinMode(inputPin, INPUT); // declare the sensor as an INPUT
Serial.begin(9600);
val = digitalRead(inputPin); // read the value from the sensor
if (val == HIGH) ( // check if the read value is HIGH
digitalWrite(ledPin, HIGH); // turn on the LED
if (pirState == LOW) (
// we just included
Serial.println("Motion detected!");
pirState=HIGH;
digitalWrite(ledPin, LOW); // turn off the LED
if (pirState == HIGH)(
// we just turned it off
Serial.println("Motion ended!");
// we're displaying the change, not the state, on the serial monitor
Do not forget that a microcontroller is not always needed to work with a pyroelectric sensor. Sometimes you can get by with a simple relay.
PIR (passive infrared sensors) sensors allow you to capture movement. Very often used in alarm systems. These sensors are small in size, inexpensive, consume little energy, are easy to operate, and are practically not subject to wear. In addition to PIR, such sensors are called pyroelectric and infrared motion sensors.
There was a need to purchase a pair of sensors for domestic use in their crafts based on LED backlighting.
Since my consumption currents are relatively small, and the supply voltage is 12 V, compact pyroelectric infrared motion sensors in the case were purchased.
Package:
I ordered two sensors with the ability to adjust the photosensitivity:
Sensors support power from 12 to 24 volts. They already have soldered standard wires about 30 cm long with sockets for input and output, with a 2.1 mm center pin, and this is a big plus. No need to solder anything, just connect the power supply and use:
The sensors themselves are quite compact. Appearance:
Dimensions:
To get to the board and adjustments, you need to open the case. Back cover on latches, pry off with a screwdriver:
The pay looks like this:
I found a diagram of this device, the ratings may differ, but in general, to understand the essence of the work, it is correct:
Here we see a voltage regulator at the input to power the microcircuit:
By the way, here is the datasheet of this element, it can be seen that different markings imply different stabilized output voltages. But the main point is that it supports an input voltage of up to 24 volts, which is why it should not be exceeded.
Further, according to the scheme, there is a field effect transistor at the output, which is the key in the power-load circuit:
The datasheet lists a maximum continuous current at normal room temperature of 15A, but since we don't have transistor cooling, we are limited in power output.
The heart of the device is the Biss0001 chip. This chip perceives an external radiation source and performs minimal signal processing to convert it from analog to digital form:
A PIR motion sensor essentially consists of a pyroelectric sensing element (a cylindrical piece with a rectangular crystal in the center) that detects the level of infrared radiation. The sensor is actually divided into two parts. This is due to the fact that it is not the level of radiation that is important to us, but directly the presence of movement within its sensitivity zone. The two parts of the sensor are set up so that if one half picks up more radiation than the other, the output will either be high or low.
Now directly to the adjustments. I set up the device, accordingly threw what and where to turn:
The time is adjustable from 1 second to 500 seconds. When the slider is fully unscrewed, the light just blinks.
Regarding the threshold for turning on the sensor, I experimentally found that this voltage is from 11.5 Volts, if it is lower, then the sensor simply does not turn on:
According to the diagram, it is clear that the output voltage from the sensor is less than or equal to the input. I set it to 12v. there is an error in the form of an inaccurate indication of the power supply, so the consumption of the sensor itself is of course lower:
In standby mode, the sensor consumes 84 μA, and the output voltage is 170 mV.
To be honest, setting up the sensor is very inconvenient with the board removed, so I made holes on the back cover, and it's much better like this:
Gathered a schematic, set everything up:
Checked:
The sensor has been working for two days now, I put the second one on the backlight of the headphone stand, and I like that, unlike the previous one, which worked from 220 V, was larger and clicked the relay, this one is more compact and, of course, silent.
I didn’t measure the maximum range, but in an apartment from 3 meters it definitely works
Am I happy with my purchase? A complete, high-quality finished device.
What we liked:
+ Fully customizable mode of operation
+ Minimum own consumption
+ Quality workmanship and compactness
+ Clarity of operation without gaps
+. Presence of wires with sockets
What did not like:
- Lack of direct access to the settings without parsing the case (solid)
- Mounting ears are very small (but it is better to mount on double-sided tape like 3M)
The white sensor cap protrudes from the black housing, but is black in the non-light sensor option.
That's all.
In this tutorial, we will show you how to make a motion sensor using an ultrasonic sensor (HC-SR04) that will turn on the LED every time. Components for this lesson can be ordered at any convenient store, and eventually on our website.
The lesson is suitable for beginners, but it will also be interesting for more experienced engineers.
Below is the entire list of components that will be useful to us for our lesson.
1 x Arduino board (we used Arduino Uno)
1 x LED (LED, color doesn't matter)
1 x Resistor/resistance 220 ohm
1 x development board
1 x Arduino USB cable
1 x 9V battery with clip (optional)
6 x Leads
Step 2: Positioning the Parts
First, connect the ultrasonic sensor and LED on the breadboard. Connect the short LED cable (cathode) to the GND (ground) pin of the sensor. Then install the resistor in the same row as the longer LED wire (anode) so they are connected.
Step 3: Connecting the Parts
Now you need to connect some wires on the back of the sensor. There are four pins - VCC, TRIG, ECHO and GND. After inserting the wires, you need to make the following connections:
The resistor end to the digital pin of your choice, just remember to change it later in the code.
Sensor -> Arduino
VCC -> 5V (power)
TRIG -> 5*
ECHO -> 4*
GND -> GND (ground)
* - can be connected to any two Arduino digital pins, just make sure you change them in the code later.
Now you can connect your Arduino to your computer with a USB cable. Open the Arduino software and download the code you can find below. The constants are commented, so you know exactly what they do and may change them.
Const int ledPin = 6; // LED digital output const int trigPin = 5; // Digital output for connecting TRIG const int echoPin = 4; // Digital output for connecting ECHO const int ledOnTime = 1000; // Time the LED stays on after motion is detected (in milliseconds, 1000ms = 1s) const int trigDistance = 20; // Distance (and smaller value) at which the sensor is triggered (in centimeters) int duration; int distance; void setup() ( pinMode(ledPin, OUTPUT); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); ) void loop() ( digitalWrite(trigPin, LOW); digitalWrite(trigPin, HIGH); delay(1) ; digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = duration * 0.034 / 2; if (distance<= trigDistance) { digitalWrite(ledPin, HIGH); delay(ledOnTime); digitalWrite(ledPin, LOW); } delay(100); }
Step 5: End result (video)
The final result of the motion sensor and its operation can be seen in the video below.
All good projects!
The topic of today's lesson is a motion sensor based on the pyroelectric effect (PIR, passive infrared motion sensor). Such sensors are often used in security systems and in everyday life to detect movement in a room. For example, the principle of motion detection is based on the automatic switching on of the light in the entrance or in the bathroom. Pyroelectric sensors are quite simple, inexpensive and unpretentious in installation and maintenance. By the way, there are other ways to detect motion. Today, computer vision systems are increasingly used to recognize objects and the trajectory of their movement. In the same security systems, laser detectors are used, which give an alarm signal when the beam is crossed. Thermal imaging sensors are also used, capable of detecting the movement of only living beings.
1. The principle of operation of pyroelectric motion sensors
Pyroelectrics are dielectrics that create an electric field when their temperature changes. Based on pyroelectrics, temperature sensors are made, for example, LHI778 or IRA-E700. Each such sensor contains two sensitive elements 1×2 mm in size, connected with opposite polarity. And as we will see later, the presence of exactly two elements will help us detect motion. This is what Murata's IRA-E700 sensor looks like. In this lesson, we will work with the HC-SR501 motion sensor, which has one such pyroelectric sensor. From above, the pyroelectric is surrounded by a hemisphere, divided into several segments. Each segment of this sphere is a lens that focuses thermal radiation on different areas of the PIR sensor. Often a Fresnel lens is used as a lens.The principle of operation of the motion sensor is as follows. Let's assume that the sensor is installed in an empty room. Each sensitive element receives a constant dose of radiation, which means that the voltage on them has a constant value (left figure).
As soon as a person enters the room, he first enters the field of view of the first element, which leads to the appearance of a positive electrical impulse on it (central figure). A person moves, and his thermal radiation through the lenses hits the second PIR element, which generates a negative pulse. The electronic circuit of the motion sensor registers these multidirectional pulses and draws conclusions that a person has fallen into the field of view of the sensor. A positive pulse is generated at the output of the sensor (right figure).
2. Setting up the HC-SR501
In this lesson, we will use the HC-SR501 module. This module is very common and is used in many DIY projects due to its low cost. The sensor has two variable resistors and a jumper for setting the mode. One of the potentiometers controls the sensitivity of the device. The larger it is, the further the sensor “sees”. Sensitivity also affects the size of the detected object. For example, you can exclude a dog or a cat from triggering.The second potentiometer adjusts the response time T . If the sensor detects movement, it generates a positive pulse of length T . Finally, the third control is a jumper that switches the sensor mode. Pregnant L the sensor is counting T from the very first operation. Let's say we want to control the light in the bathroom. Entering the room, a person will trigger the sensor, and the light will turn on exactly for a while T . At the end of the period, the output signal will return to its original state, and the sensor will give the next trigger. Pregnant H sensor starts timing T every time after motion is detected. In other words, any human movement will reset the countdown timer. T . By default, the jumper is in the state H .
3. Connecting HC-SR501 to Arduino Uno
For connection to a microcontroller or directly to a relay, the HC-SR501 has three pins. We connect them to the Arduino as follows:HC-SR501 | GND | VCC | OUT |
Arduino Uno | GND | +5V | 2 |
Layout appearance
Program As already mentioned, the digital output of the HC-SR501 sensor generates a high signal level when triggered. Let's write a simple program that will send "1" to the serial port if the sensor saw movement, and "0" otherwise. const int movPin = 2 void setup() ( Serial.begin(9600); pinMode(movPin, INPUT); ) void loop()( int val = digitalRead(movPin); Serial.println(val); delay(100); ) We load the program on Arduino and check the operation of the sensor. You can tweak the sensor settings and see how it affects its operation.
4. Light control based on motion sensor
The next step is the automatic lighting system. In order to control the lighting in the room, we need to add a relay to the circuit. We will use a relay module with protection based on optocoupler, which we already wrote about in one of the lessons (a lesson about relays). Attention! This circuit lights the lamp from a 220 volt network. It is recommended to check all connections seven times before connecting the circuit to the household power supply. circuit diagramLayout appearance
Program Now let's write a program that, when the sensor is triggered, will turn on the relay, and therefore the lighting in the room. const int movPin = 2; const int relPin = 3; void setup() ( Serial.begin(9600); pinMode(movPin, INPUT); pinMode(relPin, OUTPUT); ) void loop()( int val = digitalRead(movPin); if (val) digitalWrite(relPin, HIGH) ; else digitalWrite(relPin, LOW); ) We load the program on Arduino, carefully connect the circuit to the household network and check the operation of the sensor. Conclusion Motion sensors are all around us. Thanks to security systems, they can be found in almost every room. As we found out, they are very easy to use and can be easily integrated into any Arduino or Raspberry Pi project. Here are a few situations and places where a motion sensor can come in handy:
- automatic switching on of the light in the entrance of the house, in the bathroom and toilet, in front of the entrance door to the room;
- alarm indoors and outdoors;
- automatic door opening;
- automatic activation of the security camera.