Hello and welcome.
Now let's go to our Arduino ownable so that it can send data through the serial communication protocol
to our E.S.P board, nothing will be found on our Alvino side.
We will take samples from an analog digital converter and send it over soft cereal.
In order to do this, let's first open up Arduino.
Now will basically take census reading and we will send it through the soft serial communication protocol.
Let's create a new code.
No.
The first thing that we need to do is include the soft serial communication protocol, so include.
Soft where serial totex.
Now, the software Syrian.
Will be conducted using two pens and let's choose pens, number two and three as an example for the
receiver.
And the transmissive that Russell.
So there are ex ante X will be number two and three pins, number two and three.
And here we are not using the hardware serial.
You have to make sure that you understand the difference between software, serial and hardware serial
now inside the voice setup.
What we need to do is initialize the serial communications that begin at a specific moderate.
Then we need to plan something to make sure that it's working, so brand new line.
And let's right project.
Or interfacing Arduino with E.S.P 32.
Now, once you are done, you must start the software serial using the object that we are defined here
as W.
So as W dot begin and we have to assign a board rate, we will use the same board rate.
Now, this serial is the one that you see when you click the serial monitor and this is the software.
So this is the hardware serial and this is the software series.
Now let's go inside the void loop.
We started the hardware and software serial.
Now inside the void loop.
We need to plan something.
So let's try Serial, the brand new line.
Incited riots and.
Data to.
PSP 32 bought.
After that, we need to read the censor and let's connect it to a zero or analagous zero.
So ADC.
Value will equal analog 3D.
And inside it, we can fly zero or a zero now after this, we need to send that to the serial.
So serial.
The Trent.
And inside it, we must enter data in a specific format, so the format will usually be like this,
we have to write OK, like this, we have to add Tukur parentheses and add slash here.
And between these two parentheses, we have to install the sensor data and sensor ID.
So to say that we have more than one sensor here, we can define an already so and sensor already equals,
let's say 50.
And this also one.
This is the first sensor that we are adding here.
This will be more reasonable.
OK, now inside here, you have tried that at a specific format so that E.S.P can receive it and send
it to the web.
Now.
You have to, right exactly like me.
Let's start by adding that curly parentheses after add a slash, then add to.
26TH marks inside them, right?
The name of the variable, which is the idea after that, a slash then between these two marks and double
points, that's it.
This is the first line.
Now, the second line will send the.
Since we're all value, so we will have to pay this variable since Friday idea, this was described
in the text on the Syria monitor and this will send its value.
After that, we must add a comma.
Then we cannot see a real good Trent.
After the coma, we need to send the ADC value that we just received, so at last splashier then after
this at ADC.
Value.
OK, Liz.
Again, serial.
So here you need to add the slash and here you need to add ADC.
Value and slash, then between these two, you have to add double points, then you need to print the
value.
So serial the print.
Here will plant this variable, which is the value of our sensor, and we need to end this, so we have
to write serial print.
And Saadet, we need to add that Carol parentheses, as you can see, we started with the parentheses
and we ended with that closing tag for the this now to end this year, almost entirely new line, which
means that you have you all done and the data must be sent.
So at the end, that's it, this is the guy that we are going to send to the serial or the hardware
seller Moto.
Now we need to send the same data to the software serial that we just created.
And to do that, we just need to copy the very same code so we can copy all of this and based it on
we can write it again, but save time.
I will just copy.
Discord and to tears.
Now you have to change Syria with S.W..
It takes or uses the very same technology.
So we will send the very same values and at the end we need to either delay, let's make it 3000 milliseconds
or 4000 milliseconds.
Now let's save our code.
Let's name it arguido.
Paula.
Code click save now what you need to do is simply upload this code you are doing online.
So let me hook up my Arduino Ono.
Now that we have the balls connected, go to the device manager.
And from here, you can see the part on it, so go to the tools, make sure that command is chosen and
are doing all, then verify the code to make sure that doesn't have any errors.
Now upload the code.
Now, all stakeholders applauded.
You can operate a cereal monitor.
And see for yourself the kind of data that's being sent as you can, debt to GDP 32 and now since it
is one they see value is three hundred nineteen.
And that's changing.
Now, this data will be sent to the IRS people through the serial or the software protocol.
And we are going to cover the ESB 32 coding.
Now we are done with Arduino coding.
Now you can send any other value depending on your project, but this is it.
If your remote is showing this, it means that the cell communications is working correctly and you
are sending data in the correct format, correct parentheses and opening and closing the sensor idea
between two double quotation, the ADC value between two double quotation, and we have the sensor of
value and the same sort of value and we have a comma here between them.
So if you want to send other values, you have to add a comma and add data and the very same format
this and two double points then the value so we can send 100 value from ALGUIEN to E.S.P.
All you can even sentence Ansel's reading depending on the sense of ID and the ADC value for each sensor.
But here we are only sending two values since the idea and the sense of value, and this is the format
that you have to send the data.
That's it for this lesson.
Thanks for watching.
This is asharaf from educational engineering to.