1
00:00:17,000 --> 00:00:25,000
Today I will tell you how to generate an analog signal using ESP 8 to 66.

2
00:00:26,000 --> 00:00:30,000
In ESP 8266 there is no analog output port.

3
00:00:30,000 --> 00:00:35,000
We just generate analog signal using digital pin.

4
00:00:35,000 --> 00:00:38,000
We just create a PWM signal over here.

5
00:00:38,000 --> 00:00:43,000
By changing the width of the pulse we just create an analog signal.

6
00:00:43,000 --> 00:00:51,000
For that purpose we just go to Blink Console over here in the developer zone create new template.

7
00:00:51,000 --> 00:00:54,000
I just name it analog write.

8
00:00:56,000 --> 00:00:57,000
Analog write.

9
00:00:57,000 --> 00:01:01,000
I am using ESP 8266 right now.

10
00:01:01,000 --> 00:01:03,000
My connection type is Wi-Fi.

11
00:01:04,000 --> 00:01:04,000
Click.

12
00:01:04,000 --> 00:01:04,000
Over.

13
00:01:04,000 --> 00:01:05,000
Done.

14
00:01:05,000 --> 00:01:08,000
Now create a data stream.

15
00:01:09,000 --> 00:01:11,000
Go to the data stream using virtual Pin.

16
00:01:12,000 --> 00:01:21,000
So right now over here I just put analog read not analog read analog write.

17
00:01:21,000 --> 00:01:23,000
I'm using the zero pin.

18
00:01:23,000 --> 00:01:25,000
Inside this.

19
00:01:25,000 --> 00:01:33,000
The minimum value is zero and maximum value is 255 because there is a eight bit DSA.

20
00:01:33,000 --> 00:01:38,000
So now my data stream is created.

21
00:01:38,000 --> 00:01:39,000
Go to the web dashboard.

22
00:01:39,000 --> 00:01:45,000
Over here you just drag the slider inside this.

23
00:01:46,000 --> 00:01:52,000
Select the data stream V0 over here.

24
00:01:52,000 --> 00:01:54,000
Now just save it.

25
00:01:56,000 --> 00:01:57,000
Increase the size.

26
00:01:58,000 --> 00:01:59,000
Save this.

27
00:02:00,000 --> 00:02:02,000
Go to the device.

28
00:02:03,000 --> 00:02:08,000
Create new device from template Analogwrite.

29
00:02:08,000 --> 00:02:09,000
Create.

30
00:02:11,000 --> 00:02:13,000
Now this is my code.

31
00:02:14,000 --> 00:02:16,000
Or you can say my API key.

32
00:02:16,000 --> 00:02:18,000
Click over here.

33
00:02:18,000 --> 00:02:19,000
Go to the code.

34
00:02:21,000 --> 00:02:24,000
Just copy and paste over here.

35
00:02:24,000 --> 00:02:26,000
Now as you see my template ID is.

36
00:02:26,000 --> 00:02:28,000
This template name is Analogwrite.

37
00:02:28,000 --> 00:02:30,000
My authentication ID is this.

38
00:02:30,000 --> 00:02:32,000
This is my same code.

39
00:02:32,000 --> 00:02:35,000
My wifi ID password is same.

40
00:02:35,000 --> 00:02:37,000
I'm using virtual pin zero.

41
00:02:38,000 --> 00:02:40,000
So over here this is my code.

42
00:02:40,000 --> 00:02:42,000
The value is my variable.

43
00:02:42,000 --> 00:02:48,000
It comes as a integer through the parameter as an integer.

44
00:02:49,000 --> 00:02:51,000
Right now I'm using command analogwrite.

45
00:02:51,000 --> 00:02:57,000
I'm writing over pin number five and the pin number five.

46
00:02:57,000 --> 00:03:05,000
Inside the ESP 8266 is the one I just connect D one to my LED.

47
00:03:06,000 --> 00:03:12,000
So I am just changing the brightness using my slider.

48
00:03:12,000 --> 00:03:15,000
So over here I just put the value.

49
00:03:15,000 --> 00:03:19,000
Value may be from 0 to 255.

50
00:03:19,000 --> 00:03:26,000
So over here this is my void setup Serial.begin 1150 200.

51
00:03:26,000 --> 00:03:27,000
This is my baud rate.

52
00:03:27,000 --> 00:03:31,000
I just use blink app also.

53
00:03:31,000 --> 00:03:32,000
Pinmode.

54
00:03:32,000 --> 00:03:40,000
Right now over here is output as the output five as the output five is my D1 pin.

55
00:03:40,000 --> 00:03:44,000
So in the loop I just blink dot run.

56
00:03:44,000 --> 00:03:49,000
So upload this code inside the ESp8266.

57
00:03:53,000 --> 00:03:54,000
It will take some time.

58
00:04:03,000 --> 00:04:07,000
After uploading the code we just go to the hardware part.

59
00:04:45,000 --> 00:04:47,000
So now it is writing.

60
00:04:56,000 --> 00:04:59,000
So we just move to the hardware.

61
00:05:00,000 --> 00:05:03,000
Right now I am just resetting it.

62
00:05:03,000 --> 00:05:04,000
Hard reset.

63
00:05:05,000 --> 00:05:13,000
So over here this red pin is connected to D1 pin because its Gpio number is five.

64
00:05:14,000 --> 00:05:16,000
That I provide inside the code.

65
00:05:16,000 --> 00:05:17,000
This is my ground.

66
00:05:17,000 --> 00:05:19,000
My LED is connected over here.

67
00:05:19,000 --> 00:05:23,000
So now just move to the dashboard.

68
00:05:23,000 --> 00:05:24,000
Blink console.

69
00:05:24,000 --> 00:05:25,000
Dashboard.

70
00:05:26,000 --> 00:05:27,000
Go to the devices.

71
00:05:27,000 --> 00:05:29,000
My device is online.

72
00:05:29,000 --> 00:05:30,000
Go to analog.

73
00:05:30,000 --> 00:05:30,000
Right.

74
00:05:31,000 --> 00:05:35,000
So I just increase the slider.

75
00:05:35,000 --> 00:05:42,000
As you see the brightness comes from the LED right now.

76
00:05:43,000 --> 00:05:46,000
You just increase the brightness using this.

77
00:05:46,000 --> 00:05:50,000
So now I am just decreasing the brightness.

78
00:05:51,000 --> 00:05:56,000
You just check over the LED and steps.

79
00:05:56,000 --> 00:05:56,000
Okay.

80
00:05:56,000 --> 00:05:59,000
So now this is from the dashboard.

81
00:05:59,000 --> 00:06:03,000
Now we just move to the mobile app.

82
00:06:04,000 --> 00:06:09,000
So over here I just go to the blink console.

83
00:06:09,000 --> 00:06:11,000
link app over here.

84
00:06:11,000 --> 00:06:13,000
This is my analog, right?

85
00:06:13,000 --> 00:06:14,000
Is there?

86
00:06:14,000 --> 00:06:20,000
Go to the gearbox add new device.

87
00:06:20,000 --> 00:06:22,000
That is my slider.

88
00:06:22,000 --> 00:06:30,000
I just drag this over here, select the data stream, use the data stream.

89
00:06:31,000 --> 00:06:33,000
Now I just move.

90
00:06:35,000 --> 00:06:36,000
Just back.

91
00:06:36,000 --> 00:06:42,000
Now I just increase as you see brightness.

92
00:06:42,000 --> 00:06:46,000
Right now just change the brightness.

93
00:06:47,000 --> 00:06:58,000
So this is how you can change or generate analog signal using ESP 8266.

94
00:06:59,000 --> 00:07:01,000
So this is all about today's lecture.

95
00:07:01,000 --> 00:07:02,000
Thank you.

