

物联网技术开创了一个智慧城市的新时代,从智能摄像头到部署各种传感器,以此对城市各种数据进行收集,并经云端AI技术处理后,有助于提高对交通和街道等城市公共管理能力;物联网的发展也为智能家居带来了新的玩法,智能机器人,智能冰箱,智能电视等相继推出,智能家居离我们越来越近。
下面带大家用Python通过HTTP协议做一个廉价的温湿度报警系统。

一、 实验器材

二、实验步骤

三、实验方法
1. LCD 5110显示屏说明


LCD5110 显示屏共有8个引脚,不同的板子可能标注的英文略有不同,具体参照如下:

2. DHT11温湿度说明
DHT11是一款有已校准数字信号输出的温湿度传感器。


DHT11温湿度共有3个引脚-VCC,DATA,GND。
四、接线方式
1. 针脚对应图


TPYBoard v102连接DHT11温湿度传感器

TPYBoard v102连接TPYBoard v202

2. 实物连接图

五、源代码
TPYBoard v102 源代码

main.py 如下:

TPYBoard v202 源代码
main.py 如下:

服务器源码
SensorData.php 文件内容如下:

SensorTest.php 文件内容如下:

六、效果图
1. 实物效果图

2. 网页效果图

我们可通过网络读取温湿度,也能由显示屏读取温湿度。
*声明:本文于网络整理,版权归原作者所有,如来源信息有误或侵犯权益,请联系我们删除或授权事宜。

觉得不错,点个“在看”然后转发出去