Scor LyMitchell Frazier
Published

Plant Monitoring System

No, this is not our plant, but it will be yours if you leave it unattended. Here's a way to keep it healthy with minimal effort.

IntermediateFull instructions provided9 hours1,774
Plant Monitoring System

Things used in this project

Hardware components

Grove - Temperature Sensor
Seeed Studio Grove - Temperature Sensor
×1
Grove - Capacitive Soil Moisture Sensor
Seeed Studio Grove - Capacitive Soil Moisture Sensor
×1
Argon
Particle Argon
×2
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×2
Jumper wires (generic)
Jumper wires (generic)
×2
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×2

Software apps and online services

Ubidots
Ubidots
Particle Build Web IDE
Particle Build Web IDE
Ultimaker Cura

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

3D Printed Planter

This was printed to put a plant in it. Extra thickness was added for the shell and bottom to prevent leaking.

Ubidots Graphs

Ubidots is a great IoT platform to work with. You can see the live data at any time.
The reason why it took us a long time to complete this project is due to the instruction on how to use Webhooks with Ubidots. The instruction was vague, so it took us hours to identify the problem.

Flow Chart

The diagram below explains the concept of this project

Circuit Diagram

Physically Built Circuit

Ubidots Events

An email and a message will be sent to my phone to alert me whenever:
•The temperature is above 32°C
•The temperature is below 15°C
•The moisture level is below 21%

Email Alert

An email and a text will be sent if the temperature or moisture level reaches extreme value thanks to Ubidots Event.

Temperature Graph

This picture shows the fluctuation of the temperature over the past week.

Bunny Ear Succulent Planter

To take care of this type of succulent, the soil must be constantly damp.

Code

Argon 1

C/C++
#include "Ubidots.h"
//Include the Ubidots library  file


const char *WEBHOOK_NAME = "Ubidots";
Ubidots ubidots("webhook", UBI_PARTICLE);


void setup()
{
  pinMode(D7, OUTPUT);
  Particle.subscribe("Argon 2 received", argon2, MY_DEVICES);
}

void loop()
{
    //Moisture Sensor
    double MoistValue = analogRead(A1);
    float MoistLevel = map(MoistValue, 0.0, 4095.0, 0.0, 100.0);
    
    //Temperature Sensor
    float a = analogRead(A2);
    
    //Data is sent to Ubidots to graph
    ubidots.add("Moisture", MoistLevel);
    ubidots.add("Temperature", temp);
    delay(1000);
    
    //Send data to Argon 2
    Particle.publish("Moisture Level", String(MoistLevel), PRIVATE);
    delay(1000);
    Particle.publish("Temp Level", String(temp), PRIVATE);
    delay(1000);
    
    //Confirmation
    Particle.publish("UbiSent", PRIVATE);
    
    bool bufferSent = false;
    //Use particle webhooks to send data
    bufferSent = ubidots.send(WEBHOOK_NAME, PUBLIC); 

    //Send new data to Ubidots every 5 minutes 
    delay(300000);
}
    //Blink to indicate that signal has been received by Argon 2
void argon2 (const char *event, const char *data) {
    digitalWrite(D7, HIGH);
    delay(500);
    digitalWrite(D7, LOW);
    delay(500);
    digitalWrite(D7, HIGH);
    delay(500);
    digitalWrite(D7, LOW);
    delay(1000);
}

Argon 2

C/C++
void setup() {
    pinMode(D7, OUTPUT);
    Particle.subscribe("Sent", sent, MY_DEVICES);
    Particle.subscribe("Moisture Level", ReceivedMoisture, MY_DEVICES);
    Particle.subscribe("Temp Level", ReceivedTemp, MY_DEVICES);
}

void loop() {
    Serial.begin(9600);
}

  //Received Data into Serial

void ReceivedMoisture(const char *event, const char *data) {
    Serial.print("Moisture Level: ");
    Serial.println(data);
}

void ReceivedTemp(const char *event, const char *data) {
    Serial.print("Temperature: ");
    Serial.println(data);
}

  //Argon will blink twice and send signal when it receives data from the Main Argon
void sent(const char *event, const char *data) {
    digitalWrite(D7, HIGH);
    delay(500);
    digitalWrite(D7, LOW);
    delay(500);
    digitalWrite(D7, HIGH);
    delay(500);
    digitalWrite(D7, LOW);
    Particle.publish("Argon 2 received", PRIVATE);
}

Credits

Scor Ly

Scor Ly

1 project • 3 followers
Mitchell Frazier

Mitchell Frazier

1 project • 2 followers

Comments

Add projectSign up / Login