1 00:00:01,000 --> 00:00:08,500 Hello and welcome the stimulus one in which we are going to start coding using Arduino Edesia. 2 00:00:11,650 --> 00:00:12,810 We know only the. 3 00:00:22,110 --> 00:00:22,620 Now. 4 00:00:31,400 --> 00:00:35,930 Now, we will start by including some libraries. 5 00:00:35,960 --> 00:00:41,660 First, we know for sure that we will need let me increase the font size. 6 00:00:42,270 --> 00:00:44,420 We will need the wi fi library. 7 00:00:45,060 --> 00:00:45,980 So right. 8 00:00:45,980 --> 00:00:51,890 WI fi detects and we also need the Wi-Fi client library. 9 00:00:59,820 --> 00:01:07,050 The takes and we will need that DHT censored library, so we have to include it. 10 00:01:15,020 --> 00:01:23,960 And we need to blink, yes, be 30 to library, so let's include that to. 11 00:01:29,570 --> 00:01:30,050 Planked. 12 00:01:32,640 --> 00:01:36,440 Symbol E.S.P, 32 not. 13 00:01:38,970 --> 00:01:42,670 Now, these are the main levers that we need. 14 00:01:43,620 --> 00:01:48,600 Let's define some variables, and if we need more labels, we will add them as we go. 15 00:01:49,140 --> 00:01:55,320 And according now define the Ich bin. 16 00:01:57,400 --> 00:02:02,070 And define the the edge. 17 00:02:03,150 --> 00:02:06,480 The type, so let's define again. 18 00:02:09,870 --> 00:02:14,200 The edge type, a sense of type. 19 00:02:15,030 --> 00:02:24,990 Now the sensor tab is DHT 11 and the PIN, as we already mentioned in the text document, that that 20 00:02:24,990 --> 00:02:27,430 the expen is number twenty three. 21 00:02:28,620 --> 00:02:30,410 So here we are, 23. 22 00:02:31,950 --> 00:02:37,680 Now we need to initialize some variables for the really. 23 00:02:41,010 --> 00:02:47,020 And other components that we have in the system now, we know for sure that Verilli is connected to 24 00:02:47,020 --> 00:02:49,110 a PIN number 22. 25 00:02:52,390 --> 00:02:53,620 And we also know. 26 00:02:55,380 --> 00:02:57,570 That that water. 27 00:02:59,850 --> 00:03:02,900 The level is connected to Ben. 28 00:03:03,320 --> 00:03:03,910 No. 29 00:03:04,680 --> 00:03:05,730 He is 21. 30 00:03:08,480 --> 00:03:19,250 And we will define our variable for the soil sensor, and it's connected to a pin number 19. 31 00:03:24,560 --> 00:03:30,800 Now, just right senseor here and right since we're here to make sure that. 32 00:03:32,760 --> 00:03:37,320 Now, let's define two new variables what an ultra liberal. 33 00:03:40,220 --> 00:03:46,090 And the other one, all the soil since or. 34 00:03:48,460 --> 00:03:49,240 Live in that. 35 00:03:52,050 --> 00:03:59,130 Now we will use that DHT library, but let's first save our code. 36 00:04:01,700 --> 00:04:07,220 Now that we have saved the code, let's verify and make sure that we don't have any errors, we will 37 00:04:07,220 --> 00:04:14,680 most likely face a library or as you can see now that the library is not recognized. 38 00:04:14,690 --> 00:04:16,970 So you need to go to the tools. 39 00:04:17,510 --> 00:04:24,830 OK, now include library and from scratch include library managed libraries. 40 00:04:27,010 --> 00:04:30,490 And we need to include these libraries now. 41 00:04:35,030 --> 00:04:37,100 Look for the first library. 42 00:04:38,900 --> 00:04:39,830 The DHT. 43 00:04:41,650 --> 00:04:46,510 Library, as you can see here, we have the city center library click install. 44 00:04:48,510 --> 00:04:49,490 Install all. 45 00:04:55,760 --> 00:04:58,400 Now, as you can see, the cameras installed. 46 00:04:59,510 --> 00:05:05,580 Click close, click verify, now you can see that the DHT is recognized. 47 00:05:06,020 --> 00:05:14,960 Now we have this library playing symbol E.S.P and go sketch include library managed libraries and do 48 00:05:14,960 --> 00:05:17,180 the same thing to include this library. 49 00:05:22,450 --> 00:05:27,220 Now, based here, hit the intel button. 50 00:05:29,050 --> 00:05:29,920 And wait. 51 00:05:36,370 --> 00:05:43,000 Now, you might need to change the key word that you are using to look for the library here we have 52 00:05:43,000 --> 00:05:48,130 the blank library and the support for E.S.P 32. 53 00:05:49,450 --> 00:05:52,750 And click on. 54 00:06:02,000 --> 00:06:04,460 Now, as you can see, and it's told. 55 00:06:07,080 --> 00:06:12,250 Now click close and try to verify to see if this works or not. 56 00:06:13,140 --> 00:06:17,460 As you can see, Blinkx Simbel Library is still undefined. 57 00:06:17,730 --> 00:06:20,730 So we need to do this now. 58 00:06:20,970 --> 00:06:25,190 The problem that we have here is that E.S.P is written in capital letters. 59 00:06:25,200 --> 00:06:28,710 Let's try small lotter and let's verify. 60 00:06:35,800 --> 00:06:37,570 OK, now, as you can see. 61 00:06:41,990 --> 00:06:50,750 This code now recognizes the public library, but since we are choosing, arguing on our own board, 62 00:06:50,750 --> 00:06:52,740 we are facing a very fine error. 63 00:06:52,890 --> 00:06:59,900 So go and change this to E.S.P 32. 64 00:07:01,780 --> 00:07:02,580 Kay. 65 00:07:05,920 --> 00:07:08,470 Well, let's look for the one that we have. 66 00:07:09,640 --> 00:07:13,720 Yes, be difficult like this one, do it. 67 00:07:13,750 --> 00:07:21,910 Yes, be 32, difficult veteran one five, could you see? 68 00:07:23,600 --> 00:07:25,790 That you don't have any errors. 69 00:07:27,240 --> 00:07:31,710 And make sure that you have S&P and small letters here. 70 00:07:46,200 --> 00:07:55,140 It's taking some time and we have explained how to enable yes, we have to do when you are doing Idy, 71 00:07:55,410 --> 00:07:57,930 you need to check this out if you can. 72 00:08:02,450 --> 00:08:08,480 As you can see now, Duncan Barling, which means that all the rebels are defined and everything's working 73 00:08:08,480 --> 00:08:09,100 just fine. 74 00:08:09,350 --> 00:08:16,130 Now we need to make sure, OK, here we have an issue now. 75 00:08:16,130 --> 00:08:24,710 We need to make sure that we create a new object from the Apache sensor, and it's called DHT. 76 00:08:25,580 --> 00:08:35,700 And it will take two variables that the first one is this one, DSG Ben, and the second one is that 77 00:08:35,720 --> 00:08:36,290 type. 78 00:08:38,810 --> 00:08:39,350 Now. 79 00:08:40,360 --> 00:08:42,370 We need to at a time of. 80 00:08:43,900 --> 00:08:44,320 Let's. 81 00:08:45,860 --> 00:08:49,370 Create a new playing Time Out for the blink. 82 00:08:50,000 --> 00:08:53,110 We will explain why we are doing this later. 83 00:08:57,620 --> 00:09:07,490 Doublecheck before moving on, we need to know that for blink up to recognize our E.S.P world, we need 84 00:09:07,490 --> 00:09:16,100 to have an authentication key which will be provided by the blink up once we see the top and the coming 85 00:09:16,100 --> 00:09:16,720 lessons. 86 00:09:17,060 --> 00:09:20,960 So for now, we need to define a character for the authentication. 87 00:09:23,100 --> 00:09:24,800 And here you need to enter. 88 00:09:26,020 --> 00:09:27,910 Your syndication. 89 00:09:29,700 --> 00:09:30,120 Court. 90 00:09:32,720 --> 00:09:33,200 Now. 91 00:09:35,350 --> 00:09:40,810 Since our E.S.P board is using Wi-Fi to connect to the Internet, we need to make sure that we have 92 00:09:40,810 --> 00:09:44,320 the Wi-Fi setting set up correctly. 93 00:09:44,410 --> 00:09:49,370 So define a new character for the network name. 94 00:09:50,500 --> 00:09:53,170 And here we will add Wi-Fi. 95 00:09:54,640 --> 00:10:01,040 This aside, and another character for the password. 96 00:10:08,800 --> 00:10:12,580 It wi fi password. 97 00:10:16,610 --> 00:10:19,850 You need to see column at the end of these two lines. 98 00:10:20,540 --> 00:10:28,400 Now we need to create a new method to send our census data to the up. 99 00:10:29,600 --> 00:10:37,870 Now, we know for sure that we have like three or four Sonsoles that are called for. 100 00:10:37,880 --> 00:10:39,650 This is pretty straightforward. 101 00:10:40,550 --> 00:10:48,590 We will use that DHT since our library to get the temperature and humidity readings and the water and 102 00:10:48,590 --> 00:10:51,470 soil moisture levels are just analog reading. 103 00:10:51,500 --> 00:10:58,490 So we can use the analog function to read the incoming data and arrange to convert it and send it to 104 00:10:58,490 --> 00:10:59,120 our app. 105 00:11:00,650 --> 00:11:07,690 Depending on your environment and sensor or constrains the analog values from the water and soil moisture 106 00:11:07,940 --> 00:11:13,140 level sensors can be treated and mapped into orange. 107 00:11:13,940 --> 00:11:17,420 Now we will create two functions to send data to. 108 00:11:17,420 --> 00:11:24,050 The blink of the first function will help send the temperature and humidity values since we are relying 109 00:11:24,050 --> 00:11:33,980 on the DH library and the second method will send the water and soil moisture levels, sensors, readings, 110 00:11:33,980 --> 00:11:35,720 which are basically analog readings. 111 00:11:36,390 --> 00:11:39,730 It will send these readings to weblink up. 112 00:11:39,920 --> 00:11:44,120 So let's get started with the first function like void. 113 00:11:48,450 --> 00:11:49,230 Cynde. 114 00:11:50,500 --> 00:11:52,370 Senseor DH. 115 00:11:54,240 --> 00:11:54,750 Now. 116 00:11:56,560 --> 00:12:03,040 This is the first method, and let's define the second method, then we can start writing the code, 117 00:12:04,080 --> 00:12:09,010 send salt water, soil. 118 00:12:13,480 --> 00:12:21,610 OK, now we have these two methods and the next lesson we are going to call these two methods and proceed 119 00:12:21,610 --> 00:12:26,160 with volume and voice at Wohlstetter functions, but that's it for this lesson. 120 00:12:26,170 --> 00:12:28,380 Let's do a quick revision. 121 00:12:28,420 --> 00:12:34,990 We included the Wi-Fi and Wi-Fi class libraries for the Wi-Fi connection that the city library for that 122 00:12:34,990 --> 00:12:41,470 temperature and humidity sensor, the Blink Symbol E.S.P library, so that we can easily connect our 123 00:12:41,470 --> 00:12:45,400 E.S.P 30 to board with the Blink servers. 124 00:12:46,540 --> 00:12:56,650 We defined these to make sure that we have the correct PIN number for that d.h sensorially water and 125 00:12:56,650 --> 00:12:57,630 soil sensor. 126 00:12:58,210 --> 00:13:05,080 And we created two variables to store the incoming data from the water and soil sensor. 127 00:13:05,350 --> 00:13:15,850 Since they are analog readings, we also defined an object called DHT from the DHT library and we created 128 00:13:15,850 --> 00:13:26,920 a timer using the Blink Time Library and the Blink Symbol E.S.P 32 library and we will use it at our 129 00:13:26,920 --> 00:13:27,730 functions. 130 00:13:28,030 --> 00:13:34,870 Now, we already mentioned that doubling up has an authentication key for each user and for each other. 131 00:13:34,900 --> 00:13:39,910 So you need to install the authentication key here and we will explain how to get it. 132 00:13:39,910 --> 00:13:47,370 And the practical lesson regarding the UpLink AB, we already mentioned that we are using Wi-Fi connection. 133 00:13:47,380 --> 00:13:49,420 So we define two variables. 134 00:13:49,960 --> 00:13:55,090 One, for the Wi-Fi network name and the other one for the password. 135 00:13:55,720 --> 00:13:59,130 Now we have two functions. 136 00:13:59,140 --> 00:14:05,560 The first one will be coded to send the temperature and humidity sensor readings and the second one 137 00:14:05,560 --> 00:14:12,250 will be coded to send the water and soil moisture level readings. 138 00:14:13,090 --> 00:14:14,350 That's it for this lesson. 139 00:14:14,620 --> 00:14:15,380 Thanks for watching. 140 00:14:15,400 --> 00:14:21,520 If you have any questions, please ask in the Q&A about this is Asharaf from educational engineering 141 00:14:21,520 --> 00:14:21,820 team.