Hello, friends.
Today I just show you how to interface infrared sensor that is IR sensor with Matlab with the help of
any USB 6001 DAC card.
So for that purpose I have one IR sensor.
As you see this is a infrared sensor module.
And over here we have three pins.
One is VCC, one second one is ground and third one is your output signal.
And in this IR sensor module over here this is a potentiometer.
Using this you can set the range of this IR module.
This one is your transmitter and the black one is your receiver.
Okay.
When someone in front of this in a particular range, in a set range, it will detect the object.
So over here I'm using port zero.
Line zero.
This one is purple one five volt is connected to VCC and ground is connected to the ground of that card.
So now we go to the software part.
First connect your.
Descartes with your PC.
As you see, when I just connect it, light goes high.
Blue light turns on.
Means your drivers are properly installed in your system for this particular Descartes.
And when I remove my hand in front of this air sensor, only one LED goes high when I just put my hand.
There are two LEDs in front of.
When I just put my hand in front of this air sensor.
There are two LEDs as you see.
You check the.
You can check the performance.
This is on the hardware part.
Now we just go to the software part.
In the software part, you just check the device is properly connected to the system or not.
So the command is DAC or Get devices.
You just enter it in the command prompt as you see over here.
National Instrument Device 6001.
The device ID is day one connected.
There are total analog input.
Supports the range minus ten to plus ten volt.
Eight channels are there.
A0 a stands for analog input a0 to A seven.
The rate from 0.12 to 20,000 scans per second.
Ah, there it is.
Voltage measurement type.
There are two analog output supports.
Are there.
Minus ten to plus ten volt range.
Reads 0.1 to 5000 scans per second.
There are two channels only.
A O stands for analog output.
A zero, A01 are there.
It is also voltage measurement type.
Total 13 digital input output pins are there.
I'm using in this case digital input pin.
You can make it input only, output only or bi directional.
Okay so I'm using port zero line one.
In my case total three ports are there.
Port zero, port 1 or 2.
In this deck device, one counter is also available that is known as CDR zero.
It is edge type counter.
So now I just go to Simulink.
So I already open this over here.
This is my data acquisition toolbox.
I already told you in my previous videos how to grab this decoration toolbox in Matlab and how to install
the drivers of this Dec device.
So I'm using digital input over here because I want to grab the data digitally.
So now you just open it.
As you see, when you first time open it, you just need to select the device devices and I.
Day one, day one is the I'd USB 6001 and select all the pins I'm using only for zero line one pin.
Apply it.
Okay we need a display.
To check the output of the sensor.
Connect it.
I just go with us scope also to check the output.
Just connect it.
So now the program is ready.
There is a simple program.
You just drag and drop boxes.
Now I just open it.
I put stop time in finite because I need for a long time.
You can put some value also over here.
I just open scope.
This is the display.
So over here.
I just minimize it.
So over here I get the data of scope.
Now I just hit on run button.
You can check the output of sensor.
Once it is started, as you see right now it is showing one.
When I put my hand it is showing zero.
As you see when I change my hand very fast in front of this, it is detecting value and you just check
the change in the scope also 010101 okay, so this is how you can acquire digital signal.
Or you can interface either your sensor or infrared sensor to the Matlab with the help of any USB data.
I'm just changing very fast my finger in front of this air sensor and you can check the response.
Thank you.