当前位置:网站首页>[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system
[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system
2022-07-01 13:51:00 【gizwits_ csdn】
1 System content requirements
(1) Measure the temperature and humidity in the Laboratory 、 Smoke concentration 、 Propane concentration ;
(2) Check the water leakage on the ground , If there is water leakage, start the water pump to drain ;
(3) Detect door and window intrusion ;
(4) It has a variety of alarm modes ;
(5) mobile phone APP Remote control .
2 Component selection

3 System hardware design
3.1 Hardware component block diagram
3.1.1 The main control hardware is composed of
The main control circuit is shown in the figure 3.1 Shown , It consists of the following parts : With STM32 As a processing center , Smoke sensor measures smoke concentration , Propane sensor measures propane concentration , The temperature and humidity sensor measures the temperature in the air 、 humidity , The Bluetooth host receives the data sent by the auxiliary control , Fan 1 circuit 、 Fan 2 circuit 、 The audible and visual alarm circuit triggers when the conditions are met ,4G The module transmits the measured data to the cloud server , Receive mobile phones at the same time APP Downlink command of .
chart 3.1 Main control hardware composition
3.1.2 The auxiliary control hardware is composed of
The auxiliary control circuit is shown in the figure 3.2 Shown , It consists of the following parts : With STM32 As a processing center , The water immersion sensor detects whether there is water leakage on the ground , The human body sensor senses whether someone has passed , The Bluetooth slave sends the information collected by the auxiliary control to the master , Audible and visual alarm circuit 、 The water pump circuit triggers when the conditions are met .
chart 3.2 Composition of auxiliary control hardware
3.2 Human body sensor
Choose human body sensor HCSR505 To sense whether someone has passed , So as to judge the intrusion of doors and windows [2]. The sensor is based on infrared , When someone moves within the sensing angle , It will output high level , The delay time is 8 second , Otherwise, it is low level . As shown in the table 3.1 You can know some parameters of human body sensor , Its working state can also be selected , Suitable for different occasions .
surface 3.1 HCSR505 Product parameter table
As shown in the table 3.2 Shown , You know you should give VCC Pick up 5V Voltage supply , then GND Grounding is common ,OUT The pin is connected to the pin of MCU , The wiring circuit is shown in the figure 3.3 Shown . When someone moves within the sensing range , It will change the detection distance of the infrared spectrum , The signal pin outputs a high level , Conversely, low level . By reading the pin status of the connected MCU , You can know if anyone has passed , So we can know the invasion of the doors and windows of the Laboratory .
chart 3.3 HCSR505 Wiring diagram
3.3 Electrode type water immersion probe
Select a water immersion probe to detect whether there is water leakage on the key ground , The electrode type water immersion probe is used , The probe is contact , It means that it can sense only when it is in contact with water . As shown in the table 3.3 Shown , The working state and material of electrode type water immersion probe can be understood .
surface 3.3 Product parameters of water immersion sensor
chart 3.4 Wiring diagram of water immersion sensor
From the figure 3.4 It can be seen that , Working principle of water immersion sensor , When the probe of the water immersion sensor detects water , The signal passes through the conversion circuit , The voltage of the collector of the triode is low , If there is no water, the output is high . Connect the output end to the pin of the MCU , By reading the status of this pin , Then you can know whether there is water leakage on the ground , If water leaks, turn on the water pump , Do not open if there is no .
3.4 Bluetooth wireless module
Select Bluetooth module HC05 To communicate with the main control and auxiliary control , Connect via Bluetooth , You can send data to each other , Data transmission [12]. The working state and working principle of Bluetooth module can be found through parameter setting , The basic parameters are shown in table 3.4 Shown .
surface 3.4 Bluetooth module HC05 Parameter description of
chart 3.5 HC05 Wiring diagram
By the table 3.5 You can know the Bluetooth module HC05 The wiring method of the system . For the moment , The connection between Bluetooth and MCU only needs to be connected 4 Line ,VCC Connect 5V,GND Grounding , The receiving end of Bluetooth is connected to the serial port of MCU 1 The sender of , The sending end is connected to the serial port of the MCU 1 The receiving end of , Pictured 3.5 Shown .
3.5 Audible and visual alarm circuit
utilize NPN Type a crystal triode S9012 As the core of control , When the single chip microcomputer gives instructions to low level 0V when , The emitter of the triode E by 5V, The base B by 0V, The condition of triode conduction is the base B And the emitter E The voltage difference between them exceeds 0.7V that will do , So give 0V Low level meets this condition , Triode conduction , The LED meets the conduction conditions and lights up . After the triode is turned on , The voltage difference between the positive and negative poles of the buzzer is about enough , Meet the voltage difference required for operation 3V, Sound the alarm . If the single chip microcomputer gives a high level , It doesn't meet the condition of triode conduction , The LED doesn't work , There is no voltage difference between the positive and negative poles of the buzzer and they are mute . The audible and visual alarm circuit is shown in the figure 3.6 Shown .
3.6 Relay circuit
The type of relay used is SRD-05V-DC-SL-C, It has 5 One pin : Input pin 1、 Input pin 2、 Public end 3、 The constant beginning 4、 Normally closed end 5.1、2 Pin connection control voltage 5V, When the MCU gives a high level 3.3V When , Triode base B And the emitter E Meet the conduction voltage 0.7V, The LED meets the conduction conditions and emits light . The constant beginning 4 And public end 3 Conduction , The positive pole of the fan is connected to the constant start of the relay 4, Connect to the breadboard , At the beginning 4 And public end 3 After conduction , There is enough voltage to drive the fan , Otherwise, the normally closed end 5 And public end 3 Conduction , The fan does not have enough voltage to drive . diode IN4148 The function of is at the moment when the MCU gives high-level instructions , Avoid burning the triode due to the sudden increase of voltage . The relay circuit is shown in the figure 3.7 Shown .
chart 3.7 Relay circuit
3.7 Indicator circuit
For the laboratory safety monitoring system , Indicator circuit is indispensable , Pictured 3.8 Shown . When the MCU gives a high level , The LED turns on ; When giving low level , The LED is not conductive [5]. The high and low levels given by the single chip microcomputer are determined by the measured data . And the LED can't bear it directly 3.3V The voltage of , Therefore, resistance is needed to divide the voltage .
3.8 Gas sensor
Many people know that most metals have electrical conductivity , And the gas sensor uses this principle to measure the gas concentration , Different sensors have different conductivity for different gases [7]. such as MQ2 Smoke sensors are sensitive to the concentration of smoke in the air , Therefore, it is suitable for measuring smoke concentration .
chart 3.9 MQ2 Wiring diagram
By the table 3.7 You know , It is necessary to read the gas concentration in the Laboratory , Therefore, the analog signal output pin needs to be connected AO, And then through the internal AD Convert it into numbers and display it [9],GND Grounding ,VCC Connect 5V Power it [1], Pictured 3.9 Shown , Make it work . And another gas sensor MQ6 How it works 、 The same is true of the wiring diagram .
3.9 Temperature and humidity sensor
The pin description is shown in table 3.8 Shown , So just connect the positive and negative poles , Then connect the analog output pin . The wiring circuit is shown in the figure 3.10 Shown .
chart 3.10 DHT11 Circuit diagram
3.10 Power access circuit
For all products , Power supply is essential . Therefore, we need to connect the power supply with stable voltage , Pictured 3.11 Shown , It can be seen that the connected power base is P2, Can pass USB Power transfer DC The DC data line is directly connected to the usual household power supply , Supply the system with 5V electric . When 6 Foot self-locking switch SW1 When pressed , Pin 2、3 Conduction , The connected power supply can drive the laboratory safety monitoring system .
chart 3.11 Power access circuit
3.11 4G Module access circuit
about 4G The module says , It uses Cat module ML302 At the core , The supported frequency bands are LTE-TDD B34/B38/BB39/B40/B41、LTE-FDD B1/B3/B5/B8, Its average power consumption is 1W. It regularly sends data to the monitoring platform , Real-time monitoring [11]. The pin description is shown in table 3.9 Shown .
therefore , take 4G The module is connected to STM32 Minimum system board , take TXD、RXD Connect to the serial port 3 Reception 、 Send pin ,GND Connected to the SCM GND. At the same time, connect the positive pole of the lithium battery 4G Modular VCC, Power it , The negative pole is connected to the single chip microcomputer GND, Its wiring is shown in the figure 3.12 Shown .
chart 3.12 4G Module access circuit
The next chapter contains the following :
4 System software design
4.1 SCM programming
4.1.1 SCM program development environment
4.2 mobile phone APP Programming
4.2.1 Timer timing program
5 mobile phone APP The design of the
5.1 Wit cloud AIoT The access process of
边栏推荐
- ArrayList capacity expansion mechanism and thread safety
- 机器学习总结(一):线性回归、岭回归、Lasso回归
- 学会使用LiveData和ViewModel,我相信会让你在写业务时变得轻松
- The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise
- [Jianzhi offer] 54 The k-th node of binary search tree
- [241. Design priority for operation expression]
- 运行游戏时出现0xc000007b错误的解决方法[通俗易懂]
- 1. Sum of two numbers: given an integer array num and an integer target value, please find the two integers whose sum is the target value target in the array and return their array subscripts
- 04 redis source code data structure dictionary
- Qtdeisgner, pyuic detailed use tutorial interface and function logic separation (nanny teaching)
猜你喜欢

Animesr: learnable degradation operator and new real world animation VSR dataset

B站被骂上了热搜。。

日志中打印统计信息的方案

Spark source code (V) how does dagscheduler taskscheduler cooperate with submitting tasks, and what is the corresponding relationship between application, job, stage, taskset, and task?

2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle

TexStudio使用教程

队列的基本操作(C语言实现)

使用 Lambda 函数URL + CloudFront 实现S3镜像回源

洞态在某互联⽹⾦融科技企业的最佳落地实践

French Data Protection Agency: using Google Analytics or violating gdpr
随机推荐
建立自己的网站(21)
Machine learning summary (I): linear regression, ridge regression, Lasso regression
1.8新特性-List
Arthas use
队列的基本操作(C语言实现)
C语言订餐管理系统
Collation and review of knowledge points of Microcomputer Principle and interface technology - pure manual
使用net core 6 c# 的 NPOI 包,读取excel..xlsx单元格内的图片,并存储到指定服务器
二传感器尺寸「建议收藏」
2. Sensor size "recommended collection"
Blind box NFT digital collection platform system development (build source code)
【剑指 Offer】55 - II. 平衡二叉树
How much money do novices prepare to play futures? Is agricultural products OK?
基于算力驱动、数据与功能协同的分布式动态(协同)渲染/功能运行时
【Flask】Flask启程与实现一个基于Flask的最小应用程序
leetcode622.设计循环队列(C语言)
玩转gRPC—不同编程语言间通信
French Data Protection Agency: using Google Analytics or violating gdpr
spark源码(五)DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?
2022. Let me take you from getting started to mastering jetpack architecture components - lifecycle