1
00:00:01,160 --> 00:00:01,970
Hello and welcome.

2
00:00:02,210 --> 00:00:12,050
Now let's go to our Arduino on a ball so that can't send data through the serial communication protocol

3
00:00:12,290 --> 00:00:14,540
to our ISP board.

4
00:00:16,220 --> 00:00:17,660
Nothing will be fancy.

5
00:00:17,840 --> 00:00:25,720
Our Arduino side, we will take samples from an analog digital converter and send it over soft cereal

6
00:00:27,440 --> 00:00:28,490
in order to do this.

7
00:00:28,730 --> 00:00:30,860
Let's first open up Arduino.

8
00:00:31,420 --> 00:00:31,630
You?

9
00:00:36,400 --> 00:00:43,510
Now we will basically take sensors reading and we will send it through the soft serial communication

10
00:00:43,510 --> 00:00:44,200
protocol.

11
00:00:45,190 --> 00:00:46,480
Let's create a new code.

12
00:00:47,910 --> 00:00:48,350
I know.

13
00:00:50,200 --> 00:00:57,430
The first thing that we need to do is include the soft serial communication protocol, so include.

14
00:01:00,180 --> 00:01:04,320
Soft, where serial latex.

15
00:01:07,450 --> 00:01:10,300
Now, the software serial.

16
00:01:18,220 --> 00:01:22,510
Will be conducted using two pens.

17
00:01:22,770 --> 00:01:29,860
And let's choose pens, number two and three as an example for the receiver.

18
00:01:32,280 --> 00:01:35,610
And the transness tourism rookie.

19
00:01:38,740 --> 00:01:46,150
So the ex ante ex will be number two and three or pins number two and three.

20
00:01:47,020 --> 00:01:49,420
And here we are not using the hardware serial.

21
00:01:49,630 --> 00:01:55,360
You have to make sure that you understand the difference between software, serial and hardware serial.

22
00:01:55,530 --> 00:02:02,890
Now inside the voice setup, what we need to do is initialize the serial communications, you know,

23
00:02:03,070 --> 00:02:06,940
begin at a specific Mod..

24
00:02:09,590 --> 00:02:14,390
Then we need to plan something to make sure that it's working.

25
00:02:14,840 --> 00:02:16,460
So brand new line.

26
00:02:18,010 --> 00:02:22,300
And let's right project.

27
00:02:26,450 --> 00:02:32,030
Or interfacing Arduino with ESB 32.

28
00:02:33,570 --> 00:02:33,960
OK.

29
00:02:35,100 --> 00:02:42,600
Now, once you are done, you must start the software serial using the object that we are defined here

30
00:02:43,020 --> 00:02:45,900
as a W. So as W Dot Begin.

31
00:02:46,680 --> 00:02:51,960
And we have to assign a board rate.

32
00:02:52,140 --> 00:02:53,850
We will use the same baud rate.

33
00:02:54,270 --> 00:03:01,950
Now this serial is the one that you see when you click the serial monitor and this is the software.

34
00:03:02,200 --> 00:03:06,450
So this is the hardware serial and this is the software serial.

35
00:03:06,480 --> 00:03:08,820
Now let's go out and say the void loop.

36
00:03:08,820 --> 00:03:11,520
We started the hardware of the software serial.

37
00:03:12,240 --> 00:03:14,880
Now inside the void loop, we need to print something.

38
00:03:14,970 --> 00:03:17,100
So let's try to see the trend.

39
00:03:19,000 --> 00:03:19,590
New line.

40
00:03:24,200 --> 00:03:25,610
And saw Detroit and.

41
00:03:28,890 --> 00:03:30,840
Data to.

42
00:03:32,230 --> 00:03:34,540
PSP, 32, bought.

43
00:03:37,850 --> 00:03:46,010
After that, we need to lead the sensor and let's connected to a zero zero.

44
00:03:46,430 --> 00:03:47,300
So ADC.

45
00:03:48,780 --> 00:03:52,950
Value will equal analog fields.

46
00:03:55,800 --> 00:04:00,060
And inside it, we can fly zero zero now.

47
00:04:00,090 --> 00:04:05,400
After this, we need to send that to the Syrian, so Syrian.

48
00:04:07,400 --> 00:04:08,270
The trend.

49
00:04:13,920 --> 00:04:19,140
And inside it, we must enter that in a specific format.

50
00:04:19,300 --> 00:04:21,990
So the format will usually be like this.

51
00:04:22,320 --> 00:04:31,620
We have tried, OK, like this, we have to add to calibrate the seas and add slash here.

52
00:04:32,520 --> 00:04:42,390
And between these two kill practices, we have to install the sensor data and sensor ID.

53
00:04:43,050 --> 00:04:52,920
So to say that we have more than one sensor here, we can define an I.D. So and sensor already equals,

54
00:04:52,920 --> 00:04:57,360
let's say, 50 on this policy.

55
00:04:57,360 --> 00:04:57,600
One.

56
00:04:57,870 --> 00:05:01,350
This is the first and so that we are adding here, this would be more reasonable.

57
00:05:01,560 --> 00:05:02,000
OK.

58
00:05:02,820 --> 00:05:11,340
Now inside here you have tried that at a specific format so that each speaker receive it and send it

59
00:05:11,670 --> 00:05:12,220
to the web.

60
00:05:13,530 --> 00:05:14,040
Now.

61
00:05:15,490 --> 00:05:18,280
You have to act exactly like me.

62
00:05:19,090 --> 00:05:25,360
Let's start by adding that curly parentheses after that ad slash less than to.

63
00:05:28,200 --> 00:05:34,830
Text marks inside them, write the name of the variable, which is since of.

64
00:05:37,200 --> 00:05:38,730
After that, a slash.

65
00:05:39,990 --> 00:05:45,570
Then between these two marks add label points.

66
00:05:46,830 --> 00:05:48,180
That said, this is the first line.

67
00:05:48,900 --> 00:05:53,940
Now the second line will send the.

68
00:05:56,120 --> 00:06:04,610
Since we're already Valeo, so we will have to paste this variable since already this will rise since

69
00:06:04,610 --> 00:06:14,390
that idea that takes on the serial motor and this will send its value after that, we must add a comma.

70
00:06:20,860 --> 00:06:23,350
Then we can add.

71
00:06:24,260 --> 00:06:25,030
The trend.

72
00:06:27,900 --> 00:06:38,160
After the coma, we need to send the ADC value that we just received so this last year.

73
00:06:39,020 --> 00:06:41,610
Then after this at ADC.

74
00:06:43,260 --> 00:06:43,800
Value.

75
00:06:47,020 --> 00:06:47,620
OK, let's.

76
00:06:50,590 --> 00:06:51,580
Again, serial.

77
00:06:58,770 --> 00:07:04,410
So here you need a slash, here you need to add ADC.

78
00:07:06,200 --> 00:07:15,680
Value and rather slash then between these two, you have to add double points, then you need to print

79
00:07:15,680 --> 00:07:16,370
the value.

80
00:07:17,000 --> 00:07:18,620
So serial the trend.

81
00:07:20,500 --> 00:07:31,270
He will plant this variable, which is the value of our sensor, and we need to end this so we have

82
00:07:31,270 --> 00:07:34,000
to right serial dot print.

83
00:07:36,490 --> 00:07:38,960
And so that we need to better protect the seas.

84
00:07:38,980 --> 00:07:47,440
As you can see, we started it with a coral plant disease and we ended it with that closing tag for

85
00:07:47,440 --> 00:07:48,460
darker purposes.

86
00:07:49,270 --> 00:07:55,630
Now to end this, you must interview your line, which means that you have you are done and the data

87
00:07:55,630 --> 00:07:56,350
must be sent.

88
00:07:57,350 --> 00:08:00,680
So at the end.

89
00:08:02,480 --> 00:08:02,960
That's it.

90
00:08:03,470 --> 00:08:09,020
This is the guy that we are going to send to the cereal or the hardware our.

91
00:08:10,250 --> 00:08:14,480
Now we need to send the same data to the software cereal that we just created.

92
00:08:15,080 --> 00:08:16,160
And to do that.

93
00:08:16,430 --> 00:08:24,680
We just need to copy the very same code so we can copy all of this and based it all.

94
00:08:24,680 --> 00:08:25,910
We can write it again.

95
00:08:26,090 --> 00:08:27,290
But save time.

96
00:08:28,010 --> 00:08:29,090
I will just copy.

97
00:08:30,570 --> 00:08:33,600
Scored and based it here.

98
00:08:33,630 --> 00:08:37,380
Now you have to change cereal with S.W..

99
00:08:42,520 --> 00:08:45,280
It takes all accuses the very same methodology.

100
00:08:45,790 --> 00:08:49,630
So we would send the very same values.

101
00:08:50,060 --> 00:09:00,490
And at the end, we need to either delay, let's make it 3000 milliseconds or 4000 milliseconds.

102
00:09:01,600 --> 00:09:02,950
Now let's save our code.

103
00:09:05,700 --> 00:09:07,800
Let's name it, Arduino.

104
00:09:10,060 --> 00:09:10,500
All.

105
00:09:12,490 --> 00:09:15,130
Code click save.

106
00:09:16,280 --> 00:09:20,110
Now what you need to do is simply upload this code to a Arduino owner.

107
00:09:20,890 --> 00:09:23,050
So let me hook up my Arduino owner.

108
00:09:25,350 --> 00:09:28,560
Now that we have the boat connected to the device manager.

109
00:09:31,410 --> 00:09:35,820
And from here, you can see the port on eight.

110
00:09:36,150 --> 00:09:43,560
So go to the tools, make sure that command is chosen and obviously to all then verify the code to make

111
00:09:43,560 --> 00:09:46,290
sure that doesn't have any errors.

112
00:09:52,720 --> 00:09:54,430
But now a blow court.

113
00:10:03,990 --> 00:10:07,020
Now, all stakeholders applauded, you can open up the serial monitor.

114
00:10:08,840 --> 00:10:16,380
And see for herself a kind of data that's being sent, as you can see, send that to your ISP 32 now

115
00:10:16,430 --> 00:10:23,370
a census, it is one they see value is three hundred nineteen.

116
00:10:24,390 --> 00:10:26,300
And that's changing now.

117
00:10:27,530 --> 00:10:35,150
This data will be sent to the U.S. people through the serial or the soft cereal protocol, and we are

118
00:10:35,150 --> 00:10:38,270
going to cover all of the SB 32 coding.

119
00:10:38,570 --> 00:10:40,400
Now we are done with Arduino coding.

120
00:10:40,700 --> 00:10:45,260
Now you can send any other value depending on your project, but this is it.

121
00:10:45,860 --> 00:10:52,100
If your remote is showing, this means that the serial communications working correctly and you are

122
00:10:52,100 --> 00:10:57,470
sending data in the correct format, teleprompter sees an opening and closing.

123
00:10:57,890 --> 00:10:58,630
But since what idea?

124
00:10:58,640 --> 00:11:04,730
Between two double quotation, they do see value between two double quotation and we have the Cinsault

125
00:11:04,730 --> 00:11:11,090
I.D. value, the sensor value, and we have a comma here between them.

126
00:11:11,510 --> 00:11:16,580
So if you want to send other values, you have to add a comma and add that to the very same format.

127
00:11:16,970 --> 00:11:24,080
This two double points, then the value so we can send 100 value from Arduino to GSP.

128
00:11:25,100 --> 00:11:31,850
Well, you can even sentence insults reading depending on the sense of I.D. and the ADC value for each

129
00:11:31,850 --> 00:11:32,270
sensor.

130
00:11:33,170 --> 00:11:39,680
But here we are only sending two values since we're ID and the sensor value, and this is the format

131
00:11:39,680 --> 00:11:40,880
that you have to send the data.

132
00:11:40,880 --> 00:11:43,280
And that's it for this lesson.

133
00:11:43,310 --> 00:11:44,040
Thanks for watching.

134
00:11:44,060 --> 00:11:46,970
This is Ashraf from educational engineering to you.
