1
00:00:16,000 --> 00:00:24,000
Morning students today I will tell you how to acquire analog signal using ESP 8266.

2
00:00:25,000 --> 00:00:35,000
On ESP 8266 there is a only one pin, one analog pin that is A0 available on ESP 8266.

3
00:00:35,000 --> 00:00:38,000
We just use this to acquire analog signal.

4
00:00:38,000 --> 00:00:48,000
For that purpose, we just create new template inside the developer zone like I just put over here.

5
00:00:50,000 --> 00:00:57,000
Analog read name is analog read I'm using ESP 8266.

6
00:00:58,000 --> 00:01:02,000
So I'm just connecting to the Wi-Fi.

7
00:01:03,000 --> 00:01:03,000
Done.

8
00:01:04,000 --> 00:01:06,000
Now the data stream part.

9
00:01:06,000 --> 00:01:08,000
Create new data stream.

10
00:01:09,000 --> 00:01:10,000
Virtual pin should be there.

11
00:01:10,000 --> 00:01:22,000
So over here I just put a analog read R over here and v zero is my virtual pin.

12
00:01:23,000 --> 00:01:31,000
So over here in the minimum maximum I just put 255 0 to 255.

13
00:01:32,000 --> 00:01:38,000
If I got zero voltage I just acquire zero.

14
00:01:38,000 --> 00:01:42,000
If maximum voltage I just read 255.

15
00:01:42,000 --> 00:01:44,000
So just create this.

16
00:01:45,000 --> 00:01:48,000
And the default value is zero in this case.

17
00:01:48,000 --> 00:01:52,000
So I just go to the dashboard.

18
00:01:52,000 --> 00:01:55,000
In the dashboard I just use a gauge.

19
00:01:55,000 --> 00:01:58,000
Just drag over here.

20
00:01:58,000 --> 00:02:00,000
This is my gauge.

21
00:02:03,000 --> 00:02:06,000
You just increase the size of the gauge.

22
00:02:07,000 --> 00:02:09,000
So configure this gauge.

23
00:02:10,000 --> 00:02:13,000
You just put it over here.

24
00:02:14,000 --> 00:02:20,000
You can also change override data stream over here.

25
00:02:20,000 --> 00:02:25,000
Or you can change the color like there are many options.

26
00:02:25,000 --> 00:02:28,000
So I just use this.

27
00:02:29,000 --> 00:02:30,000
Save it.

28
00:02:31,000 --> 00:02:32,000
Save this.

29
00:02:33,000 --> 00:02:38,000
Now the web dashboard part completed.

30
00:02:39,000 --> 00:02:45,000
So you just go to the device over here.

31
00:02:46,000 --> 00:02:49,000
Create new device templates.

32
00:02:49,000 --> 00:02:51,000
Analog read create.

33
00:02:52,000 --> 00:02:58,000
So I require authentication ID name and token ID.

34
00:02:58,000 --> 00:02:59,000
I just copy this.

35
00:02:59,000 --> 00:03:00,000
Go to the code.

36
00:03:02,000 --> 00:03:05,000
Change the code over here.

37
00:03:05,000 --> 00:03:07,000
Now this part is same.

38
00:03:07,000 --> 00:03:11,000
My Wi-Fi password and ID is again same.

39
00:03:11,000 --> 00:03:12,000
So over here.

40
00:03:12,000 --> 00:03:18,000
This is the code I just use blink timer also over here.

41
00:03:18,000 --> 00:03:28,000
So I am just using creating a variable analog value as an integer analog read from a0 pin that is available

42
00:03:28,000 --> 00:03:30,000
on SBA to 66.

43
00:03:30,000 --> 00:03:40,000
I just write this over virtual pin b0 as a analog value and serial.print analog value plus string analog

44
00:03:40,000 --> 00:03:42,000
value over the serial monitor.

45
00:03:42,000 --> 00:03:46,000
Now, in the void setup, we have serial.begin.

46
00:03:46,000 --> 00:03:48,000
That is my baud rate.

47
00:03:49,000 --> 00:03:54,000
I am just calling blink app and I am just using timer.

48
00:03:54,000 --> 00:04:02,000
Also over here in this case, inside the void loop I just run blink dot run and timer dot run.

49
00:04:02,000 --> 00:04:08,000
So now you just upload this code inside the ESP 8266.

50
00:04:08,000 --> 00:04:11,000
It hardly take one minute.

51
00:04:13,000 --> 00:04:17,000
So after this we just go to the hardware part right now.

52
00:04:18,000 --> 00:04:20,000
ESP is connected with my.

53
00:04:20,000 --> 00:04:21,000
Com 22.

54
00:04:22,000 --> 00:04:23,000
As you see.

55
00:04:25,000 --> 00:04:26,000
So wait for some time.

56
00:04:54,000 --> 00:05:05,000
So now as you see my ESP is connected and right now it is writing the code inside the ESP 8266.

57
00:05:14,000 --> 00:05:16,000
So now hardware part.

58
00:05:16,000 --> 00:05:21,000
As you see this is my analog pin that a0.

59
00:05:21,000 --> 00:05:29,000
It is connected with the potentiometer center pin and this is my VCC and this yellow is my ground.

60
00:05:29,000 --> 00:05:32,000
So let's check what happened.

61
00:05:32,000 --> 00:05:33,000
So now I reset it.

62
00:05:35,000 --> 00:05:42,000
So just go to the dashboard device Analogread.

63
00:05:43,000 --> 00:05:46,000
Let's check value.

64
00:05:49,000 --> 00:05:56,000
When I just increase decrease as you see value is right now 42.

65
00:05:58,000 --> 00:05:59,000
Now 68.

66
00:06:01,000 --> 00:06:05,000
25 to 55 okay.

67
00:06:06,000 --> 00:06:11,000
So right now it is changing.

68
00:06:12,000 --> 00:06:13,000
Now it is six.

69
00:06:13,000 --> 00:06:14,000
Okay.

70
00:06:14,000 --> 00:06:23,000
So this is how you can read analog signal using ESP 8 8.66.

71
00:06:23,000 --> 00:06:28,000
Now we just go to the app inside the app.

72
00:06:28,000 --> 00:06:35,000
Over here I just put go to my blink app Analogread.

73
00:06:36,000 --> 00:06:45,000
Just add a gauge inside this or you can also use value display.

74
00:06:45,000 --> 00:06:49,000
Let's check I'm just using Value display.

75
00:06:52,000 --> 00:06:56,000
Select the data stream that is zero.

76
00:06:56,000 --> 00:07:02,000
Now I want to again add one more inside it.

77
00:07:02,000 --> 00:07:04,000
Right now 55 is there.

78
00:07:04,000 --> 00:07:10,000
I want to add some gauge also inside this with the same.

79
00:07:13,000 --> 00:07:15,000
Now gauge is there.

80
00:07:15,000 --> 00:07:22,000
Over here you just need to select the data stream inside this back.

81
00:07:22,000 --> 00:07:23,000
Back.

82
00:07:23,000 --> 00:07:33,000
As you see I'm just changing the value Now it is 110 in my ESP.

83
00:07:33,000 --> 00:07:37,000
There is a analog to digital converter.

84
00:07:37,000 --> 00:07:42,000
So that's why we just acquire this signal in digital form.

85
00:07:42,000 --> 00:07:45,000
So right now it is 2255.

86
00:07:45,000 --> 00:07:49,000
Let's change in the developer zone.

87
00:07:50,000 --> 00:07:59,000
I just go to the analog read and inside the data stream go to the data stream.

88
00:07:59,000 --> 00:08:09,000
Over here you just put you just edit this data stream right now click over edit.

89
00:08:10,000 --> 00:08:13,000
Go to the data stream over here.

90
00:08:13,000 --> 00:08:15,000
Just put 1023.

91
00:08:16,000 --> 00:08:17,000
This is the maximum value.

92
00:08:18,000 --> 00:08:18,000
Save it.

93
00:08:19,000 --> 00:08:21,000
Save and apply.

94
00:08:22,000 --> 00:08:23,000
Go to the device.

95
00:08:24,000 --> 00:08:26,000
Go to the analog read.

96
00:08:26,000 --> 00:08:29,000
So right now it is maximum.

97
00:08:30,000 --> 00:08:32,000
So this is my maximum value.

98
00:08:32,000 --> 00:08:36,000
Now I just changed value 867.

99
00:08:36,000 --> 00:08:42,000
There is a ten bit ADC inside the ESP 8266.

100
00:08:42,000 --> 00:08:45,000
As you see different values.

101
00:08:45,000 --> 00:08:50,000
So I just move it to extreme value right now.

102
00:08:51,000 --> 00:08:53,000
As you see the value.

103
00:08:55,000 --> 00:09:04,000
To 55 over here you just got 252 over here in the mobile phone.

104
00:09:04,000 --> 00:09:05,000
This is maximum value.

105
00:09:05,000 --> 00:09:07,000
I just change this.

106
00:09:08,000 --> 00:09:09,000
Now it is okay.

107
00:09:10,000 --> 00:09:14,000
So I am just changing the value.

108
00:09:14,000 --> 00:09:21,000
So this is how you can read analog signal using ESP 8266.

109
00:09:21,000 --> 00:09:25,000
So this is all about today's lecture.

110
00:09:25,000 --> 00:09:26,000
Thank you.

