4254 views|17 replies

1942

Posts

2

Resources
The OP
 

[Gizwits Gokit 3 Review] Part 4: Temperature and humidity monitoring and computer power on and off [Copy link]

 
 

1. Introduction

After the network access is successful, you need to start data communication. First, you need to modify the data points and add the following three data points. One is used to control the computer switch, and the other is used to obtain temperature and humidity. Since the board has its own temperature and humidity sensor, you can get it directly.

2. Design

First, enter the previous project and add data points, as shown in Figure 1 below.

Figure 1

Then just download the source code.

Figure 2

First add the dht library. I found one on the Internet and can call it directly.

Figure 3

Then, as in the previous article, comment some LOGs and add variables as shown in the figure below.

Figure 4

Initialize the motor pins. You will need to replace them with servos later and use them to control the computer switch buttons.

Figure 5

The pin for observing temperature and humidity is D3 port. At the same time, add the following code in the loop to obtain temperature and humidity + detect computer switch events and respond.

Figure 6

Finally I downloaded the program and used my phone to check it. There was another pitfall here. I had my own usual phone and when I opened the software it actually restarted my phone. Also, I had to reinstall the software after modifying the data points . Finally I changed to a spare phone and everything worked fine. Anyway, this is how I solved the problem of incorrect data points.

Figure 7

Figure 8

Finally, let’s take a look at the power consumption. As shown in Figure 9 below, 110mA is a bit high. Next time, we will try the low power consumption mode.

Fig. 9

3. Summary

I encountered some problems this time, but I finally solved them. I hope you won't get stuck when you encounter these problems! I will continue to update when I have time, including low power consumption and servo control.

This post is from Domestic Chip Exchange

Latest reply

Last night in Dalian, I used sensory.box to measure 21.5 40%  Details Published on 2021-5-10 17:38
 
 

6555

Posts

0

Resources
2
 

It is better to use the onboard temperature and humidity sensor to obtain it directly. Thanks for sharing.

This post is from Domestic Chip Exchange

Comments

The temperature and humidity sensor on board is used.  Details Published on 2021-3-22 10:04
 
 
 

1942

Posts

2

Resources
3
 
Jacktang posted on 2021-3-21 21:03 It is better to use the onboard temperature and humidity sensor to obtain it directly, thank you for sharing

The temperature and humidity sensor on board is used.

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
4
 

The interface is ok

This post is from Domestic Chip Exchange

Comments

It's OK, the Android source code is open source, so we can make a better interface~  Details Published on 2021-3-23 09:14
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1942

Posts

2

Resources
5
 

It's OK, the Android source code is open source, so we can make a better interface~

This post is from Domestic Chip Exchange
 
 
 

143

Posts

0

Resources
6
 

Awesome, come and support us

This post is from Domestic Chip Exchange
 
 
 

9702

Posts

24

Resources
7
 

Are the temperature 26 and humidity 14% the real values?

This post is from Domestic Chip Exchange

Comments

Yes, do you think the humidity is a bit low? Because I am in the north~  Details Published on 2021-5-9 13:16
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

1942

Posts

2

Resources
8
 
littleshrimp posted on 2021-5-9 09:13 Is the temperature 26 and humidity 14% the real value?

Yes, do you think the humidity is a bit low? Because I am in the north~

This post is from Domestic Chip Exchange

Comments

This is too low in the north.  Details Published on 2021-5-9 13:50
 
 
 

9702

Posts

24

Resources
9
 
w494143467 posted on 2021-5-9 13:16 Yes, do you think the humidity is a bit low? Because I am in the north~

This is too low in the north.

This post is from Domestic Chip Exchange

Comments

Haha, I'm used to it. I'm still in the coastal area, not in the coastal areas!  Details Published on 2021-5-9 15:22
 
 
 

1942

Posts

2

Resources
10
 
littleshrimp posted on 2021-5-9 13:50 This is too low in the north

Haha, I'm used to it. I'm still in the coastal area, not in the coastal areas!

This post is from Domestic Chip Exchange

Comments

I looked at the time and it should be because you had the heating on at that time.  Details Published on 2021-5-9 18:58
 
 
 

9702

Posts

24

Resources
11
 
w494143467 published on 2021-5-9 15:22 Haha, I'm used to it. I'm still in the coastal area, not in the coastal areas!

I looked at the time and it should be because you had the heating on at that time.

This post is from Domestic Chip Exchange

Comments

There should be heating at this time, but it is also relatively dry without heating, basically around 20%  Details Published on 2021-5-10 09:55
 
 
 

1942

Posts

2

Resources
12
 
littleshrimp posted on 2021-5-9 18:58 I looked at the time and it should be related to the heating at that time

There should be heating at this time, but it is also relatively dry without heating, basically around 20%

This post is from Domestic Chip Exchange
 
 
 

9702

Posts

24

Resources
13
 

What's the humidity now?

This post is from Domestic Chip Exchange

Comments

Today's weather forecast: Humidity 37%  Details Published on 2021-5-10 13:56
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

1942

Posts

2

Resources
14
 
littleshrimp posted on 2021-5-10 11:01 What is the humidity now?

Today's weather forecast: Humidity 37%

This post is from Domestic Chip Exchange

Comments

Almost like mine  Details Published on 2021-5-10 15:35
 
 
 

9702

Posts

24

Resources
15
 
w494143467 posted on 2021-5-10 13:56 Today's weather forecast humidity is 37%

Almost like mine

This post is from Domestic Chip Exchange

Comments

Which city is the boss in?  Details Published on 2021-5-10 17:21
 
 
 

1942

Posts

2

Resources
16
 

Which city is the boss in?

This post is from Domestic Chip Exchange

Comments

Last night in Dalian, I used sensory.box to measure 21.5 40%  Details Published on 2021-5-10 17:38
 
 
 

9702

Posts

24

Resources
17
 
w494143467 posted on 2021-5-10 17:21 Which city is the boss in

Last night in Dalian, I used sensory.box to measure 21.5 40%

This post is from Domestic Chip Exchange

Comments

The humidity in Dalian, haha, I've been there once, it was so humid, but as you go inland, the humidity drops.  Details Published on 2021-5-10 17:42
 
 
 

1942

Posts

2

Resources
18
 
littleshrimp posted on 2021-5-10 17:38 Last night in Dalian, I used sensorile.box to measure 21.5 40%

The humidity in Dalian, haha, I've been there once, it was so humid, but as you go inland, the humidity drops.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list