Temperature and humidity automatic control system based on SOPC

Publisher:创意狂想Latest update time:2011-06-10 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
SOPC (System On a Programmable Chip) is called a programmable system on chip. It is a reconfigurable system on chip (SOC) based on programmable logic devices (FPGA or CPLD). Programmable system on chip (SOPC) is a flexible and efficient SOC solution proposed by AL-TERA. It integrates the functional modules required for system design such as processor, memory, I/O port into a programmable device to form a programmable system on chip. SOPC combines the advantages of SOC, CPLD and FPGA, and has the following basic features: at least one embedded processor core; small-capacity on-chip high-speed RAM resources; rich IP core resources to choose from; sufficient on-chip programmable logic resources; processor debugging interface and FPGA programming interface; contains some programmable analog circuits; single chip, low power consumption, micro packaging.
Temperature and humidity are important parameters in industrial and agricultural production, meteorology, environmental protection, national defense, scientific research, aerospace and scientific experiments, and temperature and humidity automatic control systems are widely used in many fields such as industrial production, medicine, crop cultivation and scientific experiments. At present, most of the temperature and humidity automatic control systems on the domestic market are designed based on single-chip microcomputers or ARM series chips. Comparing these two designs, the temperature and humidity automatic control system based on SOPC has a higher degree of integration and is more portable; it has higher stability and accuracy than the temperature and humidity automatic control system based on single-chip microcomputer, and it is more convenient to design than the temperature and humidity automatic control system based on ARM series chips, with a shorter design cycle and more cost advantages.


1 System composition
The overall block diagram of the temperature and humidity automatic control system is shown in Figure 1. The system is structurally divided into two layers: the first layer is composed of a PC, which serves as the upper computer; the second layer is composed of a Nios system and peripheral devices, which serves as the lower computer. The upper computer and the lower computer communicate using the RS485 bus.

The structure diagram of the lower computer is shown in Figure 2. It is composed of the Nios system, actuators, and display, input, and output ports. The Nios system consists of the CPU (Nios), on-chip RAM, timer, bus, asynchronous serial port UART, and general PIO. Among them, the NIOS system is connected to the A/D converter, keyboard, LED display, actuator, etc. through PIO.

The working process of the temperature and humidity automatic control system is: first, information is collected through the temperature and humidity sensor; second, the NIOS system transmits the collected information to the host computer through the UART interface. The host computer analyzes and processes the collected information; finally, the NIOS system outputs decision-making instructions to the terminal control device based on the analysis and processing results of the host computer. If the temperature or humidity exceeds the limit, it will display and alarm, and drive devices such as fans or heaters. The control system also adds keyboard input to the lower computer, so that the lower computer can be used alone, making the lower computer itself an independent control system. We will focus on the design process of the lower computer below.


2 Hardware Design of System Lower Computer
The hardware development steps of SOPC system are as follows: generate NiosⅡ embedded processor with SOPC Builder; combine NiosⅡ embedded processor with other logic circuits with QuartusⅡ for design input; then compile (including analysis, synthesis and layout and routing); finally download hardware configuration data to FPGA through download cable.
The lower computer hardware design of this system adopts SOPC development tool (i.e. SOPC Builder) of ALTERA Company for design. SOPC Builder tool provided by ALTERA Company can conveniently design personalized NiosⅡ soft core. Cut out unnecessary peripherals to save system resources and add required interfaces. Using SOPC Builder tool, designers can easily connect processor, memory, other peripheral modules and necessary PIO interfaces to develop a complete system. In SOPC Builder. Graphical user interface, designers can also manage IP modules, set system parameters and select available ports and peripherals. After completing the design, the system starts the generation program, and a large number of output files will be generated, including HDL logic files, program header files and library files. These files are included in the Nios II IDE development environment, and Nios II software development can be performed on this software development platform.
2.1 Nios II soft-core processor

The NiosⅡ soft-core processor is a general-purpose 32-bit RISC embedded processor launched by ALTERA. It is specially optimized for programmable logic and equipped with a fully functional development kit. Including C/C++ compiler, integrated development environment (1DE), JTAG debugger, etc., it is the core of ALTERA's programmable single-chip system solution.
As a soft-core processor. NIOS II provides configurable hardware and software debugging features. Including basic JTAG operation control (run, stop, single step, memory, etc.), hardware breakpoints, data triggers, on-chip and off-chip tracking, embedded logic analyzer. These powerful tools can be used in the development stage and can be removed after debugging to save resources. The NIOSⅡ processor also provides three cores with different performances: high, medium and low. By combining with more than 60 IP cores provided by ALTERA (such as UART, clock, DMA, SDRAM, parallel IPO, etc.), designers can easily create a perfect solution in terms of processor, peripherals, memory and PIO interface for specific applications. In addition, NIOSlI has many other excellent features, such as instruction customization, hardware accelerator, etc.
2.2 AVALON bus
AVALON bus is a simple bus structure designed to connect the on-chip processor and peripherals into a programmable system on chip (SOPC). The bus specifies the port connection between the controller and the slave components and the timing of the communication between the components. The basic transmission mode of the AVALON bus is to transfer a single byte, half word or word between a master peripheral and a slave peripheral. When a transmission is completed, regardless of whether the new transmission process is still between the same peripherals, the AVALON bus can always start another transmission immediately in the next clock cycle. The AVALON bus supports multiple bus master peripherals, allowing multiple data units to be transferred between peripherals in a single bus transaction. This multi-master device structure provides great flexibility for building SOPC systems and can adapt to high-bandwidth peripherals.
2.3 Peripherals
In this system. The NIOS system includes peripherals such as on-chip RAM, timers, asynchronous serial ports UART and general PIO. These peripherals are integrated in the SOPC BUILDER development tool. Users only need to integrate the required peripheral components and CPU into the FPGA through the AVALON bus to complete the entire lower-level computer hardware design, thereby shortening the design cycle.
2.4 Temperature and humidity sensor
The temperature and humidity sensor selected for this system is SHTll, which is a single-chip fully calibrated digital relative humidity and temperature sensor with a PC bus interface produced by the Swiss Sensirion company. The sensor uses a unique CMOSens TM technology and has the characteristics of digital output, no debugging, no calibration, no peripheral circuits, and full interchangeability.


3 Software Design of System Lower Computer
The software design of the system lower computer is carried out in the NIOS IDE development environment. Based on the software generated by SOPC Builder, the source program is written in C/C++ language, and then compiled, linked, and debugged to generate an executable file. Finally, the executable program is debugged and run through the download cable. The system lower computer software mainly includes initialization, data acquisition subroutine, serial port receiving and sending subroutine, temperature and humidity control subroutine and display subroutine. Here we focus on the flow chart of the temperature and humidity control subroutine. As shown in Figure 3.

The temperature of this temperature and humidity automatic control system is required to be controlled between 5℃ and 30℃. If the collected temperature T>30℃, the program turns to Jw (cooling processing program) and sends an alarm signal; if T<5℃, the program turns to SW (heating processing program). And send an alarm signal; if 30℃>T>5℃, the program turns to the display subroutine and returns to the main program. The humidity control process is similar to the temperature.


4 Conclusion
This system uses SOPC technology to cleverly integrate the signal acquisition module and the microprocessor module into an FPGA. And by using the flexibility of programmable logic and the powerful processing power of NIOS II, the temperature and humidity automatic control function is conveniently realized. The implementation function of this system is relatively simple. Since there are still a lot of logic resources inside the FPGA that can be used, more complex functions can be realized.
The actual results show that the temperature and humidity automatic control system based on SOPC runs normally, data transmission is reliable, and operation and management are convenient. If it is equipped with a 485 bus, the whole system will be even more powerful.
Due to the programmable characteristics of FPGA, the system can be upgraded in software and hardware without changing any peripheral circuits, which greatly extends the life cycle of the system. This is also an advantage over other control systems. The use of SOPC solution for system design is in line with the development direction of today's science and technology.

Reference address:Temperature and humidity automatic control system based on SOPC

Previous article:Application of DCS Control System in Coke Oven Ground Dust Removal Station
Next article:Design of a humidity measurement circuit

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号