top of page
Ultrasonic Sensor

Testing

The ultrasonic sensor is the device being used to monitor and regulate the amount of water that the garden uses. Before putting it into the system, I had to test the sensor and make sure it would read properly, and that the equation to use was correct. Here I hooked up the sensor to the breadboard to better manage the test. The sensor has four pins, and from top to bottom, the pins are ground, ECHO, TRIGGER, and VCC. The ECHO and TRIGGER pins are controlled with the microcontroller, and I use 5 volts from the board as well.

To test the sensor, I connect the oscilloscope to the ECHO pin, and read the pulse width, which gets wider as the distance increases. So, I have everything fixed to a desk, and slide the box to adjust distance, which returns as an amount of time. To calculate the distance from this time, we use the equation D=(ΔT/2)*13503.9 in/second. Of course, to use this equation, we must first convert the ΔT to seconds. From using this equation, in this scenario, the distance comes out to 10.8 in.

Moisture Sensor

The moisture sensor can give analog and digital reading. For the purposes of this project, I am using the analog readings from the KL25z. When the sensor is in saturated soil, the readings are low, and when the soil is dry the readings are high.

I based the water needed for the plants off an amount that would be easy for the ultrasonic to sense. So, I chose to use .75 gallons. Each time the reading is taken from the moisture sensor, it bases the moisture percentage it is at from the ADC value from the board. It then tries to reach 60%, so if the soil is at 40%, it should try to add 20% of the .75 gallons to the garden.

Thermistor

The thermistor determines what the garden needs as far as shade is concerned. If the temperature in the garden is too high, we need the shade to block the sun. However, if the temperature is cool enough, we need to allow sunlight into the garden.

Here, I am showing the testing of the thermistor. I have 2 glasses of water, one with hot water and the other with cold. The higher the temperature, the higher the ADC reading. Here, we can see the glass that the thermistor is in, is the hot water, because of how high the reading is.

bottom of page