ELM Home Page


September 3, 2017

Automatic Watering System


In the summer, temporary vertical planting, called green curtain, is well done as sun shade. It is with vines climbing on the net that fixed off from the wall. It is typically planted in the pots because the plant for such use is usually annual plant and it needs to be put away at end of the season. However the vines consume much water and the soil dries up quickly, so that it needs to be watered two times a day.

This project is to water the planting pots with an unmaned watering system.

Functions

Wartering Controls


12V/1A Submersible Water Pump

There are two methods to control the water flow, bulb and pump. The first one is used when the water supply network is available. The second one is used when the water comes from the well, water tank or any unpressured system. This project uses a water pump to use the water in the pit.

Soil Moisture Sensing

Simple waterning control system supplies the constant amount of water in only timer controlled. But it waters without any consideration in condition of the soil and causes a waste of water and root rot. To avoid this problem, it needs to detect the soil moisture in order to maintain proper condition of the soil. In this project, the watering controller detects the soil moisture in conductance of the soil.

Power Sypply

There is a common problem in the off-grid system, how to power the system. When the system consumes considerble power for the battery and needs to work a long term without maintenance, any stand-alone power system, such as solar panel or nuclear battery, will be needed. However this system consumes few power and the installed place is easy to access, so that I made it in simple battery powered system, with eight AA-type Eneloops.

Hardware

Figure 1. Circuit board and the schematic.

Figure 1 shows the built controller borad and the schematic. It is controlled with an 8-pin AVR microcontroller but also any other microcontroller will able to be used with ease. The microcontroller is powered with a series regulator. To achive low idle current, the regulator IC needs to be a very low power C-MOS regulator.

Measures Soil Moisture

This is the key feature of the project. There are some methods to measure the soil moisture and most measurement systems seem to measure it from electric conductivity or dielectric constant the soil. Both the conductivity and dielectric constant of the water are high compared to the characteristics of dried soil, so that it can estimate the soil moisture in these parameters. In this project, the electric conductivity (the resistance) is used to detect the soil moisture.

The electric conductivity of water is by electrolyte (salt, acid and base) dissolved in the water. This is the same thing as measureing the electrolyte solution. However a consideration is needed to measure the resistance of electrolyte solution because the conductance goes down immediately (this is the phenomenon called electrochemical polarization) when measure it with DC. Ths is due to consumption of electrolyte around the electrodes by DC and the created thin film of lean electrolyte solution covers the electrodes. To avoid this problem, it needs to be measured with AC or pulse current. This project measurs it with pulse current.

Figure 2. Measurement of resistance

Figure 2 shows the timing chart of the measurement. The GPIO port PB4 is in low level output when it is out of measurement. The port is driven high to charge C3 and then put Hi-Z state. C3 will discharge via the electrodes set in the soil and port input goes low. Thus, the soil resistance can be known from the discarge time without A-D converter. The measurement time is less than several milliseconds in interval of a minute, so that the electrochemical polarization and corrosion will be out of consideration in most case.

Software

Figure 3. State Diagram

Because the controller is powered by a battery, idle power consumption needs to be reduced as possible. The control program is written as state machine driven by timer interrupt (wake-up from POWER_DOWN_MODE periodically). There are theree states, Idle, Pumping and Shutdown. The current state can be known by LED indicator.

Idle State (LED indicator = Blink) is to wait for the condition to start the watering. The control is at Idle stete in most working period. LED indicator lightes 30 milliseconds every second to reduce power consumption. The soil resistance is measured every minute. When the waterning condition is detected or SW1 is pressed, the state changes to Pumping state.

Pumping State (LED indicator = On) is to supply the water with the water pump. After the elapse of defined watering time or SW1 is pressed, the state returns to Idle state. In this state, battery voltage is continuously monitored to check if the battery is good. If low battery is detected (battery voltage gtes below the threshold for 0.5 seconds), it changes to Shutdown state. In this project, the waterning time is set to a minute and each waternig are left four hours at least. These times should be adjusted for each project.

Shutdown State (LED indicator = Off) is low power state with all operation stopped. This type of systems stay at Idle stete and it would not be known if it is working or not, so that any low battery indication might be needed. The battery life is estimated about a month if it waters two times a day.

Determins the Waterning Condition

Figure 4. Variation of soil resistance

The working range of soil resistance depends on the size of electrode, soil type and concentration of electrolyte, so that I measured the soil resistance over several days to determine the threshold. Figure 4 shows the variation of soil registance in the flower pot. When the soil dries up, the resistance gets over 10 kohms. When the soil is watered, the resistance gets down to 1-2 kohms and the resistance increases as the water is consumed. You will find the water consumption in the night is slower than water consumption in the day from the resistance curve. From this data, threshold of waterning is set to 8 kohms for this project.

Resources

Sign