At present, many primary and secondary schools have set up interest groups on plant cultivation science popularization. When the interest groups carry out activities, they often have disputes or even conflicts in key points, such as watering, heating, feeding and watering, because the opinions of participants are often inconsistent. Especially the primary and middle school students in cities, who live in cities from an early age, lack intuitive knowledge of plant growth rules, water conditions and so on. By introducing single-chip computer, collecting the concerned physical quantities (such as humidity, temperature, water level etc.), the general plant watering controller in primary and secondary disciplines is judged by the members of interest groups, voted by them, judged by the single-chip computer according to the voting results, and automatically starts the control relay to carry out the opinion of watering or not, which solves the tradition. The interest group of plant cultivation only observes and records the shortcomings of lack of interaction, in order to achieve the purpose of collective participation, joint voting and interest promotion of the members of the interest group. Soil moisture represents the physical quantity of the degree of soil dryness and wetness in a certain depth of soil layer, also known as soil moisture content. Soil moisture is affected by various components of water balance, such as injection water, environmental temperature, environmental humidity, soil component density, plant leaf area, etc., but the decisive factor is injection water.
Soil moisture determines the water supply of plants. Excessive soil moisture and poor soil aeration affect the activities of microorganisms in soil, hinder the respiration and growth of plant roots, cause rotten roots and breeding diseases, and thus affect the normal growth of plant aboveground parts. The low content of soil moisture leads to soil drying and the insufficient water intake of plants, which results in the abnormal photosynthesis, affects the growth of plants, and causes crop withering and death due to serious water shortage. In the scientific activities of plant cultivation in primary and secondary schools, the soil moisture status determines the growth status of plants, and the control of soil moisture is particularly important. With the introduction of microcontroller, the general plant watering controller in primary and secondary schools can display the soil moisture status in real time, and automatically control the plant moisture by voting of participants. Supplement. YL-69 soil moisture sensor senses soil moisture information and displays it in real time by single-chip computer after A/D conversion. Participants judge whether water is watered or not by setting voting keyboard according to soil moisture status and their own experience. Finally, single-chip computer judges whether water is watered or not according to voting situation. The next day, each member of the interest group made a new round of judgment by observing the growth of plants and combining with the real-time display of soil moisture.
In order to enhance students’interest, but also through the introduction and application of single-chip computers, so that students learn to master computer knowledge, electrical principle knowledge, etc., in order to enrich their knowledge. The system consists of STC89C52 single chip computer, reset and clock circuit, humidity sensor module, A/D conversion module, keyboard input module, relay control pump module and LCD display module. The working process of the system is as follows: the soil moisture sensor (YL-69) sends the humidity signal to A/D conversion module. After analog-digital conversion, the obtained digital signal is sent to the single chip computer for data processing, and the results are sent to the liquid crystal display for display, thermostatic element so that the members of interest group can intuitively understand the current soil humidity situation.
Interest group members combined plant growth, light and other conditions to make a comprehensive opinion on whether to agree to water, through S2 (agree to water), S3 (disagree with water) to vote. LCD screen real-time display has voted students’opinions, all students after voting, press the S1 key (end), judged and controlled by single-chip computer, as the number of votes agreed is greater than the number of votes disagreed, single-chip computer output signal control relay power supply for watering, while lighting LED 1 to indicate the watering state, single-chip computer automatic delay of 10 seconds (according to planting). After the container size is set, stop and complete a watering process. There are many ways to measure soil moisture. The principle is to obtain the moisture of a substance indirectly according to the changes of physical or chemical properties caused by the absorption of water from the soil. Capacitive, resistive and humidity-swelling humidity sensors are used to measure humidity according to the changes of dielectric constant, resistivity and volume of their dielectric materials after moisture absorption. YL-69 is a simple soil humidity sensor.
The sensing part is a humidity-sensitive capacitor. When the humidity of the environment changes, the medium in the environment where the humidity-sensitive capacitor exists will be changed. Through the peripheral circuit of this part, the change of capacitance will be converted to analog voltage value. The power supply voltage of the system is 5V. When the temperature is 0%-100%, the analog output voltage varies between 4.75V and 1.45V, which is inversely proportional to the measured humidity.
ADC0832 is an 8-bit resolution, dual-channel A/D conversion chip. The highest resolution can reach 256 levels, which can meet the requirements of analog conversion. The conversion time of the chip is only 32 US, and the dual data output can be used as data verification or effectively reduce data errors. The conversion speed is fast and the stability is strong. The analog voltage signal output by YL-69 is input to DI data input terminal, converted to digital signal, and input to a single chip computer for processing. SCM uses STC89C52 which is widely used. It is a general SCM. It has a smart 8-bit CPU and a system programmable Flash. The C language program can be compiled, simulated and written by Keil programming software. P0 port: It is an 8-bit drain open bidirectional I/O port, which is connected with the data input D0-D7 of LCD1602 as the output port. P1 port: 0, 1 and 2 of P1 port are connected to CLK, DIO and CS ports of ADC083 respectively to control ADC and read the conversion results. P2 port: In the system, 5-7 ports of P2 are connected with RS, RW and EN ports of LCD1602 to control LCD display. The 0 port of P2 serves as the output control port, and the low level is effective. The control output is controlled by the triode relay, which drives the pump to water, and the 0-port high-level stop of the post-set P2 is delayed for 10 seconds.
At the same time of starting the water pump, the LED 2 lamp is installed at the control end of the low-level, luminous, indicating the watering state. P3 port: It is an 8-bit bidirectional I/O port with internal pull-up resistance. It uses ports 0, 1 and 2 of P3 to connect to the ground through S1, S2 S3, and the capture switch has trigger input. According to the requirement of STC89C52, in order to make the internal oscillator circuit start up and form a clock, the external crystal oscillator and capacitors C1 and C2 must be connected to form a parallel resonant circuit in the feedback loop of the amplifier. The external capacitance will affect the oscillation frequency and the stability of the oscillator. The frequency of crystal oscillator can be chosen between 1.2MHZ and 12MHZ, and the typical values of capacitance C1 and C2 can be chosen between 20pF and 100pf. For the convenience of calculation, the system uses 12MHZ crystal oscillator and capacitance 30pf. In the design of this system, the reset circuit is designed as power-on reset plus manual reset, which is convenient to use. When the program “runs away”, it can be reset manually without restarting the power supply of single chip computer. At the moment of power-on, the clock circuit generates clock pulses, and the controller generates a series of signals in a certain order in time according to the function of the command. It controls the related logic circuit and realizes the function of executing the command. The system designs three keyboard input terminals, namely key S1, S2 and S3. S2 is the consent watering button, and every time it is pressed, the consent register data is increased by 1; S2 is the disagreement watering button, and every time it is pressed, the disagreement register data is increased by 1. S1 is the end button. After pressing, it starts the comparison program, compares the data size of two registers, and executes different instructions. The design of the system requires that the soil moisture value monitored by facts be displayed simultaneously, and that the data of two groups of votes be displayed simultaneously. The content of the display is more, and the display on the same screen is needed. The digital tube can not meet the need.
LCD1602 is chosen to display more information at the same time. 1602 character LCD is a dot matrix LCD module specially used to display letters, numbers, symbols and so on.
It can display two lines at the same time, each line has eight characters. The first line shows the real-time soil moisture value, the second line shows the consent and disagreement data when voting, the execution action after voting, the execution of watering action shows “STARTING WATER” and the non-execution shows “STOPED OVER…”. While LCD1602 shows the humidity, voting and watering status, two LEDs and a buzzer are designed to give assistant status hints. When the soil humidity value is more than 50%, the LED 1 lights up and warns the soil humidity value is higher.
When the water is started, the LED 2 indicates that the water is being watered, and the buzzer rings, indicating that the water is being watered. The software design of this system is written in C language, and the software design adopts structured and modular design method, which is convenient for function expansion. The system is initialized after power-on. The number of consent votes and disagreement votes are set to zero. The data collected by humidity sensor is transmitted to MCU through A/D analog-to-digital conversion. The MCU sends the data from the sampling chip to LCD 1602 for display. The first line of LCD 602 shows “Humidity” and soil moisture value, and the second line of LCD 1602 shows “YES”. 0 NO: 0 “. Enter the main loop procedure to judge whether the button triggers or not. If the button triggers, enter the judgment procedure. If S2 is pressed, the number of consent votes will be increased by one vote and sent to LCD602 for display. If S3 is pressed, the number of consent votes will be increased by one vote and sent to LCD602 for display. If S1 is pressed, the judgment procedure will be started to compare the number of consent votes and the number of disagreement votes, if different. If the number of consent votes is less than the number of disagreement votes, start the relay to water the pump. At the same time, “STARTING WATER” is displayed on the second line of LCD602.
If the number of consent votes is less than the number of disagreement votes, STOPED OVER is displayed. The software programming of the design is mainly realized by using the external interface circuit of the single chip computer and the programming software of the single chip computer. Therefore, the correct and feasible program is the necessary condition for realizing the program. Keil programming software is the main software used in programming. Keil C51 is a 51 series compatible MCU C language software development system produced by Keil Software Company in the United States. Compared with assembly, C language has obvious advantages in function, structure, readability and maintainability, so it is easy to learn and use.
Keil provides a complete development plan including C compiler, macro assembly, connector, library management and a powerful simulation debugger. These parts are combined through an integrated development environment (uVision). The system realizes the collection and display of soil temperature through a STC89C52 single-chip computer, the input and display of voting, and the input results can be compared to control the relay, and then drive the water pump to water the plants. The combination of voting and plant watering has enhanced the interest of popular science. This system has the characteristics of simple hardware circuit, fewer peripheral components and low cost. The software is written and solidified at one time, and has scalable performance. With the same hardware circuit, other functions can be added by simple modification of the control program. For example, the total number of interest groups can be fixed and automatically compared after all votes. It can also increase the humidity above the set value (for example, 70%) to shield irrigation function for students to expand and develop.