0 Introduction
The ultimate goal of establishing a greenhouse monitoring system is to obtain data information about the greenhouse environment, monitor the normal operation of the greenhouse, and obtain the laws of crop growth and environmental changes by analyzing the data. Traditional multi-point environmental parameter monitoring systems generally transmit environmental parameter data to the monitoring center through wired communication (such as RS-485 bus). An unavoidable problem of wired communication is the need for wiring, which greatly increases the complexity of system design, installation and maintenance, and also greatly increases the cost of the system. If a node is damaged, it may cause the entire communication network to be paralyzed. Due to the large area of the greenhouse, the traditional wired monitoring system requires the support of power supply lines in addition to the physical line connection between communication equipment. After adopting wireless technology, the system simplifies the laying of communication and power supply lines, facilitates the maintenance and expansion of the system, and is of great significance to improving the production management level of the greenhouse. For this design, the use of wireless communication technology can effectively solve the problems existing in wired communication, and has the advantages of lower cost, no need for wiring, arbitrary increase or decrease of measurement nodes, and convenient maintenance.
1 System composition and working process
The wireless greenhouse monitoring system consists of three layers: wireless measurement nodes and actuator nodes, aggregation nodes, and background management systems, as shown in Figure 1. The measurement nodes collect data and forward the data to the background management system through the aggregation nodes. The measurement nodes are implemented by the 51-compatible RF SoC chip nRF9E5; the actuator nodes are composed of the microcontroller LMS3S1968 based on ARM®CortexTM-M3 and the wireless transceiver nRF905; the aggregation nodes are composed of the ARM9 with stronger processing power and the wireless transceiver nRF905.
In the greenhouse, a large number of measurement nodes are placed in the greenhouse in a dispersed manner, responsible for collecting environmental information in the monitoring area and sending data to the aggregation node through multi-hop transmission; the aggregation node is responsible for collecting and uploading data, sending control commands to each node in the system, and communicating with the background management system through the Internet network. The background management system controls the environmental parameters of the greenhouse and the management of sensor nodes. The nodes in each greenhouse are independent of each other, and the failure of a node in a greenhouse will not affect the normal operation of other nodes.
Figure 1 Composition of wireless greenhouse monitoring system
2. Introduction of main components
2.1 LM3S1968 microcontroller based on ARM Cortex-M3
LM3S1968 is a microcontroller based on ARM®Cortex™-M3 and Stellaris® series produced by Texas Instruments. The Stellaris® series chip can provide efficient performance, extensive integrated functions and selection according to requirements, suitable for various cost-conscious applications with clear requirements for process control and connectivity.
The LM3S1968 microcontroller is designed for industrial applications, including remote monitoring, electronic vending machines, test and measurement equipment, network equipment and switches, factory automation, HVAC and building control, gaming equipment, motion control, medical equipment, and fire alarm security. Its main features include 32-bit RISC performance, Thumb-2 instruction set compatible with Thumb® for higher code density, up to 256KB of single-cycle Flash and 64KB of single-cycle SRAM, 4 general-purpose timer modules, 2 SSI modules, 2 I2C modules, 8-channel 10-bit A/D conversion with a sampling rate of 1000000 times/second, 3 independent integrated analog comparators, 3 PWM generator modules, 2 QEI modules, up to 52 GPIOs, on-chip low-dropout regulators, etc.
2.2 Wireless transceiver chip nRF905
nRF905 is a product of Nordic Company in Norway. It is a true single-chip wireless RF transceiver that works in the ISM band of 433/868/915MHz. It consists of a frequency synthesizer, a power synthesizer, a crystal oscillator and a modulator. It has few peripheral components and does not require an external surface acoustic wave oscillator. The antenna can use a PBC loop antenna or a single-ended whip antenna. The maximum transmission power is 10dBm and the receiving sensitivity is -100dBm.
nRF905 uses Nordic's VLSI ShockBurst technology. ShockBurst technology enables nRF905 to provide high-speed data transmission without the need for expensive high-speed MCUs for data processing/clock coverage. By placing high-speed signal processing related to the RF protocol on the chip, nRF905 provides an SPI interface to the application's microcontroller, with the rate determined by the interface speed set by the microcontroller itself. In ShockBurst RX mode, the address match (AM) and data ready (DR) signals notify the MCU that a valid address and data packet have been received respectively. In ShockBurst TX mode, nRF905 automatically generates a preamble and CRC checksum, and the data ready (DR) signal notifies the MCU that the data transmission has been completed. In short, this means reducing the memory requirements of the MCU, which means reducing the cost of the MCU, while shortening the software development time.
nRF905 has two active (RX/TX) modes and two power saving modes. The active modes are ShockBurst RX and ShockBurst TX. The power saving modes are Power-down and SPI programming, Standby and SPI programming. The nRF90 working mode is set by the settings of TRX_CE, TX_EN, and PWR_UP, as shown in Table 1.
3 Wireless actuator node structure and design
The control of greenhouse environmental parameters is done by the background management system sending control commands to the aggregation node through the Internet, and then the aggregation node transmits the commands to the wireless actuator node through multi-hop transmission. The wireless actuator node controls the corresponding control object according to the control command. The wireless actuator node mainly includes LM3S1968 microcontroller, light intensity control, ventilation control, temperature control, sprinkler control, CO2 concentration control, fertilization control and nRF905 wireless transceiver modules, as shown in Figure 2. [page]
Figure 2 Actuator node structure
Figure 3 LM3S1968 and nRF905 circuit
3.1 Circuit Design of LM3S1968 and nRF905
LM3S1968 provides two SSI interfaces compatible with SPI, so one of the SSI interfaces in LM3S1968 can be set to SPI interface form, so as to facilitate data transmission with nRF905. In addition to connecting the SPI interface with LM3S1968, nRF905 also has some pins that need to be connected with LM3S1968. These pins are: TX_EN pin for TX and RX mode selection, TRX_CE pin for enabling chip transmission or reception, PWR_UP pin for chip power-on, uPCLK pin for output clock divided by crystal oscillator, CD pin for carrier detection, AM pin for address matching, DR pin for receiving or transmitting data completion, which are connected to LM3S1968 pins PE3, PE2, PE1, PE0, PF5, PF7 and PG6 respectively, as shown in Figure 3. Before nF905 works, LM3S1968 sends a high level signal through pin PE1 to power on nF905, and then sends TRX_CE and TX_EN signals through PE2 and PE3 to determine the working mode of nF905. LM3S1968 receives the status signal of nF905 through PF5, PF7 and PG6, so that LM3S1968 determines the subsequent work.
3.2 Software Design
(1) μC/OS-II embedded real-time operating system
With the widespread application of wireless sensor networks, the changes in node composition are huge. Therefore, the embedded operating system on the wireless sensor network node must have good portability. Compared with general operating systems, embedded operating systems have the following characteristics: compact, real-time, customizable, fixed code, and stable. There are different embedded operating systems for different processor types, memory capacities, and real-time requirements. UCB has developed a micro operating system TinyOS for the Mica series of sensor network products; Tsinghua University has also developed a flexible and low-cost wireless sensor network node FLOWS, which uses TI's MSP430 microcontroller, ported with the uC/OS-II operating system, and uses NRF905 as the wireless transmission chip.
μC/OS-II is a simple, efficient, open-source embedded real-time operating system kernel. The execution time of most of its function calls and services is deterministic; it has a preemptive real-time multitasking scheduling system function, and provides system services for synchronization, mutual exclusion, and communication between tasks. These functions can be tailored according to different needs. Its minimized kernel can be compiled to 2 KB and has been ported to many architectures such as x86, ARM, PowerPC, and MIPS. Based on its compactness and strong portability, μC/OS-II is very suitable for wireless sensor network node chips. Compared with TinyOS, uC/OS-II provides a more complete task scheduling and task communication mechanism, and is designed in standard C language, which makes porting and debugging more convenient.
(2) Porting μC/OS-II to LM3S1968
The LM3S1968 has up to 256KB of single-cycle Flash and 64KB of single-cycle SRAM on-chip, so there is no need for external memory expansion to meet the capacity requirements of μC/OS-II code.
The porting of μC/OS-II on LM3S1968 consists of five layers: user layer, middleware layer, μC/OS-II source code layer, μC/OS-II porting layer and driver library layer.
① The User directory of the user layer stores user codes and settings. The Main.C file is where users write tasks, such as ventilation control, light intensity control, etc. Main.H defines the stack size, priority, etc. of the task. OS_CFG.H is the configuration file of μC/OS-II, and users can modify its content as needed. Includes.H is the general header file. In addition to the source code of μC/OS-II, all ".C" files include it, so the header files and other declarations required by users only need to be declared once in Includes.H.
② The Middleware directory of the middleware layer stores the middleware written by users, such as Uart0.C, Uart0.H serial communication middleware, etc.
③ The μC/OS-II \\Source directory of the μC/OS-II source code layer stores the source code of μC/OS-II (all “.C” and “.H” files except uCOS_II.C). Users only need to copy the source code to this directory without making any modifications to the source code.
④μC/OS-II porting layer The μC/OS-II \\Ports directory stores the μC/OS-II porting code based on LM3S1968, including three necessary files, OS_CPU_C.C, OS_CPU_A.ASM and OS_CPU.H. Users should rewrite these three files according to the processor so that they can be ported to the corresponding processor. The Startup file in the Target directory is the startup code and interrupt vector table of LM3S1968. Users should add the first address of the required interrupt service function to it; Target.C and Target.H provide the LM3S1968 initialization function targetInit() and other peripheral control functions.
⑤ The driver library layer is the layer directly facing the hardware target board. Generally speaking, except μC/OS-II, other codes must access the hardware directly or indirectly through it.
3.3 Backend management system, aggregation nodes and communication between nodes
The communication path between the backend management system and the node is: backend management system ←→ Internet ←→ aggregation node ←→ measurement node or actuator node. The data transmitted by the backend management system to the aggregation node through the Internet in the form of IP data packets includes the target node number and control commands. The measurement node and the actuator node adopt a unified numbering method. The control command requires the measurement node to upload sampling data, or requires the actuator node to perform the action required by the command (i.e., start or stop the control device) or requires the actuator node to upload the operating status of the node control device.
The communication between the aggregation node and the measurement node/actuator node adopts multi-hop routing. Since there are many nodes in the monitoring area, the use of a unified data format is conducive to communication between nodes. The data format is as follows:
Among them, Preamble is the boot byte, BroAddr is the broadcast address (0xFF), Final-No is the target node number of data transmission, Middle-No is the intermediate node number, Source-No is the source node number providing data, CtrlData is the control command, Data 1...Data n is the valid data to be sent or received, and CRC is the check code.
When nRF905 is in transmit mode, Preamble and CRC are automatically loaded by nRF905, BroAddr and all the intermediate data are sent to RF module nRF905 in sequence by microcontroller. In receive mode, nRF905 first receives a data packet, verifies that Preamble, BroAddr and CRC are correct, and then sends all the data to microcontroller for processing, and the software compares the address and performs corresponding processing.
4 Conclusion
This design is based on wireless communication technology, electronic technology and computer technology. The wireless actuator node is designed using the LMS3S1968 microcontroller based on ARM® Cortex™-M3 and the wireless transceiver chip nRF905. The system has high integration, stable performance, high reliability and strong practicality. The greenhouse monitoring system makes decisions based on the measured data of the measurement node by the background terminal to control the actuator node to perform tasks. The system can easily expand the capacity of communication nodes and realize the monitoring of temperature, humidity and light intensity in a larger area. It can be used in industries such as agricultural greenhouses that have strict requirements for temperature, humidity and light intensity control.
Previous article:Design of communication system for rapid electromagnetic casting and rolling of aluminum alloy strip based on CANopen
Next article:Design and Application of HIRFL-CSR Vacuum Control System
Recommended ReadingLatest update time:2024-11-16 21:25
- Popular Resources
- Popular amplifiers
- Based on NRF905 wireless transmission module RF design including schematic diagram and source program
- The principle of wireless transceiver chip nRF905 and its application in single chip system
- Design and implementation of wireless call sign system based on nRF905 chip
- Design and implementation of wireless transmission based on nRF905 chip
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
- 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!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Please tell me the function of STM32 WWDG window value
- How does positioning technology change the world?
- 2. Sensors used in previous "Control" competitions
- The left side is connected to the microcontroller, and the right side is the button. Why is the IO port always at a high level?
- The stm32f103zet6 system board drives OV2640 and collects data incorrectly
- Quickly obtain TI industrial motor drive resources and answer questions to win prizes
- [Flower carving DIY] Interesting and fun music visualization series of small projects (13) --- organic stick column lamp
- [Silicon Labs BG22-EK4108A Bluetooth Development Review] + Unboxing Experience
- Dialog Semiconductor Software Application Engineer (BLE Low Energy Bluetooth Products)
- Activity/Inactivity recognition of LSM6DSL