1
00:00:01,030 --> 00:00:01,900
Hello and welcome.

2
00:00:01,930 --> 00:00:08,500
This new lesson in what are going to start coding using Arduino IEEE.

3
00:00:12,040 --> 00:00:12,790
No idea.

4
00:00:22,140 --> 00:00:22,590
Now.

5
00:00:31,400 --> 00:00:35,840
Now we will start by including some libraries.

6
00:00:35,930 --> 00:00:41,600
First, we know for sure that we will need let me increase the font size.

7
00:00:42,320 --> 00:00:44,400
We will need the life.I library.

8
00:00:45,110 --> 00:00:48,020
So right, why file the text?

9
00:00:49,130 --> 00:00:51,860
And we also need the Wi-Fi client library.

10
00:00:59,850 --> 00:01:04,980
The techs and we will need that the Adjetey Central Library.

11
00:01:05,610 --> 00:01:07,020
So we have to include it.

12
00:01:15,110 --> 00:01:18,420
And we need blinked.

13
00:01:18,890 --> 00:01:20,480
Yes, P32 Library.

14
00:01:21,590 --> 00:01:23,930
So let's include that, too.

15
00:01:29,570 --> 00:01:29,990
Flanked.

16
00:01:32,640 --> 00:01:36,780
Symbol, yes, but as a tool, the attacks.

17
00:01:39,030 --> 00:01:42,630
Now, these are the main levers that we need.

18
00:01:43,590 --> 00:01:48,600
Let's define some variables, and if we need more labels, we will add them as we go.

19
00:01:49,200 --> 00:01:50,060
And according.

20
00:01:51,450 --> 00:01:55,290
Now define the Ich bin.

21
00:01:57,430 --> 00:02:02,050
And define the the edge.

22
00:02:03,120 --> 00:02:06,420
D-type so let's define again.

23
00:02:09,870 --> 00:02:14,160
The edge type since of type.

24
00:02:15,060 --> 00:02:24,990
Now the sensor type is DHT 11 and the pin, as we already mentioned in the text document, that that

25
00:02:24,990 --> 00:02:27,420
each PIN is number 23.

26
00:02:28,650 --> 00:02:30,390
So here we are, right 23.

27
00:02:31,950 --> 00:02:37,680
Now we need to initialize some variables for the relay.

28
00:02:41,070 --> 00:02:46,830
And other components that we have in the system now, we know for sure that that really is connected

29
00:02:46,830 --> 00:02:49,080
to PIN number 22.

30
00:02:52,450 --> 00:02:53,620
And we also know.

31
00:02:55,470 --> 00:02:57,480
That the water.

32
00:02:59,770 --> 00:03:02,910
The level is connected to Ben.

33
00:03:03,150 --> 00:03:05,720
No, he is 21.

34
00:03:08,540 --> 00:03:19,250
And we will define either variable for that soil sensor, and it's connected to a pin number 19.

35
00:03:24,560 --> 00:03:30,740
Now, just right since we're here and right, since we're here to make sure that.

36
00:03:32,820 --> 00:03:37,290
Now, let's define 24 variables, what the water level.

37
00:03:40,250 --> 00:03:45,770
And the other one, all the soil since.

38
00:03:48,430 --> 00:03:49,160
Live in that.

39
00:03:52,050 --> 00:03:59,070
Now we will use the ADHD library, but let's first save our code.

40
00:04:01,760 --> 00:04:06,470
Now that you have saved the court, let's verify and make sure that we don't have any errors.

41
00:04:06,950 --> 00:04:09,440
We will most likely face a library in error.

42
00:04:09,830 --> 00:04:16,940
As you can see now, the DST library is not recognized, so you need to go to the tools.

43
00:04:17,540 --> 00:04:24,800
OK now include library and from sketch include library manage libraries.

44
00:04:27,040 --> 00:04:30,460
And we need to include these libraries now.

45
00:04:35,030 --> 00:04:37,070
Look for the first library.

46
00:04:38,840 --> 00:04:39,830
The DST.

47
00:04:41,650 --> 00:04:44,740
Library, as you can see here, we have this sense of library.

48
00:04:45,430 --> 00:04:46,480
Click Install.

49
00:04:48,470 --> 00:04:49,490
And it's still all.

50
00:04:55,760 --> 00:04:58,370
Now, as you can see, that number is installed.

51
00:04:59,510 --> 00:05:01,700
Click close, click Verify.

52
00:05:02,300 --> 00:05:11,180
Now you can see that the DHT is recognized, now we have this library playing symbol ESP and good sketch

53
00:05:11,180 --> 00:05:17,150
include library managed libraries and do the same thing to include this library.

54
00:05:22,510 --> 00:05:27,190
Now based right here at the Inter baton.

55
00:05:29,110 --> 00:05:29,890
And wait.

56
00:05:36,400 --> 00:05:41,740
Now you might need to change the key word that you are using to look for the library.

57
00:05:42,340 --> 00:05:48,130
Here we have the blank library and those list has support for SB 32.

58
00:05:49,510 --> 00:05:52,720
And political people all.

59
00:06:02,060 --> 00:06:04,400
Now, as you can see, an installed.

60
00:06:07,110 --> 00:06:12,180
Now click close and try to verify to see if this works or not.

61
00:06:13,200 --> 00:06:19,740
As you can see, Blink Symbol Library is still defined, so we need to read this.

62
00:06:20,700 --> 00:06:25,170
Now, the problem that we have here is that ISP is written in capital letters.

63
00:06:25,200 --> 00:06:28,710
Let's throw a small letter and let's verify.

64
00:06:35,800 --> 00:06:36,150
OK.

65
00:06:36,430 --> 00:06:37,540
Now, as you can see.

66
00:06:42,050 --> 00:06:50,720
This code now recognize that playing library, but since we are choosing Arduino as our pin board,

67
00:06:50,720 --> 00:06:52,700
we are facing a verifying error.

68
00:06:52,880 --> 00:06:59,870
So go and change this to your ISP served 32.

69
00:07:01,780 --> 00:07:02,530
A.

70
00:07:06,080 --> 00:07:08,410
Monoliths look for the one that we have.

71
00:07:09,670 --> 00:07:11,020
Yes, Dev, difficult.

72
00:07:11,920 --> 00:07:12,240
OK.

73
00:07:12,430 --> 00:07:12,890
This one.

74
00:07:13,340 --> 00:07:13,690
Do it.

75
00:07:13,720 --> 00:07:14,940
Yes, we felt it too.

76
00:07:15,460 --> 00:07:21,760
Kept veteran one a little bit before I could see.

77
00:07:23,630 --> 00:07:25,750
That you don't have any unless.

78
00:07:27,240 --> 00:07:31,650
And make sure that you have this and p and small letters here.

79
00:07:46,230 --> 00:07:54,330
It's taking some time, and we have explained how to enable, yes, we have to do when you are doing

80
00:07:54,330 --> 00:07:58,030
an I.D., you need to check this out if you can't.

81
00:08:02,580 --> 00:08:08,480
As you can see now done compiling, which means that all of us are defined and everything's working

82
00:08:08,480 --> 00:08:12,690
just fine now, we need to make sure.

83
00:08:13,580 --> 00:08:15,230
OK, here we have an issue.

84
00:08:15,860 --> 00:08:22,400
Now we need to make sure that we create a new object from the Adjetey sensor.

85
00:08:23,400 --> 00:08:27,410
It's called DST and will take two variables.

86
00:08:27,800 --> 00:08:31,950
The first one is this one DST pin.

87
00:08:33,590 --> 00:08:36,170
The second one is the type.

88
00:08:38,840 --> 00:08:39,320
Now.

89
00:08:40,390 --> 00:08:42,310
We need to add a time of.

90
00:08:43,900 --> 00:08:44,320
This.

91
00:08:45,860 --> 00:08:49,340
Create a new blank document for the blank.

92
00:08:49,760 --> 00:08:53,060
And we will explain why we are doing this later.

93
00:08:55,040 --> 00:08:55,520
Now.

94
00:08:57,650 --> 00:09:00,420
Double check before moving on.

95
00:09:00,440 --> 00:09:10,640
We need to know that for blink up to recognize our ISP world, we need to have an authentication key

96
00:09:11,060 --> 00:09:14,890
which will be provided by the blink once we set it up.

97
00:09:15,350 --> 00:09:16,670
Incoming lessons.

98
00:09:17,090 --> 00:09:20,930
So for now, we need to define a character for that authentication.

99
00:09:23,150 --> 00:09:24,740
And here you need to enter.

100
00:09:26,020 --> 00:09:27,880
Your syndication?

101
00:09:29,700 --> 00:09:30,090
Court.

102
00:09:32,720 --> 00:09:33,170
Now.

103
00:09:35,380 --> 00:09:40,900
Since our ISP board is using Wi-Fi to connect to the internet, we need to make sure that we have the

104
00:09:40,900 --> 00:09:49,360
Wi-Fi sitting set up correctly, so define a new character for the network name.

105
00:09:50,560 --> 00:09:53,140
And here we will add Wi-Fi.

106
00:09:54,650 --> 00:09:55,240
This is.

107
00:09:57,440 --> 00:10:00,980
And another character for the password.

108
00:10:08,770 --> 00:10:12,520
Here's why fi password.

109
00:10:16,640 --> 00:10:19,820
You need to circle on the end of these two lines.

110
00:10:20,570 --> 00:10:28,340
Now we need to create a new method to send our sense of data to the blink up.

111
00:10:29,600 --> 00:10:37,850
Now we know for sure that we have like three or four sensors the alert will call for.

112
00:10:37,850 --> 00:10:39,590
This is pretty straightforward.

113
00:10:40,550 --> 00:10:48,560
We will use that DST sensor library to get that temperature and humidity readings and the water and

114
00:10:48,560 --> 00:10:54,770
soil moisture levels are just analog readings, so we can use the analog function to read the incoming

115
00:10:54,770 --> 00:10:59,060
data and arrange to convert it and send it to our app.

116
00:11:00,620 --> 00:11:07,730
Depending on your environment and sensor constraints, the analog values from the water and soil moisture

117
00:11:07,910 --> 00:11:13,130
levels in soils can be treated and moved into orange.

118
00:11:13,940 --> 00:11:17,810
Now we will create two functions to send data to the blink.

119
00:11:18,170 --> 00:11:24,500
The first function will help send the temperature and humidity values since we are relying on the the

120
00:11:24,500 --> 00:11:26,060
image library.

121
00:11:26,600 --> 00:11:34,730
And the second method will send the water and soil moisture levels, sensors, readings which are basically

122
00:11:34,730 --> 00:11:35,720
analog readings.

123
00:11:36,530 --> 00:11:39,680
It will send these readings to the lab link up.

124
00:11:39,950 --> 00:11:44,060
So let's get started with the first function by void.

125
00:11:48,480 --> 00:11:49,170
Send.

126
00:11:51,070 --> 00:11:52,390
Or ditch.

127
00:11:54,240 --> 00:11:54,750
Now.

128
00:11:56,530 --> 00:12:00,640
This is the first method, and let's define the second method.

129
00:12:00,850 --> 00:12:08,980
Then we can start, I think, both sand and salt water soil.

130
00:12:13,540 --> 00:12:21,100
OK, now we have these two methods and the next lesson, we are going to call these two methods and

131
00:12:21,100 --> 00:12:24,280
proceed with Volley Globe and also that functions.

132
00:12:24,730 --> 00:12:26,140
But that's it for this lesson.

133
00:12:26,170 --> 00:12:28,340
Let's do a quick revision.

134
00:12:28,360 --> 00:12:34,990
We included the Wi-Fi and Wi-Fi client libraries for the Wi-Fi connection, the DST library for that

135
00:12:34,990 --> 00:12:42,220
temperature and humidity sensor that blinks and ISP library so that we can easily connect our ISP filter

136
00:12:42,220 --> 00:12:45,370
to a board with the Blink servers.

137
00:12:46,540 --> 00:12:56,620
We defined these to make sure that we have the correct pin number for the edge sense or tele water and

138
00:12:56,620 --> 00:12:57,580
soil sensor.

139
00:12:58,240 --> 00:13:05,050
And we created two variables to store the incoming data from the water and soil sensor.

140
00:13:05,350 --> 00:13:15,850
Since there are analog readings, we also defined an object called DST from the DHT library and we created

141
00:13:15,850 --> 00:13:24,350
a timer using the Blink Timer Library and the Blink symbol SPF 32 library.

142
00:13:24,970 --> 00:13:27,700
And we will use it at our functions.

143
00:13:28,000 --> 00:13:34,510
Now, will it be mentioned that the Blink has an authentication key for each user and for each?

144
00:13:34,900 --> 00:13:40,960
So you need to intelligent authentication key here, and we will explain how to get it in the practical

145
00:13:40,970 --> 00:13:43,440
lesson regarding the Blink app.

146
00:13:44,200 --> 00:13:51,610
We already mentioned that we are using Wi-Fi connection, so we defined two variables one for the Wi-Fi

147
00:13:51,610 --> 00:13:55,090
network name and the other one for the password.

148
00:13:55,750 --> 00:13:59,060
Now we have two functions.

149
00:13:59,080 --> 00:14:04,060
The first one will be coded to send the temperature and humidity sensor readings.

150
00:14:04,570 --> 00:14:12,190
And the second one will be recorded to send the water and soil moisture level readings.

151
00:14:13,120 --> 00:14:14,320
That's it for this lesson.

152
00:14:14,620 --> 00:14:15,370
Thanks for watching.

153
00:14:15,400 --> 00:14:18,460
If you have any questions, please ask in the Q&amp;A board.

154
00:14:19,030 --> 00:14:21,790
This is Ashraf from educational engineering team.
