My journey through the MIT course
This week's task was to add a sensor to a microcontroller board that we have designed and read it.
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.
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); }
The sensor was tested in both wet and dry soil conditions. Here are the observations and results:
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.
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.