Morning students today I will tell you how to acquire analog signal using ESP 8266.
On ESP 8266 there is a only one pin, one analog pin that is A0 available on ESP 8266.
We just use this to acquire analog signal.
For that purpose, we just create new template inside the developer zone like I just put over here.
Analog read name is analog read I'm using ESP 8266.
So I'm just connecting to the Wi-Fi.
Done.
Now the data stream part.
Create new data stream.
Virtual pin should be there.
So over here I just put a analog read R over here and v zero is my virtual pin.
So over here in the minimum maximum I just put 255 0 to 255.
If I got zero voltage I just acquire zero.
If maximum voltage I just read 255.
So just create this.
And the default value is zero in this case.
So I just go to the dashboard.
In the dashboard I just use a gauge.
Just drag over here.
This is my gauge.
You just increase the size of the gauge.
So configure this gauge.
You just put it over here.
You can also change override data stream over here.
Or you can change the color like there are many options.
So I just use this.
Save it.
Save this.
Now the web dashboard part completed.
So you just go to the device over here.
Create new device templates.
Analog read create.
So I require authentication ID name and token ID.
I just copy this.
Go to the code.
Change the code over here.
Now this part is same.
My Wi-Fi password and ID is again same.
So over here.
This is the code I just use blink timer also over here.
So I am just using creating a variable analog value as an integer analog read from a0 pin that is available
on SBA to 66.
I just write this over virtual pin b0 as a analog value and serial.print analog value plus string analog
value over the serial monitor.
Now, in the void setup, we have serial.begin.
That is my baud rate.
I am just calling blink app and I am just using timer.
Also over here in this case, inside the void loop I just run blink dot run and timer dot run.
So now you just upload this code inside the ESP 8266.
It hardly take one minute.
So after this we just go to the hardware part right now.
ESP is connected with my.
Com 22.
As you see.
So wait for some time.
So now as you see my ESP is connected and right now it is writing the code inside the ESP 8266.
So now hardware part.
As you see this is my analog pin that a0.
It is connected with the potentiometer center pin and this is my VCC and this yellow is my ground.
So let's check what happened.
So now I reset it.
So just go to the dashboard device Analogread.
Let's check value.
When I just increase decrease as you see value is right now 42.
Now 68.
25 to 55 okay.
So right now it is changing.
Now it is six.
Okay.
So this is how you can read analog signal using ESP 8 8.66.
Now we just go to the app inside the app.
Over here I just put go to my blink app Analogread.
Just add a gauge inside this or you can also use value display.
Let's check I'm just using Value display.
Select the data stream that is zero.
Now I want to again add one more inside it.
Right now 55 is there.
I want to add some gauge also inside this with the same.
Now gauge is there.
Over here you just need to select the data stream inside this back.
Back.
As you see I'm just changing the value Now it is 110 in my ESP.
There is a analog to digital converter.
So that's why we just acquire this signal in digital form.
So right now it is 2255.
Let's change in the developer zone.
I just go to the analog read and inside the data stream go to the data stream.
Over here you just put you just edit this data stream right now click over edit.
Go to the data stream over here.
Just put 1023.
This is the maximum value.
Save it.
Save and apply.
Go to the device.
Go to the analog read.
So right now it is maximum.
So this is my maximum value.
Now I just changed value 867.
There is a ten bit ADC inside the ESP 8266.
As you see different values.
So I just move it to extreme value right now.
As you see the value.
To 55 over here you just got 252 over here in the mobile phone.
This is maximum value.
I just change this.
Now it is okay.
So I am just changing the value.
So this is how you can read analog signal using ESP 8266.
So this is all about today's lecture.
Thank you.