In order to meet the requirements of a module that can realize the short message sending and receiving and data wireless transmission, this paper uses STM32, the mainstream product of arm Cortex-M3 kernel, as the main control chip, and sim900a of simcom company as the communication chip. After consulting a large number of relevant literature and related chip data manual, this paper designs a remote wireless communication module. After a week of trial operation in the laboratory, the module did not drop the line, and the speed of data sending and receiving was very fast. The module has the advantages of stable performance, small size and high cost performance. After the factory put into use, the reaction was good.
Overall design scheme of wireless communication module
The module consists of four parts: power supply, main control, communication and data transmission. The communication module uses sim900a for wireless communication. The main control module uses STM32 as the main control chip to control the sending and receiving of short messages and the smooth progress of data transmission. The remote terminal can be the data center software of the mobile phone or the host computer. After processing, it can be saved to facilitate future query. The module has the advantages of low power consumption, convenient and flexible, simple and stable operation, automatic connection after off-line, stable operation process and low cost.
Design of power supply circuit
In the main circuit, the working voltage of STM32 is 2.0 ~ 3.6 V, and that of sim900a is 3.1 ~ 4.6 v. in order to make each part of the module work normally, they must be powered separately. The power supply circuit is as follows:
In the figure, V12 is connected with an external 12 V power supply, which is input to lm2576 after capacitive filtering to realize the conversion from 12 V to 4 v. R1 and R2 play the role of voltage divider in the line. When D2 light is on, it indicates that the module has normal power supply. Lm2576 is a 3 a current output step-down switch type integrated voltage regulator produced by national semiconductor company of the United States. It has perfect protection circuit and is relatively stable.
Figure 2 power supply module
Circuit design of main control chip
The main control module uses STM32 microcontroller as the microcontroller, which can work in the temperature range of – 40 ~ 105 ℃. MAX3232 chip is used for the level conversion of the serial port to realize the communication between the controller and the communication interface. Serial port 1 is connected with power level conversion chip max3223, usart1_ So when configuring GPIO, the mode of the port is defined as push-pull output, usart1_ Rx is input, defined as suspended input mode. Serial port 2 communicates with sn65lbc184d to send and receive data, usart2_ RTS、USART2_ Rx is the input port, the mode is defined as floating input mode, usart2_ CTS、USART2_ TX is the output port, and the mode is defined as push-pull output. Serial port 3 is used to control sim900a chip, usart3_ RTS、 USART3_ Rx is the input port, the mode is defined as floating input, usart3_ CTS、USART3_ TX is the output port, and the mode is defined as push-pull output.
Figure 3 main control chip stm32
Circuit design of communication chip
The communication chip adopts sim900a, a new compact product of simcom company. It belongs to dual band GSM / GPRS module. It is completely SMT packaged, with stable performance, exquisite appearance, high cost performance, and can meet various needs of users. The use of DCD and RI pins is involved in the realization of automatic reconnection function. The DCD pin is used to realize analog-to-digital conversion. When the module is disconnected, it will give a high level to the DCD pin. When this level is detected by the DCD pin, the module will take the corresponding action to re connect to the line. The RI pin keeps high level after the module goes online. When there is a phone or SMS coming in, a low level will appear on the RI pin. When the RI pin detects the low level, the module will take corresponding actions and enter the SMS or phone mode.
Figure 4 sim900a communication chip
The wireless communication module designed in this paper uses STM32 to control sim900a chip to realize the short message sending and receiving and data wireless transmission. This design completes the design and implementation of hardware and software of wireless communication. In many running tests, the module has no problems such as off-line and heating, so it is very stable. This design has the advantages of low cost, stable and reliable operation, and wide range of applications. Sim900a can reduce the cost of the module and make it more commercial.