Before we start using the Pir sensor, we actually need to tune it.
So there are a few things here we will need to do on the hardware, and it's quite important that we
do it actually even before we do the circuit, because if we're going to touch stuff directly on the
hardware and actually metallic parts, well, as you guess, it's better to have the sensor outside
of the circuit and especially not in the circuit and powered on.
So as you can see on the Pir sensor we have here, we have first this is called a jumper.
So this yellow thingy here with three wires here.
So it might be in either position.
You can just take it out for now.
So we have this jumper and then we have two potentiometers here okay.
So I'm going to explain to you what to do with those three things here and what that means.
So first of all you can take the jumper.
And if you look carefully here at the back.
So if I orientate the Pir sensor so like this you can see that we have L and H so low or high.
Basically what you can also just take it like that and it's going to be on the left.
So take the jumper and you connect the two pins on to the two legs on the left on the high position.
And I'm going to come back to this in just a minute.
Then you can orientate the Pi like that.
So it depends on how you orient it.
I'm going to follow the instructions with the sensor that's on the bottom here.
And you have two potentiometers.
So to move those you see I have some screwdrivers.
So you can find any screwdriver and try to see if you can actually turn the potentiometer okay.
So with this one it works.
I also have a flat one.
Well you can also try with your finger okay I don't have much nail here.
You can see.
But I can still manage to turn the potentiometer here.
So you will find a way to turn this, and the first potentiometer on the left here will correspond to
the range.
So how far the sensor can detect movement?
The minimum is going to be three meters.
Okay.
So it can detect up to one up to three meters in front with a with a with a range.
Imagine here you have an angle here.
That's I think it's about 110 degrees.
And it's going to detect movement up to three meters.
That's the minimum.
So if you will go counterclockwise at the minimum like like that.
Let's see okay.
All the way here that's going to be three meters if you go all the way up here.
So clockwise is going to be seven meters okay.
So from 3 to 7m and it's well I'm just going to put it in the middle.
So it's going to be somewhere around five metres.
This one is not the most important setting.
Okay.
And it's going to basically depend on where you place the sensor and what you want to detect.
So for this example we don't need any precise range.
You could leave it to three meters or five whatever.
And then the second one.
So with the sensor on the bottom here the potentiometer on the right.
This one is more important because this one is the delay or basically how long the output of the sensor
will stay high.
Because how does the sensor work?
Well, when the movement is detected it's going to output high okay.
By default it's going to be low.
When the movement is detected it's going to output high.
And you can read that in your code.
But what you have to know is that when the sensor output high, it will stay high for a certain amount
of time.
Okay.
And this amount of time you can modify it with this potentiometer.
If I go on the minimum.
And actually we're going to go to the minimum here.
So I put this potentiometer to the minimum.
This is going to be about so well depends on which datasheet you find on the internet.
Because it seems like nobody can agree on this.
But what I found is values between 3 to 5 seconds.
And with this potentiometer here, this hardware that I have, I found it's about three seconds.
So that's going to be the minimum.
Which means that when the movement is detected it's going to be like if it were detected for the next
three seconds, even if there is no movement.
So I put my hand here.
It's going to detect the movement and stay high.
So stay as detected for three seconds.
If you put all the way to the top so clockwise it will go up until 300 seconds.
So five minutes.
All right.
So for this application we want the minimum we want to have the minimum.
So 3 to 5 seconds okay.
So we have the first potentiometer here.
Whatever value it's the range between 3 to 7m.
This potentiometer here, the minimum counterclockwise which is going to be about five.
So 3 to 5 seconds.
And then I'm coming back to this jumper here.
And I told you to put it in a high position.
Because if you put it in the low position and for example here it's going to detect the movement for
three seconds.
Then after three seconds it's going to go low again.
So it's going to say that there is no movement detected even if you continue to move, for example,
your hand in front of the sensor.
All right.
With the high position, basically every time you make a movement, you kind of reset this delay.
So as long as you make movement in front of the sensor, the output is always going to be high.
Plus an additional, let's say 3 to 5 seconds after the last movement.
Okay.
So that's the settings that we're going to use for this circuit and for the activities and also for
the project of this course.