We'll use a service call Carriots to handle the data and display it nicely on a webpage. Then, an email or SMS alert can be send to you automatically if the moisture falls below a given threshold. The picture below represents the system when fully assembled and with the sensor buried into the soil next to a plant:
We'll use a service call Carriots to handle the data and display it nicely on a webpage. Then, an email or SMS alert can be send to you automatically if the moisture falls below a given threshold. The picture below represents the system when fully assembled and with the sensor buried into the soil next to a plant:
Setting up your Carriots account
Connections
To measure the temperature & humidity in the soil, you will need an appropriate sensor. For this guide, I used the Soil Temperature/Moisture sensor from Adafruit, which is based on the SHT10 sensor from Sensirion. It's quite easy to use with Arduino as there is a dedicated library, so it will be easy to interface with our project.
Finally, you need a breadboard and some jumper wires to make the connections between the different parts.
Basically, you need to connect the IRQ pin of the CC3000 board to pin number 3 of the Arduino board, VBAT to pin 5, and CS to pin 10. Then, you need to connect the SPI pins to the Arduino board: MOSI, MISO, and CLK go to pins 11,12, and 13, respectively. Finally, take care of the power supply: Vin goes to the Arduino 5V, and GND to GND.
Arduino sketch
The code for this project can be found on the GitHub repository for the project.
I won't detail everything here, you can have a look at the Arduino & Xively project for more details, and of course you can find all the code on our GitHub repository for this project. The first difference with other cloud services is that you need to set your API key in the sketch, but also the device you want to send data to:
#define WEBSITE "api.carriots.com" #define API_KEY "yourAPIkey" #define DEVICE "[email protected]"
{ "protocol":"v2", "at":"now", "device":"[email protected]", "data":{ "Temperature":"21.05", "Humidity":"58.50" }, "checksum":"" }
You can get the whole Arduino sketch from the GitHub repository, modify the required parts like your WiFi SSID & password and your Carriots account data, and finally upload the code to your Arduino board. You can now open the serial monitor and check if the Arduino is sending data to the Carriots server:
Sending data to Carriots
Creating an email alert
I then applied some heat on the sensor, and I immediately received an email when a data point above 23 degrees was recorded:
You can also add listeners on other variables, and send an SMS to your phone instead of an email. Of course, you can find the whole code for this project on the GitHub repository of the project.
That's all for this article, keep in mind that you can use what you've learned in this guide for a lot of other fields than gardening! You can connect multiple sensors inside & outside of your home to the Carriots service, and create more complex conditions to send specific alerts based on the data you are recording. Have fun with the project, experiment with this cloud service, and share your creations!
This guide was first published on Jan 10, 2014. It was last updated on Jan 10, 2014.