In this paper, a multi-functional flower sensor is designed to detect and feedback the growth environment of flowers. The system can select flower types by keys, collect soil moisture information, temperature information and light intensity information in the process of flower growth through multiple sensors, and process data by Beetle microcontroller. Finally, the state is feedback by breathing lamp. With the acceleration of life rhythm, the urban fast-paced people represented by the above-mentioned workers have no time to learn how to take care of different plants, so they need a convenient smart device to help remind or replace people to take care of plants. At present, there are many related studies of the same type at home and abroad, but most of them focus on the detection of soil moisture, ignoring the collection of light and temperature information, and the collection of information is single. And the system mostly takes the watering device as the core, and the soil moisture sensor as the auxiliary module. For most long-term users at home, the watering device is not a necessary option, only need to accurately grasp the timing of watering plants; secondly, such a system has a large volume problem, occupying the growth space of flowers in the use process is not conducive to the growth of flowers.
The multi-functional flower sensor system based on Beetle microcontroller is a multi-functional sensor which mainly detects soil moisture and supplements light and temperature detection. The system realizes the collection and processing of environmental information of flowers and plants, and uses the breathing lamp to indicate the status. Because of the use of micro-controller and micro-sensor, the system is compact and occupies little space for flower growth in the process of use. At the same time, the system can be used alone, or multiple systems are equipped with an automatic watering device to realize the management of multi pots and flowers.
The system is based on Beetle microcontroller and powered by button batteries. The system includes data acquisition module of soil moisture, temperature and illumination information, status indicator module of tricolor breathing lamp, flower type selection module of keys and serial communication interface for connection with watering device. The system is initialized after booting, and different flower types are selected by counting the number of keystrokes, and the trigger thresholds of three kinds of information are modified.
At the end of initialization, three kinds of state information of the environment of flowers are collected regularly, and the standard state of the selected flowers is compared with that of the corrected calculation by single-chip computer. If one or more of the data do not meet the minimum living standard of flowers, the corresponding color LED lights are lit by breathing lamp driven by PWM wave. The farther the actual data deviate from the standard, the shorter the period of PWM wave and the faster the breathing rhythm. When a watering device is connected, if the soil moisture information is below the threshold value, the water shortage signal is transmitted to the watering device through the serial communication module while lighting the corresponding color breathing lamp.
Beetle is a minimalist version of Arduino Leonardo, with powerful application capabilities similar to Leonardo.
The controller is compact in size (20mm x 20mm), and is often used in the construction of micro-systems. It has many interfaces, such as PWM interface, digital interface, analog input interface, serial communication interface and so on. It can carry many kinds of peripherals. The data acquisition module is mainly composed of Moisture Sensor soil moisture sensor, LM35 linear analog temperature sensor and LX1972 analog environmental light sensor, which are responsible for collecting soil moisture, temperature and light intensity information of plants.
The structure and interface of the three sensors are similar, including VCC, GND and OUT. The OUT of three sensors are connected to Beetle’s A 0, A 1 and A 2 respectively.
The data information collected by the sensor is output by OUT port in the form of analog quantity. Beetle’s analog port converts analog information into digital quantity through 10-bit ADC for calculation.
Taking Moisture Sensor soil humidity sensor as an example, the working principle is expounded. The soil humidity sensor determines the humidity of soil by determining the moisture content in soil. When the soil moisture sensor is inserted into the soil, there is resistance value between the two probes. The resistance value is related to the soil moisture, and the larger the soil moisture, the smaller the resistance value. As shown in Figure 3, when the probe of the soil moisture sensor is suspended, the base of the transistor is in an open circuit state, and the cut-off output of the transistor is 0. When the transistor is inserted into the soil, because of the different moisture content in the soil, the resistance of the soil is different. The base of the transistor provides a conduction current of varying magnitude. The conduction current of the transistor from the electrode to the emitter is controlled by the base, and the pull-down resistance of the emitter is controlled by the base. After conversion, the voltage is output by out. Beetle controller reads voltage information through A0 analog input port and calculates it after 10-bit ADC conversion. After the system starts, 9, 10 and 11 ports pull down and extinguish the LED lights.
Initialization requires the selection of flower types, while pressing the SW 1 and SW2 buttons will enter the flower type selection state. 9, 10 and 11 ports of LED lights will be raised and lit to indicate the entry of the selection state. SDA and SCL counts the number of descending edges. If there is no descending edge signal for 5 seconds, the LED lamp will be extinguished at the end of the selection. By counting and judging the selected flower types, the growth needs of different types of flowers have been put in advance. After judging the flower types, the system obtains data by looking up tables, and modifies relevant trigger thresholds. After initialization, the open interrupt enters the cyclic scanning state. The timer triggers an interruption every certain time. The interruption service program reads the data of each sensor and stores them in storage. The collected data is cleared every 24 hours. For example, when the detected humidity information does not meet the needs of flower growth, according to the actual value and standard value difference, different periods are output to A0 port, and the duty cycle increases and decreases. The greater the difference, the shorter the period of PWM wave and the quicker the breathing rhythm. The corresponding color LED lights gradually light up and fade out according to a certain rhythm, indicating the status to the user. If there is an automatic watering device, light up the LED lamp while communicating with the watering device through TX and RX.
The watering signal is sent to the watering device. After receiving the water shortage signal, the watering device opens the water pump and carries out a small amount of watering to the flower, then closes the pump. After watering, the system communicates with the system and then detects the soil moisture information again. If it detects that the flowers are still short of water, it repeats the above operation. If it detects that the soil moisture meets the growth needs of flowers, it will no longer send water requests to the automatic watering device.
The control method can be adapted to different size of flower pots, avoiding water overflow and affecting flower growth caused by excessive watering. The detection of illumination intensity is different from that of soil moisture and temperature. If the illumination intensity does not meet the requirement, the user will be instructed, which will cause the system to constantly prompt the illumination shortage at night. The solution adopted is that all the light intensity collected by the storage system day and night, weighted average of all the light intensity information collected every 24 hours to determine whether the environment of flowers is full of light. If the way of data acquisition by sensors in fixed period is too single, there is a clear gap between the two acquisitions, which will lead to the lack of flexibility in data acquisition. By analyzing the data flexibly and adjusting the frequency of detection, we can solve the problem very well. The lower limit of soil moisture and early warning line for flower growth were set, and the early warning line was higher than the lower limit of soil moisture. Soil moisture decreases with the increase of time. When it is higher than the warning line, it is detected at a slower frequency. After reaching the warning line, the detection frequency is increased, and when it is lower than the lower limit of soil moisture, the detection frequency is increased and the warning indication is given. There are many different levels of warning lines in the actual process. The closer the actual soil moisture is to the lower limit of moisture, the higher the detection frequency. This design takes Beetle microprocessor as the core to construct a multifunctional flower sensor system which integrates data acquisition, data processing and state response. It realizes the perception and alarm of flower growth environment. The system itself can be used alone to remind users to care for flowers in a timely manner, and can also be equipped with automatic watering device to realize unattended plants. At present, it has been made into physical objects, which are compact in size, beautiful in shape and have great market potential. At present, the main problem is that the probe of Moisture Sensor soil moisture sensor can only be inserted in the surface layer of soil, and only the moisture information of shallow soil can be obtained, which can not directly reflect the overall soil moisture level. The following main work will focus on establishing a reasonable mathematical model through Darcy’s law, finding out the relationship between surface soil moisture information and the overall soil moisture level, thermostatic element and further improving the detection accuracy.