Design of vegetable greenhouse control system based on AT89C51

Publisher:郑哥Latest update time:2011-07-22 Keywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Connection circuit diagram of DSl8820 and AT89C5I [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.

Technical indicators of 183605

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.

Technical indicators of FI)S100

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.

ADC0809 and AT89C51 interface circuit

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.

44780 display module and AT89C51 microcontroller connection circuit

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.

Interface circuit between MAX232C and AT89C51

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.

Main program flow chart

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.

Keywords:AT89C51 Reference address:Design of vegetable greenhouse control system based on AT89C51

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

Design of intelligent street light controller based on 51 microcontroller
1. System Overview The modules used in the system include AT89C51 microcontroller + LCD1602 display screen + ADC0832 + buttons + small lights. The intelligent street light control system designed this time uses the AT89C51 microcontroller as the control core, and uses the LCD1602 display screen to display the digita
[Microcontroller]
Design of intelligent street light controller based on 51 microcontroller
Brief Introduction of AT89C51 Single Chip Microcomputer System
AT89C51 is a low voltage, high performance CMOS 8-bit microprocessor with 4K bytes of flash programmable and erasable read only memory (FPEROM), commonly known as a single chip microcomputer. The device is manufactured using ATMEL's high-density non-volatile memory manufacturing technology and is compatible with the
[Microcontroller]
Power Failure Control System Based on AT89C51 Single Chip Microcomputer
1 Introduction   There have been many studies on the detection and protection of power grid short circuit and line fault. The short circuit, overload and overvoltage protectors on the market have single functions. They are easy to damage, have no reminder function, and are not user-friendly. However, with the contin
[Power Management]
Power Failure Control System Based on AT89C51 Single Chip Microcomputer
Design of CAN-LIN Gateway Based on AT89C51CC01 Microcontroller
Introduction Fieldbus technology has been widely used in industrial control, especially CAN (Control Area Network) bus, which has a large share in the actual engineering application of fieldbus due to its advantages of high reliability, low cost and easy implementation. With the development of bus technolog
[Microcontroller]
Design of CAN-LIN Gateway Based on AT89C51CC01 Microcontroller
Frequency meter hardware circuit diagram based on AT89C51
    This circuit diagram is based on the AT89C51 frequency meter hardware circuit diagram. As shown in the figure. The frequency meter realizes the following functions:   1. Test functionality   It indicates all the test functions of the digital frequency meter, generally including frequency measurement, perio
[Microcontroller]
Frequency meter hardware circuit diagram based on AT89C51
Design of RS232-GPIB controller based on AT89C51 microcontroller
More and more measuring instruments provide GPIB (General Purpose Intefface Bus) bus interface, through which instruments and computers with GPIB interfaces can be connected conveniently and quickly to form a GPIB network. When a GPIB device is connected to a computer, a GPIB interface board is required. However, thes
[Microcontroller]
Design of RS232-GPIB controller based on AT89C51 microcontroller
Brief Introduction of AT89C51 Single Chip Microcomputer System
AT89C51 is a low voltage, high performance CMOS 8-bit microprocessor with 4K bytes of flash programmable and erasable read only memory (FPEROM), commonly known as a single chip microcomputer. The device is manufactured using ATMEL's high-density non-volatile memory manufacturing technology and is compatible with the
[Industrial Control]
Application of AT89C51 microcontroller in wireless data transmission
A general digital acquisition system is The captured on-site signals are converted into electrical signals through sensors. After sampling, quantization and encoding by the analog/digital converter ADC, they are converted into digital signals and stored in the data memory , or sent to the microprocessor, or wirelessly
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号