How to Make Almost Anything

My journey through the MIT course

Week 8: Input Devices

This week's task was to add a sensor to a microcontroller board that we have designed and read it.

Week 8: Input Devices

Experimentation with Soil Moisture Sensor

To approximate a threshold value, I inserted the sensor into dry soil and gradually watered it, observing changes in the sensor's readings. This process helped in estimating the moisture level at which the soil transitions from dry to adequately moist.

Code for Sensor Testing

The following code was uploaded to the development board to monitor soil moisture levels and determine whether the plant needs watering.

      const int MOISTURE_SENSOR = 4;

      void setup() {
        Serial.begin(115200);  
      }
      void loop() {
        int value = analogRead(MOISTURE_SENSOR);
        Serial.print("Moisture value: ");
        Serial.println(value);

        delay(500);
      }
    

Results and Observations

The sensor was tested in both wet and dry soil conditions. Here are the observations and results:

Considerations for Final Project

To avoid overwatering (false positives), I plan to implement batch averaging of moisture values and consider the time since the last watering as an additional factor. This strategy will help in fine-tuning the watering system for better accuracy and efficiency. Further development on this concept will be discussed in Week 0: Final Project.

Conclusion

This week's exploration into soil moisture sensing has been crucial in shaping the direction of my final project. The insights gained from these experiments will play a key role in developing an effective and reliable automated plant watering system.