introduction
With the rapid development of science and technology, my country's agriculture has gradually transformed from traditional agriculture to modern agriculture with high yield, high quality and high efficiency. As a vegetable greenhouse in my hometown, it is naturally inseparable from modern science and technology. A large number of scientific experiments and production practices at home and abroad have proved that environmental control plays a very important role in vegetable production. Only in a suitable growth environment can vegetables give full play to their high yield potential. The control of the environment in the vegetable greenhouse is mainly to measure and control the ambient temperature, humidity and soil moisture. In order to better measure and control the factors that affect the growth of vegetables, such as humidity, humidity and soil moisture, this paper designs an intelligent measurement and control system with AT89C51 single-chip microcomputer as the controller. Through this system, the observed values of ambient temperature and humidity can be automatically controlled and timely monitored, and sound and light can be used for over-limit alarm and corresponding processing.
1 System Function
The system uses the AT89C51 single-chip microcomputer to query the output signals of each sensor in the vegetable greenhouse in turn, and then processes the input signals accordingly and displays them through the display module for vegetable farmers to observe. At the same time, when the displayed value exceeds the environmental index required for normal growth of vegetables, the system will generate various alarm signals to alarm. In addition, the data collected by the single-chip microcomputer can be input into the PC, and then a series of analysis and processing of the input data can be performed to find out the relationship and change trend between the data.
2 System Hardware Composition
The hardware of the system mainly includes the following modules: AT89C51 main control module, various sensor modules, A/D converter, 44780 display module, and level converter. Among them, the AT89C51 microcontroller mainly completes the control of peripheral hardware and some calculation functions, the sensor completes the signal sampling function, the A/D converter mainly completes the analog/digital conversion, the 44780 display module completes the character and digital display function, and the level converter converts the data collected by the microcontroller into RS232 level for transmission to the upper computer.
2.1 Main control module
The system is implemented using ATMEI 89 series single-chip microcomputer AT89C51, which uses 51 core, is compatible with MCS-51 products, and can be repeatedly programmed/erased 1000 times. AT89C51 has 128B internal RAM, 2 16-bit timers/counters, 32 programmable L/O lines, and an internal oscillator and clock circuit. In particular, it has 4kB of programmable flash memory, which provides great convenience for program development.
2.2 Sensor Selection
2.2.1 Temperature Sensor
The temperature sensor uses the single bus digital temperature sensor DS18820 produced by DALLAS. It can not only directly output serial digital signals, but also has the advantages of miniaturization, low power consumption, high performance, easy microprocessor connection and strong anti-interference ability. The DS18820 digital temperature sensor provides 9-12 bits of data and alarm temperature registers for the measured temperature. Its temperature measurement range is -55-+125℃, and the measurement accuracy in the range of -10-+85℃ is ±0.5°C. Since each DS18820 has a unique 64-bit product number, it is allowed to connect multiple sensors on one cable to form a large temperature measurement and control network. The interface circuit diagram of DS18820 and AT89C51 is shown in Figure 1, where DS18820 works in external power supply mode, and the single-chip microcomputer 89C51 uses P2.0 to communicate with DS18820.
[page]
2.2.2 Humidity Sensor
The humidity sensor uses the IH3605 integrated humidity sensor produced by Honeywell, which has an integrated signal conditioning circuit. It has many advantages such as high accuracy, good linearity, strong interchangeability and a wide output voltage range. Its unique multi-layer structure enables it to resist the corrosion of moisture, dust, dirt, oil and other chemicals. Its output voltage is high and the linearity is good. It does not require signal amplification and signal adjustment, and can directly perform A/D conversion. The technical indicators of IH3605 are shown in Table 1.
2.2.3 Soil Moisture Sensor
The FDS100 soil moisture sensor is used. This sensor is developed based on dielectric theory and frequency domain measurement technology. It can accurately measure the volumetric water content of soil and other porous media. It can be integrated with greenhouse environment monitoring, soil moisture collection, automatic irrigation control and other systems to achieve long-term dynamic continuous monitoring of moisture. It has the characteristics of fast response speed, good repeatability, strong environmental adaptability, waterproof and moisture-proof, long transmission distance, and wide operating temperature range. The technical indicators of FDS100 are shown in Table 2.
2.3 A/D conversion circuit
Since this system needs to process multiple analog signals, the AI×X09A/D conversion module is used. It uses the successive approximation method to complete the A/D conversion; its 8-way analog switch with latch function can convert 8 0-5V input analog voltage signals, and it takes about 100S to complete one conversion. Its output has a three-state latch buffer, which can be directly connected to P0121 of the single-chip microcomputer ArlB9C51. The interface circuit of ADC/EO) and AT89C51 is shown in Figure 2.
2.4 44780 display module
This system uses 44780 driven LCD, HD 780 (KS0062) is a large-scale dot matrix LCD controller (with driver) made with low power consumption CMOS technology, it is connected with 4bit/8bit microprocessor, it can make dot matrix LCD display uppercase and lowercase English letters, numbers and symbols and other rich information, at the same time it has strong universal application, easy to use, users can use a small number of components to form a complete dot matrix LCD system, input relevant data and instructions to achieve the required display. [page]
The 44780 display module has 8 data lines and 3 control lines, which can be connected to a microprocessor or microcontroller. By inputting data and instructions, the module can work normally. The connection circuit between the 44780 display module and the AT89C51 microcontroller is shown in Figure 3.
2.5 Level Converter MAX232C
MAX232C is an RS-232 transceiver, which is simple and easy to use, powered by a single +5V power supply, and only requires a few external capacitors to complete the conversion from 7R level to RS-232 level. The data collected by the microcontroller can be converted to RS232 level through the serial port through MAX232C and transmitted to the host computer (PC).
The interface circuit between MAX232C and AT89C51 is shown in Figure 4.
3 Programming
The system software is mainly composed of modules such as the main program, interrupt subroutine, data acquisition and A/D conversion subroutine, display subroutine, and alarm subroutine. The software of this system is written in C language because software written in C language is easy to modularize and the generated machine code is of high quality, strong readability, and good portability.
In the system, the main program: completes the initialization of the system and allocates and calls each subprogram to realize the system function. The main program flow chart is shown in Figure 5. The data acquisition and A/D conversion subprogram quantizes and processes the analog signal collected by the sensor into a value that can be recognized by the microcontroller and transmits it to the main program. The display subprogram displays the standard value obtained after the value collected by the sensor is quantified.
The alarm subroutine outputs an alarm signal when an abnormal situation occurs. For example, when the temperature exceeds a certain value or the humidity and the soil moisture are lower than a certain value, the audio alarm device sends an alarm signal and the corresponding indicator light lights up to alert the vegetable farmers.
4 Conclusion
This paper uses a vegetable greenhouse control system based on the AT89C51 single-chip microcomputer to monitor and control environmental indicators such as ambient temperature, humidity and soil moisture. The entire process is automatically completed by the single-chip microcomputer system, which can adjust and control the required specific temperature and humidity to meet the needs of vegetable growth. In addition, this system has high reliability and is easy to use, which provides greater convenience for the next step of developing a control system based on this.
Previous article:Design of Serial Communication between PC and Multiple MCS-51 Single-Chip Microcomputers
Next article:Wireless Data Transmission System Based on C8051F02X
Recommended ReadingLatest update time:2024-11-16 17:33
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- 【GD32307E-START】+ driver display of digital tube display module
- Read a good book, the Electronic Engineer's Self-Taught Handbook
- The latest Bluetooth market report shows that IoT has become the main force
- ST Live Broadcast on March 19: Introduction to SensorTile.box, Bone Vibration Sensor, and Machine Learning Sensor Development
- Application of Operational Amplifier in Voltage Comparator
- Error message when importing bsp project into CCS6
- Many people like to use S9013 as a driver for buzzers, small fans, and LEDs. What is the advantage of S9013 over S8050? High frequency...
- GB21437.2 Pulse 1 Standard Questions
- Nanosecond Laser Driver Reference Design for LiDAR
- Must-read before joining the group: Proposal for the Switching Power Supply Study Group!