1
00:00:00,720 --> 00:00:07,200
The president, 32, also has an integrated temperature sensor, this temperature sensor is part of

2
00:00:07,200 --> 00:00:14,550
the package of the E.S.P 32 and provides information about how hot the microcontroller is running.

3
00:00:14,850 --> 00:00:20,790
You can then use it to keep an eye on its own, whether perhaps its overheating.

4
00:00:21,420 --> 00:00:24,990
It can be used to measure ambient temperature.

5
00:00:25,000 --> 00:00:32,370
But you need to then take into account the fact that the sensor is basically integrated on the chip

6
00:00:32,850 --> 00:00:34,590
of the EPA 32 itself.

7
00:00:34,600 --> 00:00:40,830
So much of the temperature component to much of the heat that is picking up is from its own operation

8
00:00:40,830 --> 00:00:42,430
and not so much from the environment.

9
00:00:42,780 --> 00:00:49,860
So if you do want to take a measurement of the atmospheric temperature, the ambient temperature, it's

10
00:00:49,860 --> 00:00:56,920
best to do that when the device has just started before the device had enough time to heat up itself.

11
00:00:57,600 --> 00:00:59,460
So I've got an example sketch here.

12
00:00:59,460 --> 00:01:07,530
As you can see, I am importing the E.S.P 32 module and I'm using the raw temperature function to get

13
00:01:07,590 --> 00:01:09,300
a temperature reading.

14
00:01:09,660 --> 00:01:15,930
You can find more information about that here in the documentation and the EPA data general board control.

15
00:01:16,290 --> 00:01:20,040
There's a bit of information about the temperature function.

16
00:01:20,250 --> 00:01:26,280
And just keep in mind that the number that comes back is temperature in Fahrenheit, not in Celsius.

17
00:01:27,000 --> 00:01:30,930
So you can use this function to get the temperature in Fahrenheit.

18
00:01:30,930 --> 00:01:36,810
And then in this example, I've got the calculation that converts Fahrenheit into Celsius.

19
00:01:36,810 --> 00:01:37,980
So you can print that out this.

20
00:01:37,980 --> 00:01:40,500
Well, it's got a little delay here.

21
00:01:40,500 --> 00:01:41,370
Just one second.

22
00:01:42,030 --> 00:01:47,040
So let's start the script and see what the current temperature is.

23
00:01:47,130 --> 00:01:47,430
All right.

24
00:01:47,480 --> 00:01:54,030
So about 120 degrees Fahrenheit, which is about forty eight point eighty nine degrees Celsius.

25
00:01:54,690 --> 00:01:56,890
And it's quite hot, actually.

26
00:01:57,720 --> 00:02:04,230
Let's see if I can use my hot air gun to see.

27
00:02:05,460 --> 00:02:09,690
So I'm just blowing hot air on the three 32.

28
00:02:17,670 --> 00:02:19,930
And so the temperature is going up slightly.

29
00:02:19,950 --> 00:02:24,360
So obviously this works as advertised.

30
00:02:24,400 --> 00:02:25,050
No problem.

31
00:02:26,130 --> 00:02:32,730
So I use case for this sensor is, for example, if you are building a outdoors gadget based on your

32
00:02:32,820 --> 00:02:39,660
computer to which perhaps will be under direct sunlight or it might be operating in hot conditions,

33
00:02:40,080 --> 00:02:46,410
it can check on the temperature of the MCU occasionally a few minutes to make sure that it does not

34
00:02:46,410 --> 00:02:49,110
exceed its operational limits.

35
00:02:49,110 --> 00:02:57,480
And if it does get close to the top end of its operation limits, then you can decide to turn off the

36
00:02:57,480 --> 00:02:59,500
device or put it into deep sleep.

37
00:02:59,520 --> 00:03:00,360
Certainly cool down.
