Week3 — Plant Sensor
For this assignment, we have to use soil sensor to read the data from the plants. Since we did the exercise in the class, I felt it’s easier for us to figure out how to add the soil sensor and send the data by MQTT.
I chose the plant right beside the plug at the hallway of ITP, so it’s easy to connect the power.
For the soil sensor code, I used the example code named TemperatureHumidityLED and add the anaolgRead A0 to read the value of the soil sensor in analog pin A0. Also, I added other topics for the MQTT in the same way as the temperature and humidity topic.
Because the original example code will publish the data every 10 seconds, which is too often, so I changed it to publish every 10 minutes.