Hello and welcome.
This new lesson in what are going to start coding using Arduino IEEE.
No idea.
Now.
Now we will start by including some libraries.
First, we know for sure that we will need let me increase the font size.
We will need the life.I library.
So right, why file the text?
And we also need the Wi-Fi client library.
The techs and we will need that the Adjetey Central Library.
So we have to include it.
And we need blinked.
Yes, P32 Library.
So let's include that, too.
Flanked.
Symbol, yes, but as a tool, the attacks.
Now, these are the main levers that we need.
Let's define some variables, and if we need more labels, we will add them as we go.
And according.
Now define the Ich bin.
And define the the edge.
D-type so let's define again.
The edge type since of type.
Now the sensor type is DHT 11 and the pin, as we already mentioned in the text document, that that
each PIN is number 23.
So here we are, right 23.
Now we need to initialize some variables for the relay.
And other components that we have in the system now, we know for sure that that really is connected
to PIN number 22.
And we also know.
That the water.
The level is connected to Ben.
No, he is 21.
And we will define either variable for that soil sensor, and it's connected to a pin number 19.
Now, just right since we're here and right, since we're here to make sure that.
Now, let's define 24 variables, what the water level.
And the other one, all the soil since.
Live in that.
Now we will use the ADHD library, but let's first save our code.
Now that you have saved the court, let's verify and make sure that we don't have any errors.
We will most likely face a library in error.
As you can see now, the DST library is not recognized, so you need to go to the tools.
OK now include library and from sketch include library manage libraries.
And we need to include these libraries now.
Look for the first library.
The DST.
Library, as you can see here, we have this sense of library.
Click Install.
And it's still all.
Now, as you can see, that number is installed.
Click close, click Verify.
Now you can see that the DHT is recognized, now we have this library playing symbol ESP and good sketch
include library managed libraries and do the same thing to include this library.
Now based right here at the Inter baton.
And wait.
Now you might need to change the key word that you are using to look for the library.
Here we have the blank library and those list has support for SB 32.
And political people all.
Now, as you can see, an installed.
Now click close and try to verify to see if this works or not.
As you can see, Blink Symbol Library is still defined, so we need to read this.
Now, the problem that we have here is that ISP is written in capital letters.
Let's throw a small letter and let's verify.
OK.
Now, as you can see.
This code now recognize that playing library, but since we are choosing Arduino as our pin board,
we are facing a verifying error.
So go and change this to your ISP served 32.
A.
Monoliths look for the one that we have.
Yes, Dev, difficult.
OK.
This one.
Do it.
Yes, we felt it too.
Kept veteran one a little bit before I could see.
That you don't have any unless.
And make sure that you have this and p and small letters here.
It's taking some time, and we have explained how to enable, yes, we have to do when you are doing
an I.D., you need to check this out if you can't.
As you can see now done compiling, which means that all of us are defined and everything's working
just fine now, we need to make sure.
OK, here we have an issue.
Now we need to make sure that we create a new object from the Adjetey sensor.
It's called DST and will take two variables.
The first one is this one DST pin.
The second one is the type.
Now.
We need to add a time of.
This.
Create a new blank document for the blank.
And we will explain why we are doing this later.
Now.
Double check before moving on.
We need to know that for blink up to recognize our ISP world, we need to have an authentication key
which will be provided by the blink once we set it up.
Incoming lessons.
So for now, we need to define a character for that authentication.
And here you need to enter.
Your syndication?
Court.
Now.
Since our ISP board is using Wi-Fi to connect to the internet, we need to make sure that we have the
Wi-Fi sitting set up correctly, so define a new character for the network name.
And here we will add Wi-Fi.
This is.
And another character for the password.
Here's why fi password.
You need to circle on the end of these two lines.
Now we need to create a new method to send our sense of data to the blink up.
Now we know for sure that we have like three or four sensors the alert will call for.
This is pretty straightforward.
We will use that DST sensor library to get that temperature and humidity readings and the water and
soil moisture levels are just analog readings, so we can use the analog function to read the incoming
data and arrange to convert it and send it to our app.
Depending on your environment and sensor constraints, the analog values from the water and soil moisture
levels in soils can be treated and moved into orange.
Now we will create two functions to send data to the blink.
The first function will help send the temperature and humidity values since we are relying on the the
image library.
And the second method will send the water and soil moisture levels, sensors, readings which are basically
analog readings.
It will send these readings to the lab link up.
So let's get started with the first function by void.
Send.
Or ditch.
Now.
This is the first method, and let's define the second method.
Then we can start, I think, both sand and salt water soil.
OK, now we have these two methods and the next lesson, we are going to call these two methods and
proceed with Volley Globe and also that functions.
But that's it for this lesson.
Let's do a quick revision.
We included the Wi-Fi and Wi-Fi client libraries for the Wi-Fi connection, the DST library for that
temperature and humidity sensor that blinks and ISP library so that we can easily connect our ISP filter
to a board with the Blink servers.
We defined these to make sure that we have the correct pin number for the edge sense or tele water and
soil sensor.
And we created two variables to store the incoming data from the water and soil sensor.
Since there are analog readings, we also defined an object called DST from the DHT library and we created
a timer using the Blink Timer Library and the Blink symbol SPF 32 library.
And we will use it at our functions.
Now, will it be mentioned that the Blink has an authentication key for each user and for each?
So you need to intelligent authentication key here, and we will explain how to get it in the practical
lesson regarding the Blink app.
We already mentioned that we are using Wi-Fi connection, so we defined two variables one for the Wi-Fi
network name and the other one for the password.
Now we have two functions.
The first one will be coded to send the temperature and humidity sensor readings.
And the second one will be recorded to send the water and soil moisture level readings.
That's it for this lesson.
Thanks for watching.
If you have any questions, please ask in the Q&A board.
This is Ashraf from educational engineering team.