1 00:00:01,130 --> 00:00:01,970 Hello and welcome. 2 00:00:02,180 --> 00:00:12,080 Now let's go to our Arduino ownable so that it can send data through the serial communication protocol 3 00:00:12,320 --> 00:00:19,160 to our E.S.P board, nothing will be found on our Alvino side. 4 00:00:19,190 --> 00:00:25,760 We will take samples from an analog digital converter and send it over soft cereal. 5 00:00:27,380 --> 00:00:30,950 In order to do this, let's first open up Arduino. 6 00:00:36,370 --> 00:00:44,210 Now will basically take census reading and we will send it through the soft serial communication protocol. 7 00:00:45,160 --> 00:00:46,540 Let's create a new code. 8 00:00:47,930 --> 00:00:48,380 No. 9 00:00:50,230 --> 00:00:57,460 The first thing that we need to do is include the soft serial communication protocol, so include. 10 00:01:00,150 --> 00:01:04,350 Soft where serial totex. 11 00:01:07,420 --> 00:01:10,360 Now, the software Syrian. 12 00:01:18,280 --> 00:01:29,290 Will be conducted using two pens and let's choose pens, number two and three as an example for the 13 00:01:29,290 --> 00:01:29,890 receiver. 14 00:01:32,250 --> 00:01:34,770 And the transmissive that Russell. 15 00:01:38,740 --> 00:01:46,150 So there are ex ante X will be number two and three pins, number two and three. 16 00:01:46,990 --> 00:01:49,450 And here we are not using the hardware serial. 17 00:01:49,630 --> 00:01:55,390 You have to make sure that you understand the difference between software, serial and hardware serial 18 00:01:55,510 --> 00:01:58,270 now inside the voice setup. 19 00:01:58,300 --> 00:02:06,970 What we need to do is initialize the serial communications that begin at a specific moderate. 20 00:02:09,620 --> 00:02:16,490 Then we need to plan something to make sure that it's working, so brand new line. 21 00:02:17,950 --> 00:02:22,330 And let's right project. 22 00:02:26,360 --> 00:02:32,030 Or interfacing Arduino with E.S.P 32. 23 00:02:35,100 --> 00:02:42,630 Now, once you are done, you must start the software serial using the object that we are defined here 24 00:02:42,990 --> 00:02:43,790 as W. 25 00:02:44,310 --> 00:02:53,850 So as W dot begin and we have to assign a board rate, we will use the same board rate. 26 00:02:54,240 --> 00:03:01,950 Now, this serial is the one that you see when you click the serial monitor and this is the software. 27 00:03:02,220 --> 00:03:06,390 So this is the hardware serial and this is the software series. 28 00:03:06,510 --> 00:03:08,840 Now let's go inside the void loop. 29 00:03:08,850 --> 00:03:11,550 We started the hardware and software serial. 30 00:03:12,240 --> 00:03:13,520 Now inside the void loop. 31 00:03:13,620 --> 00:03:14,910 We need to plan something. 32 00:03:14,940 --> 00:03:19,620 So let's try Serial, the brand new line. 33 00:03:24,140 --> 00:03:25,670 Incited riots and. 34 00:03:28,890 --> 00:03:30,870 Data to. 35 00:03:32,230 --> 00:03:34,600 PSP 32 bought. 36 00:03:37,790 --> 00:03:46,010 After that, we need to read the censor and let's connect it to a zero or analagous zero. 37 00:03:46,430 --> 00:03:47,300 So ADC. 38 00:03:48,750 --> 00:03:52,980 Value will equal analog 3D. 39 00:03:55,740 --> 00:04:03,960 And inside it, we can fly zero or a zero now after this, we need to send that to the serial. 40 00:04:04,170 --> 00:04:05,430 So serial. 41 00:04:07,370 --> 00:04:08,300 The Trent. 42 00:04:13,860 --> 00:04:22,010 And inside it, we must enter data in a specific format, so the format will usually be like this, 43 00:04:22,350 --> 00:04:31,650 we have to write OK, like this, we have to add Tukur parentheses and add slash here. 44 00:04:32,460 --> 00:04:42,600 And between these two parentheses, we have to install the sensor data and sensor ID. 45 00:04:43,020 --> 00:04:52,950 So to say that we have more than one sensor here, we can define an already so and sensor already equals, 46 00:04:52,950 --> 00:04:54,900 let's say 50. 47 00:04:55,830 --> 00:04:57,630 And this also one. 48 00:04:57,900 --> 00:04:59,860 This is the first sensor that we are adding here. 49 00:04:59,910 --> 00:05:01,350 This will be more reasonable. 50 00:05:01,560 --> 00:05:11,070 OK, now inside here, you have tried that at a specific format so that E.S.P can receive it and send 51 00:05:11,070 --> 00:05:12,280 it to the web. 52 00:05:13,530 --> 00:05:14,070 Now. 53 00:05:15,490 --> 00:05:18,250 You have to, right exactly like me. 54 00:05:19,090 --> 00:05:25,330 Let's start by adding that curly parentheses after add a slash, then add to. 55 00:05:28,200 --> 00:05:30,840 26TH marks inside them, right? 56 00:05:30,900 --> 00:05:45,000 The name of the variable, which is the idea after that, a slash then between these two marks and double 57 00:05:45,030 --> 00:05:47,230 points, that's it. 58 00:05:47,280 --> 00:05:48,180 This is the first line. 59 00:05:48,870 --> 00:05:54,000 Now, the second line will send the. 60 00:05:56,090 --> 00:06:05,050 Since we're all value, so we will have to pay this variable since Friday idea, this was described 61 00:06:05,730 --> 00:06:09,740 in the text on the Syria monitor and this will send its value. 62 00:06:10,280 --> 00:06:14,420 After that, we must add a comma. 63 00:06:20,740 --> 00:06:25,090 Then we cannot see a real good Trent. 64 00:06:27,840 --> 00:06:40,200 After the coma, we need to send the ADC value that we just received, so at last splashier then after 65 00:06:40,200 --> 00:06:41,610 this at ADC. 66 00:06:43,230 --> 00:06:43,830 Value. 67 00:06:47,020 --> 00:06:47,640 OK, Liz. 68 00:06:50,620 --> 00:06:51,640 Again, serial. 69 00:06:58,740 --> 00:07:04,410 So here you need to add the slash and here you need to add ADC. 70 00:07:06,140 --> 00:07:15,860 Value and slash, then between these two, you have to add double points, then you need to print the 71 00:07:15,860 --> 00:07:16,380 value. 72 00:07:16,940 --> 00:07:18,680 So serial the print. 73 00:07:20,410 --> 00:07:31,270 Here will plant this variable, which is the value of our sensor, and we need to end this, so we have 74 00:07:31,270 --> 00:07:34,030 to write serial print. 75 00:07:36,460 --> 00:07:41,410 And Saadet, we need to add that Carol parentheses, as you can see, we started with the parentheses 76 00:07:41,980 --> 00:07:52,960 and we ended with that closing tag for the this now to end this year, almost entirely new line, which 77 00:07:52,960 --> 00:07:56,410 means that you have you all done and the data must be sent. 78 00:07:57,320 --> 00:08:08,710 So at the end, that's it, this is the guy that we are going to send to the serial or the hardware 79 00:08:08,720 --> 00:08:09,460 seller Moto. 80 00:08:10,230 --> 00:08:14,540 Now we need to send the same data to the software serial that we just created. 81 00:08:15,050 --> 00:08:24,710 And to do that, we just need to copy the very same code so we can copy all of this and based it on 82 00:08:24,710 --> 00:08:27,310 we can write it again, but save time. 83 00:08:27,950 --> 00:08:29,120 I will just copy. 84 00:08:30,480 --> 00:08:33,620 Discord and to tears. 85 00:08:33,660 --> 00:08:37,380 Now you have to change Syria with S.W.. 86 00:08:42,460 --> 00:08:45,290 It takes or uses the very same technology. 87 00:08:45,730 --> 00:08:57,490 So we will send the very same values and at the end we need to either delay, let's make it 3000 milliseconds 88 00:08:59,080 --> 00:09:00,460 or 4000 milliseconds. 89 00:09:01,600 --> 00:09:03,010 Now let's save our code. 90 00:09:05,670 --> 00:09:07,830 Let's name it arguido. 91 00:09:10,030 --> 00:09:10,540 Paula. 92 00:09:12,490 --> 00:09:20,080 Code click save now what you need to do is simply upload this code you are doing online. 93 00:09:20,860 --> 00:09:23,080 So let me hook up my Arduino Ono. 94 00:09:25,320 --> 00:09:28,590 Now that we have the balls connected, go to the device manager. 95 00:09:31,380 --> 00:09:40,350 And from here, you can see the part on it, so go to the tools, make sure that command is chosen and 96 00:09:40,350 --> 00:09:46,320 are doing all, then verify the code to make sure that doesn't have any errors. 97 00:09:53,260 --> 00:09:54,490 Now upload the code. 98 00:10:03,990 --> 00:10:05,280 Now, all stakeholders applauded. 99 00:10:05,310 --> 00:10:07,040 You can operate a cereal monitor. 100 00:10:08,810 --> 00:10:17,970 And see for yourself the kind of data that's being sent as you can, debt to GDP 32 and now since it 101 00:10:18,080 --> 00:10:23,320 is one they see value is three hundred nineteen. 102 00:10:24,320 --> 00:10:25,780 And that's changing. 103 00:10:26,180 --> 00:10:34,150 Now, this data will be sent to the IRS people through the serial or the software protocol. 104 00:10:34,580 --> 00:10:38,290 And we are going to cover the ESB 32 coding. 105 00:10:38,570 --> 00:10:40,440 Now we are done with Arduino coding. 106 00:10:40,670 --> 00:10:45,290 Now you can send any other value depending on your project, but this is it. 107 00:10:45,860 --> 00:10:51,980 If your remote is showing this, it means that the cell communications is working correctly and you 108 00:10:51,980 --> 00:10:58,670 are sending data in the correct format, correct parentheses and opening and closing the sensor idea 109 00:10:58,670 --> 00:11:04,940 between two double quotation, the ADC value between two double quotation, and we have the sensor of 110 00:11:05,060 --> 00:11:11,070 value and the same sort of value and we have a comma here between them. 111 00:11:11,510 --> 00:11:16,610 So if you want to send other values, you have to add a comma and add data and the very same format 112 00:11:16,970 --> 00:11:24,080 this and two double points then the value so we can send 100 value from ALGUIEN to E.S.P. 113 00:11:25,070 --> 00:11:32,300 All you can even sentence Ansel's reading depending on the sense of ID and the ADC value for each sensor. 114 00:11:33,170 --> 00:11:39,710 But here we are only sending two values since the idea and the sense of value, and this is the format 115 00:11:39,710 --> 00:11:40,880 that you have to send the data. 116 00:11:42,230 --> 00:11:43,270 That's it for this lesson. 117 00:11:43,310 --> 00:11:44,090 Thanks for watching. 118 00:11:44,090 --> 00:11:46,950 This is asharaf from educational engineering to.