Week3 — Plant Sensor

Stacy Yuan
Stacy’s ITP Blog
Published in
2 min readFeb 19, 2020

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.

Final setting my sensor!

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.

Part of the Arduino code
Part of the Arduino code
Data shows in the serial monitor

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.

--

--

No responses yet