In today's busy world, we forget to nourish and water plants that makes our home clean and soothing. Think about it what if your plants are able to tell you when they are happy and when they require proper attention. It would be awesome right! It would be really helpful if we get a notification on our phones about our plant's health and needs. Taking account of this we came up with the idea of building a smart garden with IoT plant monitoring system. It checks the moisture content of the soil and intensity of sunlight falling on plant at regular time intervals. After the data is processed and verified by a logic created using Integromat, accordingly an SMS is sent about the plant's health. It will make our life simple and easy and will also help us to take better care of our plants. So let's get started!
Gathering all the required componentsAll the components required for the project are mentioned below and are easily available in market at reasonable price.
1. Soil Sensor
2. BoltIoT
3. LDR
4. Jumper wires (Male/Male)
5. Mobile Charger
6. Header pins (Female)
Bolt IoT platform gives you the capability to control your devices and collect data from IoT devices safely and securely no matter where you are. Get actionable insights by deploying machine learning algorithms with just a few clicks to detect anomalies as well as predict sensor values. To know more visit boltiot.com.
IntegromatThe role of Integromat is to seamlessly connect your apps/services, so you can concentrate on new tasks rather than repeating the same tasks again and again. Get back to what matters the most.
Integromat works by linking together your favorite apps/services by their corresponding modules to create a scenario that will transfer and transform your data automatically for you. All you have to do is create a scenario that will watch for new data in one app/service, set-up the proceeding modules for the desired end result and Integromat will execute the task for you.
NOTE: To learn more about Integromat visit help.
TwilioTwilio is a cloud communicationsplatform as a service company based in San Francisco, California. Twilio allows software developersto programmatically make and receive phone callsand send and receive text messagesusing its web serviceAPIs. Know more at twilio.com.
Assembling the hardware1. Get all the required components.
2. Connect one end of the LDR to pin A0 and other with 3.3V supply of the Bolt.
3. Connect a 10k Ohm resistor between A0 and GND pins of the Bolt.
4. Now connect the soil sensor probe to it's amplifier circuit using female/female jumper wires and connect the Vcc, GND and DO (Digital Output) pins of the amplifier circuit to 3.3V, GND and pin 0 of the Bolt unit respectively using the female header connectors. Remember to connect only these 3, not the analog output of amplifier circuit.
5. Place the soil sensor probe into the plant and power up the Bolt.
NOTE: Check all the connections before powering up Bolt and for any help look into the schematic.
After assembling the hardware, register and connect the Bolt unit to the Bolt Cloud. Know more at registering and connecting bolt to cloud.
Building up the logic on Integromat1. First make an account on Integromat using the link.
2. After setting up the account, create a new scenario using the 'Create a new scenario' button located on the top right corner in dashboard.. For any help follow this link.
3. In the services choose BoltIIoT and Twilio.
4. Now using the services build the required logic flow as shown in figure. For any help follow this link.
5. After building the logic now we need to enter the credentials for the services being used. i.e Bolt device ID and the API key for the BoltIoT service and SSID, Authentication token number, sender's number for the Twilio service. You can found all these at cloud.boltiot.com and twilio.com respectively. Look in the images below for further help.
Also fill the required command along with the pin no. for the BoltIoT service and the required SMS along with recipient's number to be send for Twilio service.
6. Get the current time and set the upper time limit and lower time limit by using the set variable tool. Fill the variable name and variable value according to your requirement. For ex.:
{formatDate(now; "HH.mm"; "Asia/Kolkata")}
This command gives the current time in 24 hour clock in decimal.
{formatDate(addHours("2016-12-08T06:00:00"; 11); "HH.mm"; "Asia/Kolkata")}
This returns the upper time limit of 17.00 (in our case) in decimal.
{formatDate(addHours("2016-12-08T00:00:00"; 6); "HH.mm"; "Asia/Kolkata")}
This returns the lower time limit of 6.00 (in our case) in decimal.
7. Attach resume error handler to both BoltIoT services in order to prevent Integromat from stopping the scenario automatically in case of any error. In the handler use any number that is to be assigned to the Bolt in case of error. For ex. 12345 (in case of our) as shown in the image below.
8. Apply time barrier and error filter to the router's input branch and moisture content and light intensity filter to each of the router's output branch as shown below.
9. For Twilio service use your SSID, authentication key and sender's number provided on the Twilio dashboard. If you don't have Twilio account please go through this link and make one.
10. After successfully creating the logic, run to check for any errors.
11. Finally schedule your scenario according to your requirements and save it. In our case the scenario will run after every 30 minutes.
NOTE: Please don't forget to save your work before closing it.
Working principleThe working principle is very simple, the soil sensor measures the moisture content present in the soil and LDR measures the light intensity falling on the plant. Both the data are read by the Bolt unit and send to Integromat logic whenever a read request is arrived.
In case of soil sensor if the moisture content is less than the threshold value (set by the user), the output of the sensor is LOW otherwise it is HIGH. This digital data is read from the pin 0 of the Bolt. In case of LDR analog data is read from the A0 pin of the Bolt.
NOTE - The A0 pin of the Bolt have an input range of 0-1V. Hence we used 3.3V instead of 5V to power up the device.
In the Integromat logic when the scenario is run, BoltIoT App send a digital read and analog read request to the Bolt to get moisture content and light intensity data. After that three set variable tools are required to get the current time and to set the operation time of the scenario. A router is send different SMS to the user based on the data received. For determining which message has to be delivered, each branch connecting Twilio and router is set with a filter having certain conditions.
In case to handle any kind of error a resume error handler is attached to both of the BoltIoT services. Handler assigns a specific user ID to the BoltIoT in case of an error so that we can filter it out later at the input branch of the router.
First the system will check whether it is daytime or not and should it run the rest of scenario or not. If it's daytime then it checks for an error (if errors are not checked the scenario will be stopped by Integromat).
The system checks for error by comparing the user id of each BoltIoT service with one set by error handler. If an error is found by the system it marks the scenario as success and retry in another interval.
If system finds all the condition satisfied then it send an SMS to the user alerting him about the plant health.
Comments