My name is Ahmad Shamshiri and I am presenting this tutorial from Canada
Hi! welcome to Robjax. in this video I'm going to introduce this HC fr 501 motion sensor to detect
motions either on LED that shows and also or on the screen that shows it is detected based on
that you can do some action to control something or a robotic car or arm so this is the module
it's 32 by 24 millimeter and it can work with 5 to 20 volts so underneath of this when I remove
it actually this is the actual module LHI 7 7 8 so this is the actual module that does the work
but they also put some circuitry to make it a module ready to be used by robotics applications
so it can be used as a burglar alarm robotics application any application that requires motion
detector covering is for reflection of infrared so this works based on infrared and this covering
makes the reflection very active effective so from every direction it can reflect it and
direct it to the actual length to this length so this module has three main pen here that you can
connect and these pens are labeled here when you remove this cover so the we have three pens here
these three pens can be connected to VCC this is VCC this is ground and this is output this
module can be used without Arduino because this is totally stand-alone and the output will go
high or it will send a 3.3 volts TTL voltage out when it detects a motion and I sends 0 when there
is no detection so you don't neither are dunia actually without the unit can be used you just
need to supply a battery and then connect this to a buzzer or to something based on your application
and this has also three other component that can be selected the first one is this jumper
by default if this corner as you can see this is a single trigger it means that once this detects
a motion of something and that motion will be detected and the output will go high and it will
just turn off even if the moving object continues moving so if you want continuous struggle then you
put it here so it continuously detect and detect and sent high and high on high but if you put it
here one move will send the output high and then it goes low so this is for single and here on the
next position is for continuous motion and then here we have a sensitivity this you can adjust
it so it doesn't activity can be high or low so that way you can play with this to see how
far this can go and detect this can detect up to seven meter distance according to a manual that
I've searched online and the manual also will be provided with the code when you click add a
description to download the code and then we have another potentiometer here just potentiometer also
can be adjusted to select the time delay the time delay is the amount of time between each detection
so if you select this to be continuously or very quick detect it will detect or if you can make
it so it can delay between the detection so this is the sensitivity this is the time delay another
important thing that you should know about this does have a voltage regulator here that adjusts
it for the internal 5 volt application of this for the 3.3 volts that just operates so when you
connect the voltage here and have a diode that protects it even if you connected and reverse
let's say you connect said of VCC and ground and you just switch it so you can connect here ground
and if you connect the VCC usually electronic components will die but this one has a diet
that protects us so this allows only the positive here so it can go from anode to the cathode of the
diode and then to the voltage regulator so this is a voltage regulator and you can see here VCC
is connected to five volts of Arduino and then I've connected the ground this wire the ground
is also connected to the ground and then the yellow which is the signal here is connected
here at the 10 to the then from pan 8 the green wire is now connected to the long pan which is
a positive or a node of LED and the cathode of LED is connected to the 680 ohm resistor from
here which is connected to the ground so the LED will turn on so the positive will come this way
and enter the LED and then goes from this goes to the ground so here is the code the code is very
simple inside the setup I have said this serial monitor for 9600 baud to display the information
here and then I've set up n2 as an input this is where you can connect your sensors the middle wire
from the sensor to this pin and then pin it is an output so when it detects we will send this
pen too high so we can turn on some alarm or LED on for now and this is the loop the main loop that
goes and checks it so this digital read will read the pen to that we said here as an input so this
reads pen to and put the result in motion so this variable integer holds either 1 or 0 1 min that
action zero mean nothing so here we say F motion this motion we could also do F motion equal equal
1 which is extra so if motion 1 also it means F motion is one automatically then we say plan this
on the screen motion detected which will print this text and also we say and the same time set
pan 8 hi so if this is connected to any D D D D will be turned on alarm or some servo whatever's
you can just control it and then else otherwise else just planned nothing move and then set the
pan 8 which was high started to low this is the delay that I have chose chosen to go at
500 millisecond which is half a second so for your application you might adjust this if you
want faster or slower detection otherwise every twice a second it will detect and when it reaches
here it goes back and this loop continues now I've connected it so as you can see here the LED is off
and there is no detection yeah my hand somewhere moved so it just detected it so now I put it
in the continuous one and the continuous mode meaning it continuously checks and the text so
this was introduction to a CSR 501 motion sensor thank you for watching please some of the video
and also please share it and also subscribe to get updates all the code will be provided
by clicking at the description you can get it or you can go directly to Robojax.com/learn/arduino
you