0 Preface
In industrial sites, the production environment is harsh and it is impossible to stay on site for a long time to collect temperature data. Limited transmission has the characteristics of difficult temperature detection and poor operability. In high-tech agricultural sites, when collecting temperature, wiring is difficult and complicated, and the cost is high. To solve the above difficulties, wireless methods are used. Commonly used wireless methods are 433 MHz small wireless, ZigBee, CDMA/GPRS, 3G, etc. Considering the cost-effectiveness and on-site conditions, this system uses JF24D?B to complete wireless transmission and reception. In order to collect temperatures at different heights, wireless network sensors can be placed at different heights. However, considering the cost and the power supply replacement of the sensor, a simple spiral helicopter is used to lift different heights to collect temperature.
By controlling the helicopter's ascent and descent to reach the measuring height, the temperature is measured and transmitted to the control unit for processing. After the measurement is completed, the helicopter returns to facilitate the maintenance of the wireless sensor.
1 Overall circuit design
In order to collect high-altitude temperature, a simple spiral helicopter is used, which is built with AT89C51 single-chip microcomputer and DS1820 digital chip, which can collect temperature at different altitudes in real time. And the information is sent to the ARM7 development board through the JF24D?B module. The ARM7 development board is used for data display and data processing, and the JF24D?B is used for data acquisition and command issuance to control the rise and fall of the helicopter. The data is processed through the μClinux system on the ARM development board, and the software is compiled and processed on RHEL 4.0 at the same time. This design selects C language instructions, Shell instructions and Python instructions commonly used in the industry. C language instructions are mainly used for driver programming of the single-chip microcomputer AT89C51; Shell instructions are mainly used for data processing on the ARM7 development board; Python instructions are mainly used for data image display. The reason for using these instructions is that they occupy small space, have fast execution speed and strong compatibility.
The overall system block diagram is shown in Figure 1.
2 Temperature acquisition wireless sensor module based on single chip microcomputer
2.1 Hardware Circuit Design
The hardware circuit is controlled by AT89C51 microcontroller. DS18B20 is used for temperature acquisition. JF24D?B[1] is used for sending and receiving of wireless modules. JF24D?B is a low-cost, small-size, high-performance full-duplex wireless communication module. Another wireless module is used to control the helicopter's takeoff and landing. In the temperature acquisition module, the microcontroller P1.0 pin is connected to the DQ of DS18B20 for collecting on-site temperature, and the P2 port is connected to the wireless module JF24D?B.
2.2 Software design of temperature acquisition system based on single chip microcomputer
First, the program is initialized to complete the initialization state setting of DS18B20 and JF24D?B wireless transmission module. Using timer interrupt, collect temperature every 10 seconds and enter the transmission mode.
The MCU sends a transmission command to the JF24D?B wireless transmission module, and LED2 flashes at the same time, and then enters the receiving mode. The MCU waits for the response signal from ARM7 for 20 ms. If the device receives the response, LED1 flashes. If the device does not receive the response, it sends the wireless module transmission command again.
The main program and interrupt program design block diagram are shown in Figure 2 and Figure 3.
3 Wireless receiving and control module based on ARM7
3.1 Introduction to ARM7
ARM7 is a member of the 32-bit general-purpose microprocessor ARM (Advanced RISC Machines) family. It has relatively low power consumption and good cost performance. Based on the (reduced instruction set) RISC structure, it has relatively high instruction processing capabilities and real-time interrupt response capabilities. Due to the application of pipeline technology, the ARM instruction set can continuously run all parts of the instruction processing and storage system, which improves the operating speed. The collected temperature data is sent to ARM7 for processing through the wireless transmission module, which improves the system data processing capability and facilitates the completion of the user-friendly interactive interface display. [page]
3.2 Signal analysis of JF24D?B wireless transmission module
Data transmission must follow certain protocols. The JF240?B wireless transmission module used in this design uses the Modbus protocol for data transmission and analysis. The Modbus protocol specifies the structure, command and response methods of messages and data. Data communication uses the MASTER/SLAVE method. The MASTER sends a data request message. After the SLAVE receives the correct message, it sends the data to the MASTER. It can also directly send a message to modify the data on the SLAVE end, realizing two-way reading and writing.
In order to associate the JF24D-B on the helicopter with the JF24D-B on the controller, it is necessary to map the nodes to Modbus devices and their registers, that is, to establish an address mapping table. The Modbus serial link PDU provides an address field, namely the Modbus address [2]. After the address mapping table is established, it is stored in the memory in the form of a linked list, and each node is defined as a corresponding structure type.
3.3 μClinux process scheduling
The next process to be executed is selected through the process scheduling strategy: first, all processes are detected and any process that receives a signal is awakened, that is, the state attribute of the process is changed; then the comprehensive priority of each process in the ready queue is calculated according to the time slice and priority scheduling mechanism, and the calculation method is implemented by the goodness() function; then the process with the highest comprehensive priority is selected as the process to be executed next. If there is no schedulable process in the ready queue, the time slice is reallocated, that is, the counter attribute value of the process is changed, and the switch_to() function is used to switch the process.
3.4 Socket processing of JF24D?B data in μClinux The point-to-point data communication is completed through JF24D?B, and a network communication mechanism will be established between the two points. Of course, this mechanism also requires the assistance of the Modbus protocol. Network socket data transmission is a special I/O, and socket is also a file descriptor. The socket() function returns an integer socket descriptor, and subsequent connection establishment, data transmission and other operations are all implemented through the socket. There are two commonly used socket types: one is a streaming socket: SCOK_STREAM; the other is a socket: SOCK_DGRAM. In this design, the SOCK_STREAM type is used for data connection transmission applications. The design flow chart of the socket in actual application is shown in Figure 4.
3.5 Python reads data and displays it
The data processed by the socket is stored in sqlite. Here, you need to operate sqlite, read the data, display the data, and draw a chart. In order to synchronize the data completely, you need to link Python with the sqlite database. The specific connection steps are as follows: find Pysqlite, which is the interface for Python to access sqlite. The website is http://initd.org/tracker/pysqlit. Choose Pysqlite 2.3 or 2.4 according to your own Python version. Write a program to display the chart. The current temperature and temperature charts at different heights displayed in ARM7 are shown in Figure 5 and Figure 6.
@56
4 Conclusion
The temperature acquisition system based on 51 single-chip microcomputer is simple, using JF24D?B wireless transmission module, whose protocol can share open source code, and solves the problem of co-frequency interference that 315 MHz and 433 MHz cannot solve. The controller uses ARM7 system, through wireless signal analysis and reception, process scheduling and data processing under μClinux, and completes the display of data charts through Python. The whole system has low cost, high reliability and strong readability, and effectively solves the problem of temperature acquisition control at different heights.
Previous article:Application design of elevator control system based on single chip microcomputer
Next article:Application Research of Infrared Remote Control System Based on AT89C51 and AT89C2051
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Does anyone have the Chinese operating instructions for the Agilent E4408B spectrum analyzer?
- 【IoT Graduation Project. Part 2】STM32+Gizwits AIoT+Laboratory Safety Monitoring System
- Is it necessary to pull up the data line and pull down the clock line in SWD mode for the burning port?
- MSP430 drives MCP4017 digital potentiometer driver debugging record
- [RVB2601-demo analysis and kernel analysis] YOC architecture + three-color indicator light
- dsp2812 ADC application experience
- The questions for this national competition were released at 7:30 this morning. What do you think?
- [Ateli Development Board AT32F421 Review] -TEST03 ADC Test
- The talented photographer photographed 150 countries in 10 years, capturing the ultimate beauty of Chinese ink painting and astonishing the world!
- Can a multi-turn potentiometer be used for direction detection?