1. Introduction
With the development and popularization of social information technology, the level of automation in industrial process control is getting higher and higher, and various data collection methods for industrial sites are becoming more and more common. However, when upgrading some existing industrial sites, some difficulties have been found in data collection. For example, the data acquisition and control center may be too far away from the industrial site, or even in different areas, possibly distributed in several different cities or regions. Perhaps due to the old factory area, wiring in the old factory area may affect production, or it may be impossible to drill through walls or bury the data underground. In such cases, other methods must be used to collect data. Wireless is a commonly used method because wireless technology does not require secondary wiring, data collection points can be flexibly set, and multiple points can be collected. There are various forms of wireless data acquisition, such as wireless output technology, Zigbee technology, Bluetooth technology, infrared technology, etc. In this article, we introduce data acquisition technology based on GSM networks. Since GSM network coverage is now widespread throughout the country, with the help of GSM networks, specific industrial site data can be collected and monitored wherever there is a mobile phone signal, both domestically and globally. In this paper, temperature and humidity data in an industrial setting are collected. The temperature and humidity information is sent to the control terminal via a GSM module. Then, based on the temperature and humidity information, various switching quantities in the industrial setting are controlled to maintain the temperature and humidity within a stable range.
2. System Analysis and Requirements
(1) Requirements Analysis
First, the system needs to collect temperature and humidity information from the industrial site, and then control the GSM module to send the information. After the control terminal receives and processes the information, it also needs to receive control information from the control terminal and respond accordingly to the control information from the control terminal.
(2) System Design
Based on the above design concept, an intelligent control chip is first required. This paper chooses the commonly used 51 microcontroller system. When the complexity of industrial process control increases, ARM series control chips or DSP chips can be used in conjunction with an embedded operating system to complete the control of the entire process. After data acquisition is completed, it needs to be sent to the data terminal via a GSM module. Therefore, the entire acquisition system needs to consist of three parts: a temperature and humidity sensor, an intelligent control chip, and a communication module with the control terminal—the GSM module.
3. Component Description
Temperature acquisition sensor:
Because a 51 microcontroller is used as the control core, and given the inherent limitations of the 51 microcontroller, using analog sensors would inevitably increase the amount of peripheral circuitry. Furthermore, due to the severe interference in industrial environments, a digital temperature sensor, the DS18B20 ($2.0074), was chosen as the temperature acquisition probe. The DS18B20 uses a single-bus architecture, requiring only one data line for data acquisition, and allows for multi-point measurement on a single bus, meaning multiple temperature sensors can be connected to one bus. Moreover, in close-range applications, it can be powered via the data line, reducing cabling and simplifying wiring. It has a wide power supply range, compatible with 3.3V and 5.5V, and allows for the definition of temperature alarm messages. The sensor also has a wide temperature measurement range, from -55°C to +125°C, sufficient for typical industrial temperature acquisition, with an adjustable accuracy range from 0.5°C to 0.065°C. Similarly, the DHT11 was used as the humidity acquisition probe. Also a single-bus digital sensor, it is ideally suited for use in low-cost digital humidity acquisition systems.
In terms of GSM communication, the system uses the Q2406B as the communication module to enable communication between the control terminal and the 51 microcontroller in the field. The Q2406B is a high-performance GSM module manufactured by Wavecom in France. It has a built-in AT command system, which makes it easy to communicate with external devices through a serial interface to complete information exchange and the information receiving and sending tasks of the control module.
4. Hardware Schematic
4.1 Electrical Connection Diagram
The 51 microcontroller collects environmental data from the field via the data bus and temporarily stores it in the MCU. Then, it sends the data out via the GSM module, as shown in Figure 1.
4.2 Circuit Schematic The circuit schematic is shown in Figure 2.
As shown in Figure 2, the main control chip connects to four single-bus sensors via P1.0, P1.1, P1.2, and P1.3. These sensors can be either temperature or humidity sensors. Because the logic timing of the two types of devices differs, different code must be written to drive them during hardware programming. In this example, the definitions are shown in Table 1.
5. Software programming
5.1 Software Flowchart
Software programming involves driving various hardware pins based on the hardware circuitry to achieve specific functions. The software flowchart is shown in Figure 3.
As shown in Figure 3: After the system powers on, it first initializes and configures the 51 microcontroller itself, then enters the main system loop. It first checks if the timer has been reached. If not, it checks if a data acquisition command has been sent from the host computer data terminal. If neither of these conditions is met, the program continues to check if the timer has been reached. When the timer arrives, it first acquires data from the sensor through the acquisition port into the microcontroller. Then, it formats and combines the acquired data according to the communication protocol. After combining, it initializes the GSM module through the serial port. After confirming normal communication with the GSM module, it writes the data to the GSM module and then starts sending commands to transmit the information. If the control terminal issues a command requesting the acquisition module to collect data, the acquisition module will immediately start collecting data and upload it back to the control terminal through the GSM module.
5.2 Temperature Acquisition Process
The temperature acquisition flowchart is shown in Figure 4.
Before each temperature data acquisition, the sensor needs to be initialized. After initialization, wait for the sensor to complete initialization and generate an acknowledgment signal on the bus. Since only one sensor is connected to each port, skip the serial number writing step and directly send the temperature conversion command. Then, start receiving the converted temperature values. After receiving the values, exit the temperature reading program.
5.3 GSM Module Transmission Process (See Figure 5)
In this process, the microcontroller mainly communicates with the GSM module. After the data is collected from the temperature and humidity sensor, it is still raw data. It is necessary to sort and encode the collected data according to the communication protocol into a code sequence that the control terminal can recognize. Then, the encoded data is put into the transmission register, and then the microcontroller waits for the GSM module to be ready. After the GSM module is ready, the microcontroller sends the data to the GSM module. After the GSM module sends the data, it returns an acknowledgment signal, and the microcontroller can confirm that the transmission was successful.
6. Conclusion
This article mainly introduces how a microcontroller can transmit various real-time information from an industrial site wirelessly when wired data transmission is not possible, and how it can receive commands from the control terminal to the acquisition module and execute corresponding actions.