Full text

1 QingDao HuangHai College, QingDao 266427, China

2 Al-Rashed Holdings Power Transmission & Distribution, Kuwait

Abstract: Abstract: A remote temperature control box with STM32 MCU as the system control processor is designed. The temperature A remote temperature control box with STM32 MCU as the system control processor is designed. The temperature and humidity value is uploaded to the cloud platform in real time and has the function of exceeding the limit alarm to realize the remote and humidity value is uploaded to the cloud platform in real time and has the function of exceeding the limit alarm to realize the remote temperature and humidity monitoring in the industry and agriculture. In this paper, the development status of remote temperature temperature and humidity monitoring in the industry and agriculture. In this paper, the development status of remote temperature control box technology at home and abroad is introduced. Secondly, the overall design scheme of remote temperature control box is control box technology at home and abroad is introduced. Secondly, the overall design scheme of remote temperature control box is formulated. At last, the hardware design and software design are expounded. SIM800 is used to communicate with the cloud platform formulated. At last, the hardware design and software design are expounded. SIM800 is used to communicate with the cloud platform and monitor the cloud platform through the real-time upload of temperature and humidity data. In addition, various technical and monitor the cloud platform through the real-time upload of temperature and humidity data. In addition, various technical requirements have been completed through physical design, production and commissioning.requirements have been completed through physical design, production and commissioning.

Keywords: Keywords: Temperature control boxl; single chip microcomputer; cloud platforTemperature control boxl; single chip microcomputer; cloud platfor Received 24 August 2020, Revised 12 September 2020, Accepted 1 December 2020Received 24 August 2020, Revised 12 September 2020, Accepted 1 December 2020

1.Introduction

Temperature in thermal parameters plays a key role in industrial and agricultural temperature control. Whether in agriculture, production, machinery and many other fields, temperature inspection and control are closely related [Zhou, et. al., 2017, (18): 195.]. Therefore, wheth er it is a part of a large system or a small self-sufficient system, temperature control is an indispensable special link in production and practical operation.

Temperature control has been widely used in various fields in China, but from the point of view of production controllers and developed systems, most of the products are only suitable for single product temperature prob lem. For a certain field, the products of temperature control system are reduced, but not universalized.。

2.System Structure Design

2.1 Functional Overview

The purpose of this paper is to design a remote temperature control box based on STM32 single chip computer. The main work flow is to use temperature sensor to detect temperature in real time and upload the measured data to the single chip computer in real time.

According to the comparison between the monitoring data and the set temperature value, the refrigeratory is controlled intelligently.

2.2 System Design

The system is mainly composed of temperature sensor, humidity sensor, STM32 single-chip minimal system, SIM800C module, power supply design circuit, step-down design circuit and relay design circuit. As the main control system of this design, the minimal system of single chip computer controls the display module and the detection module, and the connection between each module is also realized by the minimal system. The display module mainly provides effective temperature and humidity information for users to use and observe. The monitoring module mainly monitors the temperature and humidity of the surrounding environment. Over-limit alarm decides whether it can warn users accurately and timely. It must let users know clearly and accurately whether the current temperature has exceeded the safe temperature limit.

The idea of this design is to use single-chip computer as the core, build each sub-module around it, and control the normal work of the other sub-modules through single-chip computer. The system block diagram is shown in Figure 1. Figure 1 System block diagram

2.3 Scheme Demonstration

This design chooses MCU of STM32 series under the framework of ARM Cortex-M3 as the core, and chooses STM32F103C as the intentional semiconductor. The clock frequency reaches 72MHz, which is the highest performance product in the same kind of products [Wu, et. al., 2010, 10:2196-2198+2269.]. The core is responsible for the functions of data transfer, data operation, data transfer and coordination of peripherals.

Therefore, the design of the whole system will focus on the use of STM. The minimum system and on-chip programming of 32F103C control each module to work normally [He Jin, et. al., 2017.]. DS18B20 temperature sensor is selected as the sensor in this design. DS18B20 is a single bus digital temperature sensor. The temperature range ranges from negative 55 degrees to positive 125 degrees [Chen Yong, et. al., 2016, 24 (02): 77-79.]. Voltage range: 3.0-5.5V.

It can be supplied by data line under parasitic power supply mode, and its accuracy is (+0.5%) at - 10 ~+85 C. When DHT11 is tested, temperature and humidity are detected simultaneously, which facilitates the selection of devices and the compilation of programs.

However, there is an error due to the influence of external environmental factors [17]. These sensors have their own advantages. Due to the influence of external environmental factors, the device needs to be protected. Therefore, DS18B20 can be used as a temperature sensor [18] because of its waterproof, data reading and data writing characteristics.

DHT11 is chosen as the humidity sensor in this design. It is an integrated digital sensor for temperature and humidity monitoring. However, this design only uses its function for humidity detection and mainly applies to monitoring and feedback [19]. DHT11 requires a voltage between 3V and 5.5V. After poweron, it needs to wait for 1s to complete initialization, and start to detect data after stabilization. A capacitor is added between the power supply and the ground for decoupling filtering to ensure its reliability and stability [20].

Display module: digital tube display, because the light-emitting diode is the basic unit of the digital tube, according to the configuration of each light-emitting diode, it can adjust the brightness and extinction of the diode, but it can only show the parameters that can be expressed by the number, such as time, date, temperature, etc. It can not display letters. There are still some limitations in function [21] 。 Communication module: 800C module, the way of wireless transmission, its series of communication modules can meet various requirements, cost-effective, and through GPRS transmission of data, no distance limitations and other drawbacks.

3.Hardware Design of Remote Temperature

Control Box Fig. 2 is the schematic diagram of STM32 series. When the control module is connected with other modules, it needs power supply, temperature sensor, humidity sensor, I/O, etc. Its IO port fully meets the requirements of the microcontroller in the previous section. Therefore, STM32F103C is selected as the microcontroller part of this design. The supply current of STM32F103 chip in shutdown mode and standby mode is level mu A, while that in dormant mode is level mA.

Figre 2 The schematic diagram of STM32 chip STM32 supports peripherals: (1) Rich IO port resources are used to connect digital tube, display module and detection module. (2) The level standard is TTL5V or TTL3.3V. (3) Its minimal system is perfect, including reset circuit, clock circuit, stable power supply and memory.

The minimal system circuit of microcontroller consists of controller, clock and reset circuit. In this design, 8 MHZ and 32.768 KHz external crystal oscillators are selected as the clock circuit, 8 MHz crystal oscillators are used as high-speed clocks, 32.768 KHz crystal oscillators are used as low-speed clocks.

The communication module of this design is SIM800C module, SIM800C module is connected with MCU, and MCU sends AT instructions to communication module. After initialization, the communication module needs to send connection requests to wireless network relying on program and self-defined communication protocol, and then complete the connection between monitoring system and network server through specific instructions, and collect subnetwork access points through connected serial ports.

Data. By receiving the data collected by each sensor, the data is uploaded to the cloud platform with TCPIP protocol. (1) The module is connected with the power supply automatically to connect the network. It does not need buttons to control the start-up, and the power is started directly. It saves the troublesome start-up process and reserves the start-up pins, so that users can control the

switch by themselves. (2) GPRS used to use dial-up Internet access, but now it uses packet switching technology. (3) It is fast in use, keeps on-line forever, is dormant without data transmission, and only needs data flow to support billing. Figure 3 shows the schematic diagram of SIM800C chip. Because RXD and TXD ports are data receiving and data sending ports, RXD ports are I ports and TXD ports are O ports, RXD and TXD ports of SIM800C are connected with IO ports of A2 and A3 microcontrollers, and GND ports are grounded and 5V voltage communicated with UCC-IN ports respectively. MCU control communication module, SIM800C transmits data by GPRS through TCPIP protocol, uploads cloud platform, monitors the changes of temperature and humidity in real time, grasps the actual situation at any time, and realizes communication design.

Fig. 3 Communication schematic diagram This design relay uses the relay design circuit as shown in Figure 4. VCC provides 5V voltage and NPN triode is used. It has the characteristics of high level conduction and collector conduction to emitter. The single chip computer inputs 3.3V voltage to the base of triode to realize circuit conduction. Because the relay can realize high level and low level triggering, it can meet the requirements of each module. And when the relay is driven at low level and reset, the load is not working and the safety is high.

Fig.4 Relay Design Connection Circuit Diagram Connect the relay with 5V voltage, NPN triode, emitter of triode grounding connection, resistance at both ends, power on and control. The relay is connected with triode and resistance. Because the relay needs to close the control fan, the triode is needed to turn on the circuit. The voltage amplification current conduction circuit of the triode is supplied by STM32, which realizes the relay of 5V DC control 220V AC. The design and control are completed.

The requirement of power supply is very strict. The quality of power supply decides the success or failure of the system and its stability. When the required voltage of the system does not match the voltage of the power supply, it will cause great problems, and the loss caused by it is totally inestimable.

The power supply for the core system consisting of STM32 microcontroller is as follows: (1) The working power supply of STM32F103C controller: +5V, +3.3V; (2) Serial module power supply: +3.3V; Fig5 Power supply circuit diagram Power supply realization method: In order to facilitate installation, adjustment and safety of the whole system, the system uses battery power supply, but the demand of module power supply level is different, so the level conversion is needed. The 5V voltage of the system is obtained by step-down module, and the + 5V voltage is obtained by step-down LM2596S DC-DC. LM2596S DC-DC is a low-cost, high-benefit step-down module with large input voltage range, stable output voltage and current, and moderate power, which can meet the power requirements of the design.

Usually, the output current and power of the stepdown module are 2A and 15W respectively. When the output current and power of the step-down module are large, the radiator is needed to maintain its work and operation. This design requires a 12V step-down to 5V module with input and output terminals respectively.

The positive input and output are 5V voltage, and the negative input and output are GND grounded. Because the minimum system of STM32 microcontroller has a step-down chip, it is necessary

to reduce the voltage from 12V to 5V to supply the minimum system of STM32 microcontroller, and then from the internal step-down chip to 3.3V. The 12V battery power supply is connected with the step-down module. The positive output voltage is 5V, and the negative output is grounded. The voltage required by each module is provided to realize the design.

As shown in Figure 6, TM1638 chip has drive and control circuit, digital display, level conversion latch, LED display circuit and so on. And its own keyboard, mainly used in many electronic products and other products display screen. Fig6 Circuit Diagram of Digital Tube As shown in Figure 7, because the STB, CLK and DIO ports of TM1638 need to be connected with SCM, STB, CLK and DIO are connected with SCM A0, A1 and A4 ports respectively, and UCC is connected with 5V power supply and GND. The display of temperature and humidity is controlled by MCU, and the display design is completed.

Fig7 shows the circuit diagram. The temperature acquisition circuit of this design adopts DS18B20 integrated digital temperature sensor, DS18B20 adopts single-bus protocol communication, read and write data simultaneously, and has self-fixed port connection, so DS18B20 pin is connected with single chip B11, UCC is connected with 5V power supply, GND is grounded. Temperature sensor is controlled by single-chip computer, so temperature detection design can be realized in real time.

Fig. 8TemperatureDetection Circuit Diagram This design uses a digital sensor DHT11 which integrates temperature and humidity, so it is only used here to detect humidity. The voltage required for DHT11 is from 3V to 5.5V. After power-on, it needs to wait for 1s to reach stability and initialization success, send instructions, and add a capacitor between power supply and grounding to decouple filter, so its UCC port is connected with 5V voltage, GND grounding, and DAT port is connected with IO port B12 of MCU (where the port can be selected by itself) to realize humidity detection design.

Fig. 9 Circuit Diagram of Humidity Detection

4.Software Design

The system software is mainly divided into main program design and temperature detection subroutine design. The main program design is mainly embodied in the connection with each subroutine. Start the temperature detection subroutine. The subroutine design mainly includes temperature detection subroutine. Only

the relatively important subroutine is mentioned here. As shown in Figure10, after the remote temperature control box is connected to the power supply, the MCU sends instructions to the temperature and humidity sensor to initialize. After the initialization is successful, the temperature and humidity sensors begin to sense the temperature and humidity of the external environment, and feed the measured data back to the MCU in time.

The MCU uploads the cloud platform in real time through SIM800C, monitors the situation in real time through the PC or mobile terminal, and the measured number. According to the automatic comparison with the temperature rating set by the system, when it does not exceed the rated value, it works normally and steadily.

When it exceeds the rated value, the refrigerator starts to run and lowers the temperature. Fig 10 Temperature and Humidity Detection Flow Chart The whole flow chart is shown in Figure 11. Connect the power supply, the microcontroller starts to work, and the temperature and humidity sensor of the temperature control box is initialized. After the initialization is successful, the temperature and humidity sensor monitors the external temperature and humidity, and the measured data is monitored by SIM800C real-time uploading cloud platform. When the temperature and humidity are less than the rated temperature set by the system, the normal receiving data information is monitored. When the external temperature is higher than the rated temperature set by the system, the MCU receives the data and sends instructions. Through SIM800C data transmission, the message is uploaded to the cloud platform and the alarm information is sent to the PC or mobile terminal.

At the same time, the relay sucks in, and the fan starts to run to lower the temperature, waiting for recovery.

The monitoring platform can be used by PC and mobile terminals. PC can monitor real-time on the official network of TLINK Internet of Things Cloud Platform. Mobile terminals can monitor public number. The TLINK’ When the temperature exceeds the upper limit, both PC and mobile terminals can receive alarm information.

Fig11 Overall flow chart Through TLINK Internet of Things free registration to create their own cloud platform storage space, and can set triggers, when the measured data is higher or lower than a certain set value alarm, remind users. Connecting with TLINK cloud platform, communicating through TCP interface, and connecting with its associated public number through its own definition of TCP protocol, it can watch the temperature and humidity situation through the platform in real time.

Modify the corresponding port number and serial number in the program to achieve a successful connection with the cloud platform. Figure 12 Port and Sequence Number Diagram

Figures

Article figure
Article figure
Article figure
Article figure