1
00:00:07,000 --> 00:00:08,000
Hello, friends.

2
00:00:08,000 --> 00:00:17,000
Today I just show you how to interface infrared sensor that is IR sensor with Matlab with the help of

3
00:00:17,000 --> 00:00:19,000
any USB 6001 DAC card.

4
00:00:20,000 --> 00:00:23,000
So for that purpose I have one IR sensor.

5
00:00:23,000 --> 00:00:27,000
As you see this is a infrared sensor module.

6
00:00:27,000 --> 00:00:30,000
And over here we have three pins.

7
00:00:31,000 --> 00:00:38,000
One is VCC, one second one is ground and third one is your output signal.

8
00:00:38,000 --> 00:00:43,000
And in this IR sensor module over here this is a potentiometer.

9
00:00:43,000 --> 00:00:47,000
Using this you can set the range of this IR module.

10
00:00:48,000 --> 00:00:53,000
This one is your transmitter and the black one is your receiver.

11
00:00:53,000 --> 00:00:54,000
Okay.

12
00:00:54,000 --> 00:01:01,000
When someone in front of this in a particular range, in a set range, it will detect the object.

13
00:01:02,000 --> 00:01:06,000
So over here I'm using port zero.

14
00:01:06,000 --> 00:01:07,000
Line zero.

15
00:01:07,000 --> 00:01:16,000
This one is purple one five volt is connected to VCC and ground is connected to the ground of that card.

16
00:01:17,000 --> 00:01:20,000
So now we go to the software part.

17
00:01:20,000 --> 00:01:21,000
First connect your.

18
00:01:23,000 --> 00:01:25,000
Descartes with your PC.

19
00:01:26,000 --> 00:01:29,000
As you see, when I just connect it, light goes high.

20
00:01:30,000 --> 00:01:31,000
Blue light turns on.

21
00:01:31,000 --> 00:01:37,000
Means your drivers are properly installed in your system for this particular Descartes.

22
00:01:38,000 --> 00:01:46,000
And when I remove my hand in front of this air sensor, only one LED goes high when I just put my hand.

23
00:01:46,000 --> 00:01:48,000
There are two LEDs in front of.

24
00:01:49,000 --> 00:01:51,000
When I just put my hand in front of this air sensor.

25
00:01:51,000 --> 00:01:53,000
There are two LEDs as you see.

26
00:01:53,000 --> 00:01:54,000
You check the.

27
00:01:54,000 --> 00:01:57,000
You can check the performance.

28
00:01:57,000 --> 00:01:58,000
This is on the hardware part.

29
00:01:58,000 --> 00:02:01,000
Now we just go to the software part.

30
00:02:01,000 --> 00:02:09,000
In the software part, you just check the device is properly connected to the system or not.

31
00:02:09,000 --> 00:02:13,000
So the command is DAC or Get devices.

32
00:02:13,000 --> 00:02:19,000
You just enter it in the command prompt as you see over here.

33
00:02:20,000 --> 00:02:23,000
National Instrument Device 6001.

34
00:02:23,000 --> 00:02:27,000
The device ID is day one connected.

35
00:02:27,000 --> 00:02:30,000
There are total analog input.

36
00:02:30,000 --> 00:02:35,000
Supports the range minus ten to plus ten volt.

37
00:02:35,000 --> 00:02:37,000
Eight channels are there.

38
00:02:37,000 --> 00:02:41,000
A0 a stands for analog input a0 to A seven.

39
00:02:41,000 --> 00:02:47,000
The rate from 0.12 to 20,000 scans per second.

40
00:02:47,000 --> 00:02:48,000
Ah, there it is.

41
00:02:48,000 --> 00:02:50,000
Voltage measurement type.

42
00:02:50,000 --> 00:02:52,000
There are two analog output supports.

43
00:02:52,000 --> 00:02:53,000
Are there.

44
00:02:53,000 --> 00:02:56,000
Minus ten to plus ten volt range.

45
00:02:56,000 --> 00:03:00,000
Reads 0.1 to 5000 scans per second.

46
00:03:00,000 --> 00:03:01,000
There are two channels only.

47
00:03:01,000 --> 00:03:03,000
A O stands for analog output.

48
00:03:03,000 --> 00:03:05,000
A zero, A01 are there.

49
00:03:05,000 --> 00:03:08,000
It is also voltage measurement type.

50
00:03:08,000 --> 00:03:11,000
Total 13 digital input output pins are there.

51
00:03:12,000 --> 00:03:17,000
I'm using in this case digital input pin.

52
00:03:17,000 --> 00:03:22,000
You can make it input only, output only or bi directional.

53
00:03:22,000 --> 00:03:26,000
Okay so I'm using port zero line one.

54
00:03:26,000 --> 00:03:29,000
In my case total three ports are there.

55
00:03:29,000 --> 00:03:30,000
Port zero, port 1 or 2.

56
00:03:30,000 --> 00:03:37,000
In this deck device, one counter is also available that is known as CDR zero.

57
00:03:38,000 --> 00:03:40,000
It is edge type counter.

58
00:03:40,000 --> 00:03:43,000
So now I just go to Simulink.

59
00:03:43,000 --> 00:03:47,000
So I already open this over here.

60
00:03:47,000 --> 00:03:49,000
This is my data acquisition toolbox.

61
00:03:49,000 --> 00:03:57,000
I already told you in my previous videos how to grab this decoration toolbox in Matlab and how to install

62
00:03:57,000 --> 00:04:00,000
the drivers of this Dec device.

63
00:04:00,000 --> 00:04:08,000
So I'm using digital input over here because I want to grab the data digitally.

64
00:04:08,000 --> 00:04:11,000
So now you just open it.

65
00:04:15,000 --> 00:04:20,000
As you see, when you first time open it, you just need to select the device devices and I.

66
00:04:20,000 --> 00:04:29,000
Day one, day one is the I'd USB 6001 and select all the pins I'm using only for zero line one pin.

67
00:04:29,000 --> 00:04:30,000
Apply it.

68
00:04:31,000 --> 00:04:34,000
Okay we need a display.

69
00:04:40,000 --> 00:04:43,000
To check the output of the sensor.

70
00:04:47,000 --> 00:04:48,000
Connect it.

71
00:04:49,000 --> 00:04:55,000
I just go with us scope also to check the output.

72
00:05:00,000 --> 00:05:02,000
Just connect it.

73
00:05:13,000 --> 00:05:16,000
So now the program is ready.

74
00:05:16,000 --> 00:05:18,000
There is a simple program.

75
00:05:19,000 --> 00:05:21,000
You just drag and drop boxes.

76
00:05:21,000 --> 00:05:22,000
Now I just open it.

77
00:05:23,000 --> 00:05:29,000
I put stop time in finite because I need for a long time.

78
00:05:29,000 --> 00:05:32,000
You can put some value also over here.

79
00:05:37,000 --> 00:05:39,000
I just open scope.

80
00:05:41,000 --> 00:05:42,000
This is the display.

81
00:05:43,000 --> 00:05:45,000
So over here.

82
00:05:48,000 --> 00:05:50,000
I just minimize it.

83
00:05:50,000 --> 00:05:56,000
So over here I get the data of scope.

84
00:05:57,000 --> 00:06:00,000
Now I just hit on run button.

85
00:06:00,000 --> 00:06:05,000
You can check the output of sensor.

86
00:06:08,000 --> 00:06:15,000
Once it is started, as you see right now it is showing one.

87
00:06:15,000 --> 00:06:18,000
When I put my hand it is showing zero.

88
00:06:18,000 --> 00:06:29,000
As you see when I change my hand very fast in front of this, it is detecting value and you just check

89
00:06:29,000 --> 00:06:40,000
the change in the scope also 010101 okay, so this is how you can acquire digital signal.

90
00:06:40,000 --> 00:06:52,000
Or you can interface either your sensor or infrared sensor to the Matlab with the help of any USB data.

91
00:06:52,000 --> 00:07:00,000
I'm just changing very fast my finger in front of this air sensor and you can check the response.

92
00:07:02,000 --> 00:07:03,000
Thank you.

