1
00:00:16,000 --> 00:00:27,000
This way we just see how to read digital signal using ESp8266.

2
00:00:28,000 --> 00:00:35,000
So for that purpose we just go to Developer Zone create new template.

3
00:00:36,000 --> 00:00:41,000
In this I just name it Digital read.

4
00:00:42,000 --> 00:00:48,000
So I am using ESP 8266 connection type.

5
00:00:48,000 --> 00:00:48,000
Wi-Fi.

6
00:00:48,000 --> 00:00:50,000
Just click on done.

7
00:00:51,000 --> 00:00:56,000
Now you just create a data stream for this new data stream.

8
00:00:56,000 --> 00:00:58,000
My data stream should be virtual pin.

9
00:00:59,000 --> 00:01:02,000
So just I'm over here.

10
00:01:02,000 --> 00:01:04,000
I'm using the zero pin.

11
00:01:04,000 --> 00:01:06,000
So just name it.

12
00:01:06,000 --> 00:01:09,000
Let's say d one or D zero.

13
00:01:10,000 --> 00:01:12,000
D0D8.

14
00:01:13,000 --> 00:01:15,000
So right now d zero is there.

15
00:01:15,000 --> 00:01:26,000
I just connect d zero with plus five volt or plus three volt and ground volt and ground.

16
00:01:26,000 --> 00:01:36,000
So that I just acquire when it is connected with three volt we just get I mean we just connect it with

17
00:01:36,000 --> 00:01:36,000
ground.

18
00:01:36,000 --> 00:01:39,000
We just acquire zero or low signal.

19
00:01:40,000 --> 00:01:40,000
Okay.

20
00:01:40,000 --> 00:01:46,000
So now I just go to the web dashboard over here.

21
00:01:46,000 --> 00:01:51,000
I just drag the input state or LED.

22
00:01:52,000 --> 00:01:56,000
So I just drag this LED over here.

23
00:01:57,000 --> 00:02:00,000
You just increase the size.

24
00:02:00,000 --> 00:02:02,000
So right now this is the LED.

25
00:02:02,000 --> 00:02:04,000
Just click over here.

26
00:02:05,000 --> 00:02:08,000
You just select the data stream.

27
00:02:08,000 --> 00:02:11,000
The color may be red.

28
00:02:12,000 --> 00:02:14,000
You just select save it.

29
00:02:14,000 --> 00:02:24,000
Now you just check the output of the V0 pin over this d0 led.

30
00:02:24,000 --> 00:02:25,000
Okay.

31
00:02:25,000 --> 00:02:28,000
Now just go to device before this.

32
00:02:28,000 --> 00:02:31,000
You just need to save it.

33
00:02:31,000 --> 00:02:35,000
Also right now as you see I forgot to save it.

34
00:02:35,000 --> 00:02:42,000
So again I need to create new data stream virtual pin.

35
00:02:43,000 --> 00:02:45,000
So this is my D zero.

36
00:02:49,000 --> 00:02:51,000
308.

37
00:02:52,000 --> 00:02:56,000
Now web dashboard go to the LEDs.

38
00:02:58,000 --> 00:03:01,000
Let's drag over here.

39
00:03:01,000 --> 00:03:03,000
is the size.

40
00:03:03,000 --> 00:03:06,000
We just change the color.

41
00:03:06,000 --> 00:03:09,000
Also, I am just putting red over here.

42
00:03:09,000 --> 00:03:09,000
Save it.

43
00:03:09,000 --> 00:03:11,000
Save it from here.

44
00:03:11,000 --> 00:03:13,000
Now it is saved.

45
00:03:13,000 --> 00:03:15,000
So go to the device.

46
00:03:15,000 --> 00:03:19,000
Create new device from template.

47
00:03:19,000 --> 00:03:22,000
You just select the template name.

48
00:03:23,000 --> 00:03:24,000
Create.

49
00:03:24,000 --> 00:03:28,000
Right now this is my authentication ID.

50
00:03:28,000 --> 00:03:30,000
Template ID and template name.

51
00:03:31,000 --> 00:03:33,000
So just copy this.

52
00:03:33,000 --> 00:03:36,000
Go to the code over here.

53
00:03:36,000 --> 00:03:38,000
You just paste it.

54
00:03:39,000 --> 00:03:41,000
So this is the same.

55
00:03:42,000 --> 00:03:45,000
My wifi ID password is same.

56
00:03:45,000 --> 00:03:50,000
So over here there is a little bit difference in the code.

57
00:03:50,000 --> 00:03:52,000
Void setup Serial.begin.

58
00:03:52,000 --> 00:03:53,000
It is the baud rate.

59
00:03:53,000 --> 00:03:56,000
Blink dot begin.

60
00:03:56,000 --> 00:03:58,000
You have to call pin mode.

61
00:03:58,000 --> 00:04:00,000
I'm using pin number 16.

62
00:04:00,000 --> 00:04:01,000
That is d0 pin European.

63
00:04:02,000 --> 00:04:11,000
According to the diagram, then in the void loop you just blink, run it, then we have a variable signal

64
00:04:11,000 --> 00:04:12,000
state.

65
00:04:12,000 --> 00:04:22,000
We just use digital read from pin number 16 and we just write it over the blink virtual write v0.

66
00:04:22,000 --> 00:04:23,000
Okay.

67
00:04:23,000 --> 00:04:27,000
So we just use v0 and over v0.

68
00:04:27,000 --> 00:04:32,000
We just put the signal state and at a one millisecond delay okay.

69
00:04:32,000 --> 00:04:39,000
So you just need to write this code for me.

70
00:04:39,000 --> 00:04:41,000
Selected ports board is selected.

71
00:04:41,000 --> 00:04:43,000
Just run it.

72
00:04:49,000 --> 00:04:50,000
So it will take some time.

73
00:05:01,000 --> 00:05:04,000
So now code is compiling.

74
00:05:20,000 --> 00:05:26,000
So now it is writing in the ESP controller.

75
00:05:26,000 --> 00:05:29,000
70% 30% 38%.

76
00:05:30,000 --> 00:05:31,000
Hardly.

77
00:05:31,000 --> 00:05:34,000
Take one minute and writing the code.

78
00:05:39,000 --> 00:05:40,000
So now.

79
00:05:43,000 --> 00:05:48,000
Code is successfully burned in the ESP 266.

80
00:05:48,000 --> 00:05:51,000
Now we require signal.

81
00:05:51,000 --> 00:05:55,000
So we just go to the hardware part.

82
00:05:55,000 --> 00:05:56,000
Part.

83
00:05:56,000 --> 00:06:01,000
As you see right now I just connect D zero pin.

84
00:06:01,000 --> 00:06:04,000
So this is my D D0 pin over here.

85
00:06:04,000 --> 00:06:06,000
This is my d0.

86
00:06:08,000 --> 00:06:10,000
Now I just connect.

87
00:06:10,000 --> 00:06:15,000
Three volt signal to my D0 pin.

88
00:06:15,000 --> 00:06:22,000
Okay so right now I already just reset it.

89
00:06:22,000 --> 00:06:26,000
So let's check what happened on the dashboard.

90
00:06:27,000 --> 00:06:28,000
Go to the device.

91
00:06:42,000 --> 00:06:44,000
Go to the device over here.

92
00:06:44,000 --> 00:06:46,000
Device is online.

93
00:06:46,000 --> 00:06:48,000
Digital read.

94
00:06:48,000 --> 00:06:50,000
As you see color is red.

95
00:06:51,000 --> 00:06:54,000
Let's check what happened when I just connect.

96
00:06:54,000 --> 00:06:56,000
In place of three volt.

97
00:06:59,000 --> 00:07:04,000
So I just remove this and connect Ground signal over here.

98
00:07:06,000 --> 00:07:09,000
So what happened now?

99
00:07:09,000 --> 00:07:12,000
Signal is off.

100
00:07:12,000 --> 00:07:23,000
So when I just connect this three volt signal over here, my signal is high after some delay.

101
00:07:24,000 --> 00:07:26,000
As you see, signal is red.

102
00:07:26,000 --> 00:07:32,000
So now we just see the signal over the mobile phone also.

103
00:07:32,000 --> 00:07:36,000
So as you see over here this is my digital read.

104
00:07:38,000 --> 00:07:43,000
You just configure it add a signal right now.

105
00:07:47,000 --> 00:07:50,000
Add EV require a LED.

106
00:07:52,000 --> 00:07:53,000
So go to the LED.

107
00:07:54,000 --> 00:07:56,000
So this is my LED over here.

108
00:07:57,000 --> 00:08:00,000
You just need to select the data stream.

109
00:08:00,000 --> 00:08:03,000
My data stream is D0.

110
00:08:04,000 --> 00:08:05,000
Back.

111
00:08:05,000 --> 00:08:06,000
Back.

112
00:08:06,000 --> 00:08:09,000
So right now let's check.

113
00:08:10,000 --> 00:08:13,000
Right now it is connected with three volt.

114
00:08:13,000 --> 00:08:15,000
So it is its color is blue.

115
00:08:15,000 --> 00:08:19,000
Let's check what happened when I just connect the ground over here.

116
00:08:19,000 --> 00:08:22,000
As you see it is off.

117
00:08:23,000 --> 00:08:24,000
It is in off condition.

118
00:08:24,000 --> 00:08:30,000
It is up to you how you show the off condition, how you show the on condition.

119
00:08:30,000 --> 00:08:34,000
Let's change the color of LED.

120
00:08:35,000 --> 00:08:39,000
So I just go to the device on the dashboard.

121
00:08:39,000 --> 00:08:42,000
I just added this.

122
00:08:43,000 --> 00:08:53,000
I want to change the color to let's say orange okay.

123
00:08:53,000 --> 00:08:56,000
So let's check what happened.

124
00:08:56,000 --> 00:08:57,000
Save.

125
00:08:59,000 --> 00:09:04,000
Again go to the device Digital read.

126
00:09:04,000 --> 00:09:11,000
So right now it is in off condition when I just connect it with three volt.

127
00:09:11,000 --> 00:09:16,000
So now it is glowing or it is in high state.

128
00:09:16,000 --> 00:09:25,000
So this is how you can read digital signal using ESP 82366.

129
00:09:25,000 --> 00:09:34,000
You can connect any sensor that generate digital signal using this code.

130
00:09:34,000 --> 00:09:39,000
Also like if you want to interface IR sensor, if you want to interface LDR.

131
00:09:39,000 --> 00:09:45,000
If you want to interface Pir sensor, you just use this code only.

132
00:09:45,000 --> 00:09:54,000
So using this code you can read any digital signal using ESP 8266.

133
00:09:54,000 --> 00:09:55,000
Thank you.

