1
00:00:07,000 --> 00:00:18,000
Today I will show you how to load the data from any sensor, any potentiometer, using any USB 6001

2
00:00:18,000 --> 00:00:19,000
in Matlab.

3
00:00:20,000 --> 00:00:24,000
For that purpose I just use a potentiometer.

4
00:00:24,000 --> 00:00:25,000
As you see over here.

5
00:00:25,000 --> 00:00:27,000
This is my potentiometer.

6
00:00:27,000 --> 00:00:28,000
I just connect it.

7
00:00:29,000 --> 00:00:34,000
It's one edge, one port to the VCC.

8
00:00:34,000 --> 00:00:35,000
That is five volt.

9
00:00:36,000 --> 00:00:39,000
Another one to the ground and middle one.

10
00:00:39,000 --> 00:00:45,000
This one is your white pin or middle wiper position.

11
00:00:45,000 --> 00:00:50,000
It is connected to the pin number two, analog pin number two.

12
00:00:50,000 --> 00:00:54,000
As you see over here, right now I'm using I two.

13
00:00:54,000 --> 00:00:56,000
So this is ground six.

14
00:00:56,000 --> 00:00:59,000
One is ground and middle one two.

15
00:01:00,000 --> 00:01:01,000
It is differentially connected.

16
00:01:01,000 --> 00:01:05,000
That's why I just ground six number pin also.

17
00:01:05,000 --> 00:01:10,000
And this one white one is connected to pin number 2I2.

18
00:01:10,000 --> 00:01:14,000
So now we just first grab the data.

19
00:01:14,000 --> 00:01:19,000
So we need to go to the Simulink.

20
00:01:19,000 --> 00:01:22,000
As you see over here I have the code.

21
00:01:22,000 --> 00:01:24,000
So let's I just.

22
00:01:26,000 --> 00:01:28,000
Do it from the start.

23
00:01:29,000 --> 00:01:35,000
Analog input I just require over here you just need to select the analog pin.

24
00:01:49,000 --> 00:01:59,000
As you see, I just need to select only a two because I'm using this pin over here.

25
00:01:59,000 --> 00:02:07,000
You can set the value also, but initially it is default as -10 to 10.

26
00:02:08,000 --> 00:02:09,000
Apply it.

27
00:02:10,000 --> 00:02:12,000
You can also set this value.

28
00:02:14,000 --> 00:02:20,000
Okay, now I just need a display to check the value.

29
00:02:24,000 --> 00:02:27,000
So just connect this display.

30
00:02:30,000 --> 00:02:31,000
I need a scope.

31
00:02:35,000 --> 00:02:48,000
It was late on a graph and to load these value I just need to add these all values to my workspace.

32
00:02:48,000 --> 00:03:00,000
I'm just using two workspace and from workspace I just take these values and plot these values.

33
00:03:00,000 --> 00:03:04,000
So I just hit on run button.

34
00:03:08,000 --> 00:03:11,000
You can check these values on scope also.

35
00:03:21,000 --> 00:03:27,000
As you see right now, value is 0.8 something.

36
00:03:28,000 --> 00:03:34,000
So now I just increase the value as you see.

37
00:03:36,000 --> 00:03:39,000
Now I just decrease the value.

38
00:03:42,000 --> 00:03:53,000
It is happening at different instants of time, as you see right now, increasing again, decreasing.

39
00:03:53,000 --> 00:03:56,000
Right now it is zero again I just.

40
00:03:59,000 --> 00:04:00,000
Move it.

41
00:04:01,000 --> 00:04:05,000
Now it is maximum 4.95.

42
00:04:06,000 --> 00:04:09,000
Again Decrease.

43
00:04:09,000 --> 00:04:10,000
Increase.

44
00:04:10,000 --> 00:04:11,000
Decrease.

45
00:04:11,000 --> 00:04:12,000
Increase.

46
00:04:12,000 --> 00:04:13,000
Decrease.

47
00:04:13,000 --> 00:04:14,000
Increase.

48
00:04:14,000 --> 00:04:16,000
So now I just stop it.

49
00:04:17,000 --> 00:04:19,000
Let's check.

50
00:04:21,000 --> 00:04:22,000
On workspace.

51
00:04:24,000 --> 00:04:26,000
So I just minimize this window.

52
00:04:26,000 --> 00:04:28,000
Close this window.

53
00:04:28,000 --> 00:04:31,000
And over here I have our data.

54
00:04:31,000 --> 00:04:34,000
Just select this.

55
00:04:35,000 --> 00:04:40,000
And total I have 5041 values.

56
00:04:40,000 --> 00:04:47,000
If you want to check different values, as you see we will just start from 0.8043.

57
00:04:47,000 --> 00:04:52,000
And over here you can find out different values.

58
00:04:52,000 --> 00:04:55,000
Right now again it is 0.84.

59
00:05:01,000 --> 00:05:07,000
For an instant now it is increasing when we just move.

60
00:05:07,000 --> 00:05:09,000
Let's see.

61
00:05:10,000 --> 00:05:16,000
Right now it is 91.2, 1.5, 2.9.

62
00:05:16,000 --> 00:05:20,000
So let's check the data pattern on the Excel.

63
00:05:20,000 --> 00:05:25,000
So I just select all data copy it control C.

64
00:05:26,000 --> 00:05:29,000
Now I just go to Excel.

65
00:05:29,000 --> 00:05:31,000
Create a new Excel.

66
00:05:32,000 --> 00:05:34,000
You can plot it on Matlab also.

67
00:05:35,000 --> 00:05:39,000
But right now I'm just showing you the data on Excel.

68
00:05:39,000 --> 00:05:41,000
So control V.

69
00:05:41,000 --> 00:05:45,000
Now total data is available over here.

70
00:05:46,000 --> 00:05:51,000
Let's check this data on a graph.

71
00:05:52,000 --> 00:05:55,000
Let's say I'm just using this graph.

72
00:05:56,000 --> 00:06:07,000
So over here you can find out different data data patterns related to different values.

73
00:06:07,000 --> 00:06:21,000
So over here this is if you want to just go with only this value, you can let's say if you want to

74
00:06:21,000 --> 00:06:23,000
select a particular part.

75
00:06:26,000 --> 00:06:27,000
Select over here.

76
00:06:28,000 --> 00:06:31,000
From here our values changing.

77
00:06:32,000 --> 00:06:35,000
Let's say I want to plot only this part.

78
00:06:36,000 --> 00:06:37,000
Insert.

79
00:06:39,000 --> 00:06:40,000
Data.

80
00:06:40,000 --> 00:06:45,000
As you see both the values, you can find out over here.

81
00:06:45,000 --> 00:06:49,000
This is the pattern how value changes.

82
00:06:49,000 --> 00:06:55,000
Okay, so this is all about how to load the data.

83
00:06:55,000 --> 00:06:57,000
Let's say I want to just.

84
00:06:59,000 --> 00:07:02,000
Select only this one row.

85
00:07:02,000 --> 00:07:04,000
Select this insert.

86
00:07:07,000 --> 00:07:12,000
Now you can find out how the value changes.

87
00:07:12,000 --> 00:07:13,000
Okay.

88
00:07:14,000 --> 00:07:20,000
And if you want to go with different pattern let's say this one.

89
00:07:21,000 --> 00:07:24,000
This is the main part over here.

90
00:07:24,000 --> 00:07:27,000
The how the potentiometer values changes.

91
00:07:27,000 --> 00:07:30,000
As you see it is nearly 0.8.

92
00:07:30,000 --> 00:07:36,000
Then it goes high then low high low high low.

93
00:07:36,000 --> 00:07:40,000
This is the pattern how we change the potentiometer value.

94
00:07:40,000 --> 00:07:47,000
And this is all about today's lecture how we load the data in the Matlab.

95
00:07:47,000 --> 00:07:48,000
Thank you.

