hi welcome to Arduino tutorial from Robojax. my name is Ahmad Shamshiri I'm presenting this
tutorial from Canada in this tutorial I'm going to introduce this VDI technology SC
f x0 c angle sensor to measure the angle for any purpose that you have in robotics this
is around 90 and then it can if I go this way we can go minus 90 this is your minus 90 and
it can go here to minus 180 and then rotate this so this is now Z you can get the code
for this by clicking at the link below the video in the description which will take you
to Robojax.com/learn/arduino let's get started with this
angle something is one of the important aspects of robotics and in many applications you constantly
need to know the position of angle of some the some arm or some element in your robotics and
this is very inexpensive way to do that it can display between 0 and 180 degrees
and the resolution is 1 degree so you cannot have zero point something degrees so with the
resolution of one degree therefore work and it is from vti technology and here if you search
AliExpress you can get this SC s60 see they call it a tilt sensor the chip is also sold
here you can see it on amazon.com it is sold for forty one dollars there are these six dollars
at different prices so this is now for example source for ten dollars where you can get it in
40 days and this is just a module without those adjustment prints at different prices you can
get it on amazon.com even 766 dollars but these we could get it in 60 days so don't expect it
quick delivery $32 for example to have on eBay $14.25 plus shipping and also just the chip
now let me explain the module the module is based on vti technologies angle Sanford this is f CF x
0 c1 with a subversion of n 1 0 0 0 sex 0 and this is when you put it this way we will have
always at 0 degrees so this will give you the angle based on angle it outputs some voltage
here where we can convert it to angle and read the angle so the angle will be between 0 to 180
degrees and the output will be between some 0.45 volts to 4.5 volts we using Arduino to display
that angle and here we have two LEDs that when it is absolute flat you can set this with these
two variable resistor or potentiometer so these alarms are off here at the bottom we have l-39
3 this is an op-amp operational amplifier very precise so this will turn these on at a specific
value so you can detect every is flat or not and the result of this will output as d1 d out
one at the span the spinner will go low when it is detecting it and death side when decided it turns
on it goes to D out to this VC C will be connected to 5 volts ground will be connected to ground so
for majority of the use is this V o the span we were using this one to detect the angle test of
this modulus thirty four point two millimeters by 21 21 millimeters by eight point four millimeters
and held the datasheet for video technology s see a fake video see
and this one also has some number in one four zero quadruple zero six zero
operating supplies five volts and it consumes two million per G and
if you put it flat it will be zero and if you put it this way the arrow is on the
surface there do you - G provide you the data sheet is here in case if you need it
if you need a wiring diagram for this it is available as part of my Arduino course at
Udemy where you can get the length for that the length of my courses Udemy is below the video
in the description and here is the explanation of wiring we have here VCC this is connected to
five volts of Arduino and then we have add from this side the second tentative ground
ground is connected there so these two points will supply power and then here at the middle
V out V out is the one that you will get you the angle that's a blue blue is connected to analog
zero these 2d out one and D out to this orange and this purple or connected to here analog one
or two which I'm going to demonstrate it and if you do need it you can remove this
D out to and D out one because these are just for turning on and off some alarm if you need
now this is a time to click on the subscribe button and leave the notification on so you
get a piece of my upcoming videos now let me explain the code we are defining
constant integer pin so you put a depend that you're using and then this is a variable that
is holding the angle do not change it this is angle compensate I will demonstrate it later if
you want to change the 0 instead of 0 you call it 20 degrees or 90 degrees or 180 degrees you
can add this and the angle will be reflected accordingly and these three lines are for d1
we are defining the 1 pin analog 1 here and a state of d1 and also delay if delay time
is a time if the alarm is detected or the device is destabilized and the alarm is on
you can keep it waiting for certain time if you want to add that time added here and the same
we are defining the pin 2 and here then we put here the title which would be displayed on the
screen here as you can see alarm angle and on d1 around e 2 this is a text it's coming here
if you're using it for some robotic purpose you can say towards arm or towards the machine or
app or down whatever so it will be the straight and this angle if it is and some angle you put
angle if it is position of something at certain way so you can change the text otherwise just
leave it as if the full detail of this code is available as part of my Arduino course as
Udemy the length for my Arduino courses Udemy is below the video in the description if you want to
learn or do we know I have a best seller course on Udemy where you can learn or do know from
ground up with hundreds of projects all course material library codes wiring diagram everything
available in one place the link for module new courses below this video in the description
and here is a demonstration as you can see when I try to keep it flat we can get zero degrees
on the serial monitor here that you see and I can test it can go and here around 90 degrees
so this is around 90 and then it can if I go this way we can go minus 90 but we can adjust this and
fix it for our purpose for example if this is 0 and this is your minus you can do so here on
the compensate we can put 90 and let me upload it and now this is now your zero you can bring your
zero here and this is 90 and this will be hundred and eighty degrees you can change it to minus 90
and here this is your minus ninety and it can go here to minus 180 and this will be a revealer
degrees so whichever we want you can adjust it or if you are installing it and Sun angle your
so you can do so for example if you have already 20 degrees inclination so you can put 20 here
and unhealth at 20 will be your zero
and he'll that 20 would be you are almost zero it's hard for me to hold it and then based on
that you can go to any angle that you want to friends that we have here these are alarms and
you can adjust your flat angle for example using these two potentiometer to keep it flat you just
rotate it and if you rotate it this will not turn on at this value let's say zero and then rotate
this so this is now zero and now it shows an angle here so at zero we can keep it off and here if
you want to get the values when the alarm runs that you can see two is zero because the light
is zero and if I put it now as you can see the two it on two is now it shows one and if I go
this way now the one is turned on and you can see on the screen you can take some action if
the device is tilted from zero degrees so this is these two lights will show when I wave deviating
from zero degrees and you can detect it if you use this to analog one or two that are already
in the code line to print it and here you can use the one state and you can take action you
can put your F statement and this will turn this will be true F at the text that d1 is on and this
d2 state is the one that is detecting when d2 is on the ID D so you can take some action but if
you don't want to use these two because there this is for D to death pin and this is for d1
and they are occupying analog one an analog to so if you do need those alarm feature just
disconnect these two pins and just use analog zeros and you do need to connect any wire to d1
here or to d2 so this we can use only one analog if the analog pins are needed for other purpose
you
thank you for watching this was angle since L from VDI technology if you learn something and
found it useful please come Bob as this will help my video in the search algorithm of YouTube if you
have comment or question posted in the comment section below I try to answer and reply if you
want to get updates of my upcoming videos make sure to subscribe hi welcome hi welcome tunnel
doing a tutorial from Robojax and hi we are going to learn how we can use this hi welcome
to Arduino tutorial from Robojax my name is Ahmed shamshir II I'm presenting this tutorial
from Canada. this this tutorial we are going to see how we can use this angle sensor SCA