Disclosure of Invention
The utility model aims to solve the technical problem that not enough to above-mentioned prior art provides an automatic control system irrigates that drips based on 51 singlechips, this automatic control system irrigates that drips based on 51 singlechips can detect soil moisture temperature, combines air temperature and humidity information and then drive relay circular telegram simultaneously, realizes irrigation system's automatic control, and the cost of each part is not high, and the reliability is than higher, and the system is nimble easily to be adjusted, and application prospect is wide in irrigating.
In order to realize the technical purpose, the utility model discloses the technical scheme who takes does:
a dripping irrigation automatic control system based on a 51 single chip microcomputer comprises a power supply circuit, a soil humidity acquisition circuit, an AD conversion circuit, a key input circuit, an air temperature and humidity acquisition circuit, a liquid crystal display circuit, a buzzer alarm circuit, an execution mechanism circuit and a single chip microcomputer control circuit; the power supply circuit is respectively connected with the soil humidity acquisition circuit, the AD conversion circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit, the execution mechanism circuit and the singlechip control circuit; the soil humidity acquisition circuit is connected with the AD conversion circuit, and the AD conversion circuit, the key input circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit and the execution mechanism circuit are all connected with the single chip microcomputer control circuit;
the executing mechanism circuit comprises a relay control circuit and a water pump, and the single chip microcomputer control circuit is connected with the water pump through the relay control circuit;
the single chip microcomputer control circuit comprises an STC89C52RC single chip microcomputer, a reset circuit and a crystal oscillator circuit, wherein a pin 40 of the STC89C52RC single chip microcomputer is connected with a power VCC, a pin 20 of the STC89C52RC single chip microcomputer is connected with a ground wire, the reset circuit is connected with a pin 9 of the STC89C52RC single chip microcomputer, the crystal oscillator circuit is connected with a pin 18 and a pin 19 of the STC89C52RC single chip microcomputer, an AD conversion circuit is connected with a pin1 and a pin2 of the STC89C52RC single chip microcomputer, a key input circuit is connected with a pin 6, a pin 13 and a pin 14 of the STC89C52RC single chip microcomputer, an air temperature and humidity acquisition circuit is connected with a pin 12 of the STC89C52RC, a liquid crystal display circuit is connected with a pin 32 to a pin 39, a pin 27 and a pin 28 of the STC89C RC single chip microcomputer, a buzzer alarm circuit is connected with a pin 7 of the STC89C52RC single chip microcomputer.
As a further improved technical solution of the present invention, the reset circuit includes a button S1, a resistor R4 and a capacitor C2, one end of the button S1, one end of the resistor R4 and the negative electrode of the capacitor C2 are connected to the pin 9 of the STC89C52RC single chip microcomputer, the other end of the resistor R4 is connected to the ground, and the other end of the button S1 and the positive electrode of the capacitor C2 are connected to the power VCC; the crystal oscillator circuit comprises a crystal oscillator Y1, a capacitor C3 and a capacitor C4, one end of the crystal oscillator Y1 and one end of the capacitor C3 are simultaneously connected with a pin 18 of an STC89C52RC single chip microcomputer, the other end of the crystal oscillator Y1 and one end of the capacitor C4 are simultaneously connected with a pin 19 of the STC89C52RC single chip microcomputer, and the other ends of the capacitor C3 and the capacitor C4 are simultaneously connected with a ground wire.
As the utility model discloses further modified technical scheme, POWER supply circuit includes POWER POWER and master switch S2, ground wire is connected to POWER POWER' S one end, and the other end is connected with soil moisture acquisition circuit, AD converting circuit, air temperature and humidity acquisition circuit, liquid crystal display circuit, bee calling organ warning circuit, actuating mechanism circuit and single chip microcomputer control circuit respectively through master switch S2, thereby POWER POWER is used for supplying POWER for soil moisture acquisition circuit, AD converting circuit, air temperature and humidity acquisition circuit, liquid crystal display circuit, bee calling organ warning circuit, actuating mechanism circuit and single chip microcomputer control circuit respectively through master switch S2 output POWER VCC.
As the utility model discloses further modified technical scheme, soil moisture acquisition circuit includes interface P5 and resistance R5, YL69 soil moisture sensor is connected to interface P5, interface P5's one end is connected with AD converting circuit and this end is passed through resistance P5 and is connected with the power VCC.
Soil moisture acquisition circuit mainly realizes through soil moisture sensor YL69, and the humidity variation of measured object physical quantity can direct reaction on YL69 inside resistance to can produce signal output through resistance variation.
As the utility model discloses further modified technical scheme, AD converting circuit adopts the ADC0832 chip, the pin2 of ADC0832 chip is connected with interface P5's one end, and the pin4 of ADC0832 chip connects the ground wire, and the pin 8 of ADC0832 chip connects the power VCC, and the pin 7 of ADC0832 chip is connected with pin1 of STC89C52RC singlechip, and the pin5 and the pin 6 of ADC0832 chip are connected with pin2 of STC89C52RC singlechip simultaneously.
As a further improved technical solution of the present invention, the key input circuit includes a key S4, a key S5 and a key S6, one end of the key S4, the key S5 and the key S6 is connected to the ground wire, the other end of the key S4 is connected to the pin 6 of the STC89C52RC single chip microcomputer, the other end of the key S5 is connected to the pin 13 of the STC89C52RC single chip microcomputer, and the other end of the key S6 is connected to the pin 14 of the STC89C52RC single chip microcomputer.
As the utility model discloses further modified technical scheme, air temperature and humidity acquisition circuit includes DHT11 temperature and humidity sensor, DHT11 temperature and humidity sensor's pin4 connects the ground wire, and DHT11 temperature and humidity sensor's pin1 connects the power VCC, and DHT11 temperature and humidity sensor's pin2 is connected with the pin 12 of STC89C52RC singlechip.
The air temperature and humidity acquisition circuit is realized by a digital temperature and humidity sensor DHT11, the temperature acquisition function is completed by a thermistor, a single-wire serial interface is adopted as an interface with the MCU, data is transmitted in a bit mode, a single-bus data transmission format is adopted, and the air temperature and humidity acquisition circuit can transmit data by being directly connected with the single chip microcomputer.
As the utility model discloses further modified technical scheme, buzzer warning circuit includes resistance R7, triode Q2 and buzzer B1, resistance R7's one end is connected with the pin 7 of STC89C52RC singlechip, and resistance R7's the other end is connected with triode Q2's base, and triode Q2's projecting pole is connected with the power VCC, and triode Q2's collecting electrode and buzzer B1's anodal are connected, and the ground wire is connected to buzzer B1's negative pole.
And the buzzer alarm circuit is realized by judging whether the data returned by the soil humidity sensor module is lower than a set value.
As a further improved technical scheme of the utility model, the LCD circuit includes LCD1602 display screen, resistance R3 and exclusion J1, pin1, pin5 and pin 16 of LCD1602 display screen all connect the ground, pin2 and pin 15 of LCD1602 display screen all connect the power VCC, pin3 of LCD1602 display screen is connected with the ground through resistance R3, pin4 of LCD1602 display screen is connected with pin 28 of STC89C52RC singlechip, pin 6 of LCD1602 display screen is connected with pin 27 of STC89C52RC singlechip, pin 7 of LCD1602 display screen is connected with pin 39 of STC89C52RC singlechip and pin 7 is connected with power VCC through exclusion J1, pin 8 of LCD1602 display screen is connected with pin 38 of STC89C52RC singlechip and pin 8 is connected with power VCC through exclusion J1, pin 9 of LCD display screen is connected with pin 37 of STC89C RC and pin 9 is connected with power VCC through exclusion J4, pin 1602 and pin1 of LCD1602 is connected with pin1 and pin1 of exclusion display screen, pin 11 of LCD1602 display screen is connected with pin 35 of STC89C52RC singlechip and pin 11 is through excluding resistor J1 and connecting the power VCC, pin 12 of LCD1602 display screen is connected with pin 34 of STC89C52RC singlechip and pin 12 is through excluding resistor J1 and connecting the power VCC, pin 13 of LCD1602 display screen is connected with pin 33 of STC89C52RC singlechip and pin 13 is through excluding resistor J1 and connecting the power VCC, pin 14 of LCD1602 display screen is connected with pin 32 of STC89C52RC singlechip and pin 14 is through excluding resistor J1 and connecting the power VCC.
As the utility model discloses further modified technical scheme, relay control circuit includes resistance R2, triode Q1, emitting diode D1, resistance R1, electric capacity C1, relay U1 and interface P1, resistance R2's one end is connected with the pin 26 of STC89C52RC singlechip, resistance R2's the other end is connected with triode Q1's base, triode Q1's collecting electrode and electric capacity C1's negative pole are connected with the ground wire simultaneously, triode Q1's projecting pole is connected with emitting diode D1's negative pole and relay U1 coil one end simultaneously, emitting diode D1's positive pole passes through resistance R1 and is connected with power VCC, relay U1 coil other end and common port are connected with power VCC simultaneously, relay U1 normally open end passes through interface P1 and is connected with the water pump.
The relay control circuit is realized by a low-power relay SRD-05V, the coil is not electrified, the normally open contact and the movable contact are disconnected, and after the two ends of the coil are electrified, the normally open contact and the movable contact complete suction within 4 ms.
The utility model has the advantages that: the utility model discloses an irrigation automatic control drips based on singlechip, including soil moisture's detection and control, outside air humiture collection two parts, soil moisture's collection and demonstration use soil moisture sensor as sensing element, convey the soil humidity value of measuring to STC89C52 singlechip in real time, show by single chip microcomputer control LCD display again. The soil humidity temperature and the air humidity are detected, the relay is driven to be electrified, the automatic control of the irrigation system is realized, the cost of each component is low, the reliability is high, the system is flexible and easy to adjust, and the application prospect in irrigation is wide.
Tests show that the circuit is reliable in work, low in cost and high in practical application value, and can be popularized to agricultural irrigation related industries.
Detailed Description
The present invention will be further explained with reference to the drawings and examples. The present invention has been described only for the embodiments of the present invention, and is not limited to the scope of the present invention.
In order to realize the automatic control of a drip irrigation system, a circuit schematic diagram of a 51-singlechip-based drip irrigation automatic control system is designed as shown in fig. 1, and comprises a power supply circuit, a soil humidity acquisition circuit, an AD conversion circuit, a key input circuit, an air temperature and humidity acquisition circuit, a liquid crystal display circuit, a buzzer alarm circuit, an actuating mechanism circuit and a singlechip control circuit; the power supply circuit is respectively connected with the soil humidity acquisition circuit, the AD conversion circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit, the execution mechanism circuit and the singlechip control circuit; the soil humidity acquisition circuit is connected with the AD conversion circuit, and the AD conversion circuit, the key input circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit and the actuating mechanism circuit are all connected with the single chip microcomputer control circuit.
The actuating mechanism circuit comprises a relay control circuit and a water pump, and the single chip microcomputer control circuit is connected with the water pump through the relay control circuit. The single-chip microcomputer control circuit comprises an STC89C52RC single-chip microcomputer, a reset circuit and a crystal oscillator circuit, wherein a pin 40 of the STC89C52RC single-chip microcomputer is connected with a power VCC, a pin 20 of the STC89C52RC single-chip microcomputer is connected with a ground wire, the reset circuit is connected with a pin 9 of the STC89C52RC single-chip microcomputer, the crystal oscillator circuit is connected with a pin 18 and a pin 19 of the STC89C52RC single-chip microcomputer, the AD conversion circuit is connected with a pin1 and a pin2 of the STC89C52RC single-chip microcomputer, the key input circuit is connected with a pin 6, a pin 13 and a pin 14 of the STC89C52RC single-chip microcomputer, the air temperature and humidity acquisition circuit is connected with a pin 12 of the STC89C52RC, the liquid crystal display circuit is connected with a pin 32 to a pin 39, a pin 27 and a pin 28 of the STC89C RC single-chip microcomputer, the buzzer alarm circuit is connected with a pin 7 of the.
In the whole system of the embodiment, an STC89C52RC single chip microcomputer is selected as a main control device, and various sensors and display control driving circuits are selected as auxiliary control devices of the drip irrigation automatic control system. The upper limit and the lower limit of the humidity are set by using a key input circuit designed on a general board. Real-time moisture of soil is detected the back by soil moisture acquisition circuit's YL69 and is passed through corresponding AD conversion chip, carries out analog-to-digital conversion, becomes the digital information volume that MCU can discern and handle, then conveys MCU, is analyzed it by MCU, and MCU handles and sends out its data that detect, shows real-time digital moisture value on LCD1602 screen. When the MCU is analyzed and found that the actual moisture value is lower than the set plant survival moisture threshold value, the MCU is combined with the DHT11 to judge whether watering can be performed or not, and if watering is required, the MCU sends an instruction to enable the relay to be electrified.
In this embodiment, as shown in fig. 2, the reset circuit specifically includes a key S1, a resistor R4, and a capacitor C2, where one end of the key S1, one end of the resistor R4, and a negative electrode of the capacitor C2 are simultaneously connected to a pin 9 of the STC89C52RC single chip microcomputer, the other end of the resistor R4 is connected to a ground, and the other end of the key S1 and a positive electrode of the capacitor C2 are simultaneously connected to the power VCC; the crystal oscillator circuit comprises a crystal oscillator Y1, a capacitor C3 and a capacitor C4, one end of the crystal oscillator Y1 and one end of the capacitor C3 are simultaneously connected with a pin 18 of an STC89C52RC single chip microcomputer, the other end of the crystal oscillator Y1 and one end of the capacitor C4 are simultaneously connected with a pin 19 of the STC89C52RC single chip microcomputer, and the other ends of the capacitor C3 and the capacitor C4 are simultaneously connected with a ground wire.
In this embodiment, as shown in fig. 2, the POWER supply circuit includes a POWER supply POWER and a main switch S2, one end of the POWER supply POWER is connected to the ground, the other end of the POWER supply POWER is connected to the soil humidity acquisition circuit, the AD conversion circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit, the actuator circuit and the single chip microcomputer control circuit through the main switch S2, and the POWER supply POWER is used for outputting a POWER VCC through the main switch S2 to supply POWER to the soil humidity acquisition circuit, the AD conversion circuit, the air temperature and humidity acquisition circuit, the liquid crystal display circuit, the buzzer alarm circuit, the actuator circuit and the single chip microcomputer control circuit.
In this embodiment, as shown in fig. 2, the soil humidity collecting circuit includes an interface P5 and a resistor R5, the interface P5 is connected to an YL69 soil humidity sensor, one end of the interface P5 is connected to the AD conversion circuit, and the end is connected to the power VCC through a resistor P5. The AD conversion circuit adopts an ADC0832 chip, pin2 of the ADC0832 chip is connected with one end of an interface P5, pin4 of the ADC0832 chip is connected with a ground wire, pin 8 of the ADC0832 chip is connected with a power supply VCC, pin 7 of the ADC0832 chip is connected with pin1 of an STC89C52RC single chip microcomputer, and pin5 and pin 6 of the ADC0832 chip are simultaneously connected with pin2 of the STC89C52RC single chip microcomputer.
In soil moisture acquisition circuit, the moisture humidity signal that will gather changes analog signal into, and soil moisture sensor comprises sensing resistor and signal processing transform element jointly, and the cooperation is corresponding peripheral circuit, and in the correct use to YL69, the humidity change of measured object physical quantity can direct reaction on YL69 inside resistance to can produce signal output through resistance change. In the AD conversion circuit, ADC0832 is selected as the AD converter.
In this embodiment, as shown in fig. 2, the key input circuit includes a key S4, a key S5, and a key S6, one end of each of the key S4, the key S5, and the key S6 is simultaneously connected to a ground, the other end of the key S4 is connected to a pin 6 of an STC89C52RC single chip microcomputer, the other end of the key S5 is connected to a pin 13 of an STC89C52RC single chip microcomputer, and the other end of the key S6 is connected to a pin 14 of the STC89C52RC single chip microcomputer.
In this embodiment, as shown in fig. 2, the relay control circuit includes a resistor R2, a transistor Q1, a light emitting diode D1, a resistor R1, a capacitor C1, a relay U1, and an interface P1, one end of the resistor R2 is connected to a pin 26 of an STC89C52RC single chip microcomputer, the other end of the resistor R2 is connected to a base of a transistor Q1, a collector of the transistor Q1 and a negative electrode of the capacitor C1 are simultaneously connected to a ground line, an emitter of the transistor Q1 is simultaneously connected to a negative electrode of the light emitting diode D1 and one end of a coil of the relay U1, an anode of the light emitting diode D1 is connected to a power source VCC through a resistor R1, the other end and a common end of the coil of the relay U1 are simultaneously connected to the power source VCC, and a normally open end.
In the relay control circuit, an SRD-05V low-power relay is adopted, an electromagnetic relay is connected with a triode, PIN1 and PIN4 are coils, a PIN1 PIN is connected with VCC, a PIN4 PIN is connected with the triode, a PIN5 PIN is a public terminal and is connected with VCC, and a PIN2 PIN and a PIN3 PIN are respectively a normally open end and a normally closed end; and a PINB pin of the triode is connected with a pin of the singlechip. When the relay is switched from the non-energized state to the energized state, the reaction time of 4ms is theoretically required on average, the normally open contact and the movable contact are both disconnected when the coil is not energized, and after the two ends of the coil are energized, the normally open contact and the movable contact complete attraction within 4 ms.
In this embodiment, as shown in fig. 2, the LCD circuit includes an LCD1602 display, a resistor R3 and an exclusion J1, pin1, pin5 and pin 16 of the LCD1602 display are all connected to the ground, pin2 and pin 15 of the LCD1602 display are all connected to the power VCC, pin3 of the LCD1602 display is connected to the ground through a resistor R3, pin4 of the LCD1602 display is connected to pin 28 of the STC89C52RC single chip microcomputer, pin 6 of the LCD1602 display is connected to pin 27 of the STC89C52RC single chip microcomputer, pin 7 of the LCD1602 display is connected to pin 39 of the STC89C52RC single chip microcomputer and pin 7 is connected to the power VCC through an exclusion J1, pin 8 of the LCD1602 display is connected to pin 38 of the STC89C52RC single chip microcomputer and pin 8 is connected to the power VCC through an exclusion J1, pin 9 of the LCD display is connected to pin 37 of the STC89C 52C RC and pin 9 is connected to the power VCC through an exclusion J48J 4 single chip microcomputer, pin 1602 and pin 10 of the LCD1602 is connected to pin 1J 1, pin 11 of LCD1602 display screen is connected with pin 35 of STC89C52RC singlechip and pin 11 is through excluding resistor J1 and connecting the power VCC, pin 12 of LCD1602 display screen is connected with pin 34 of STC89C52RC singlechip and pin 12 is through excluding resistor J1 and connecting the power VCC, pin 13 of LCD1602 display screen is connected with pin 33 of STC89C52RC singlechip and pin 13 is through excluding resistor J1 and connecting the power VCC, pin 14 of LCD1602 display screen is connected with pin 32 of STC89C52RC singlechip and pin 14 is through excluding resistor J1 and connecting the power VCC.
In the liquid crystal display circuit, an LCD1602 backlight type liquid crystal display is adopted as a data display module, and a 5.1K exclusion is added at a data port, so that the reliability of data transmission is improved.
In this embodiment, as shown in fig. 2, the buzzer alarm circuit includes a resistor R7, a transistor Q2, and a buzzer B1, one end of the resistor R7 is connected to a pin 7 of the STC89C52RC single chip microcomputer, the other end of the resistor R7 is connected to a base of a transistor Q2, an emitter of the transistor Q2 is connected to the power VCC, a collector of the transistor Q2 is connected to an anode of the buzzer B1, and a cathode of the buzzer B1 is connected to a ground line.
In the buzzer alarm circuit, in order to ensure that the humidity of the soil around the root system of the controlled object crop is in a set range, a buzzer is adopted as an alarm part. When the data transmitted back by the soil humidity sensor module in the single chip microcomputer is lower than a set value, the buzzer gives an alarm, and when the soil humidity around the crops is restored to a reasonable range, the buzzer stops working.
In this embodiment, as shown in fig. 2, the air temperature and humidity acquisition circuit includes a DHT11 temperature and humidity sensor, pin4 of the DHT11 temperature and humidity sensor is connected to a ground, pin1 of the DHT11 temperature and humidity sensor is connected to a power supply VCC, and pin2 of the DHT11 temperature and humidity sensor is connected to pin 12 of the STC89C52RC single chip microcomputer.
In the air temperature and humidity acquisition circuit, a DHT11 digital temperature and humidity sensor is adopted, and after data are acquired, the DHT11 directly sends binary data information to the outside. The humidity acquisition is completed by a wet-sensing resistor inside, the temperature acquisition function is completed by a thermistor, a single-wire serial interface is adopted for an interface with the MCU, data is transmitted according to bits, and a single-bus data transmission format is adopted.
In fig. 2, P3 is a recording port.
Fig. 2 is a schematic circuit diagram, which adopts modularization to divide each function of the system into different independent module circuits, and the programming software tool is KEIL 4. The system main program mainly comprises initialization of each component, YL69 moisture collection, Analog To Digital conversion, 1602 display and the like. The YL-69 soil humidity sensor measures a soil humidity analog value, then performs digital-to-analog conversion on the measured analog value, transmits the binary number obtained by conversion to the single chip microcomputer, and the 89C52RC receives data for analysis, control and display. After the system is powered on or reset, initialization operation of each part can be carried out, moisture signals are continuously collected, whether the humidity value is in a reasonable interval or not is judged, and if the humidity value is lower than a set survival threshold value of crops, the relay and the water pump act. The whole working principle is the same as that in fig. 2, and is not described again.
The design comprises two parts of detection and control of soil moisture and collection of external air temperature and humidity. The soil moisture acquisition and display uses a soil moisture sensor as a sensing part, transmits the measured soil moisture value to an STC89C52 single chip microcomputer in real time, and then the single chip microcomputer controls an LCD display to display. The automatic control system for drip irrigation has the advantages of low cost of each part, high reliability, flexibility and easiness in adjustment, and wide application prospect in irrigation.
Tests show that the circuit is reliable in work, low in cost and high in practical application value, and can be popularized to agricultural irrigation related industries. Through tests, the whole control system works well, has certain anti-interference capability and has important significance in the fields of agricultural irrigation related industries.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are also intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.