Kim T.Brian
Published

Plant Monitor & WaterBomb

Simple way to monitor your plant's Moisture Levels and water from afar.

EasyFull instructions provided2 hours410
Plant Monitor & WaterBomb

Things used in this project

Hardware components

Jumper wires (generic)
Jumper wires (generic)
×6
SparkFun Soil Moisture Sensor (with Screw Terminals)
SparkFun Soil Moisture Sensor (with Screw Terminals)
×1
Photon
Particle Photon
×2
Breadboard (generic)
Breadboard (generic)
×2
Male/Female Jumper Wires
Male/Female Jumper Wires
×3
RobotGeek 180 Degree Robot Servo
RobotGeek 180 Degree Robot Servo
Simple Servo Motor; EMF
×1

Software apps and online services

Maker service
IFTTT Maker service
ThingSpeak API
ThingSpeak API

Story

Read more

Schematics

Photon Connected to Moisture Sensor

This is the schematic for the photon that is reading data from the moisture sensor.
Moisture sensor 9jqgnghm7s

Photon Connected to Servo

This is the schematic for the photon that is connected to the servo, which pops the balloon when the command #Detonate is sent via text to the IFTTT applet
Servo 6ciqvk0hnt

Code

SoilStatus

C/C++
This code is for the Moisture level tracker.
//Team SoilStatus -- K. Thach & B. Padgett
//Code to monitor soilstatus using Analog moisture counts from a Soil Moisture Stick.

//------------------------------
int thresholdup=6000;   //Count Threshold 
int thresholddown=350;  
const int sensorPin = A0;
int sensorValue=0;


void setup() 
{
  // put your setup code here, to run once:
pinMode(sensorPin, INPUT);

}

void loop()

{  // put your main code here, to run repeatedly:
int sensorValue;
sensorValue = analogRead(sensorPin);
if(sensorValue<=thresholddown)
{

Particle.publish("SoilStatus","DRY!",60,PUBLIC);
delay(5000);
}
else if (sensorValue>thresholdup)
{

  Particle.publish("SoilStatus","Swimming!",60,PUBLIC);
}
else
{
  Particle.publish("SoilStatus","OK!",60,PUBLIC);
}
delay(30000); //Checks every 5 minutes
Particle.publish("SoilStatus", String(sensorValue), 60, PUBLIC);

}

Servo

C/C++
This code works with IFTTT to move the servo arm.
//Team Soil Status
Servo myservo;  // create servo object to control a servo
int pos = 0;   // variable to store the servo position


void setup()
{
  myservo.attach(D0); 
  Particle.function("WaterBomb", WaterBomb);
  pinMode(D7, OUTPUT); 

}
void loop()
{
}
int WaterBomb(String command)
{
  if(command=="#Detonate")
  {
    myservo.write(0);
    digitalWrite(D7, HIGH);
    delay(100);
    myservo.write(45);      //Posiiton [degrees]
    digitalWrite(D7, LOW);
    Particle.publish("SoilStatus", "WaterBombed",60,PUBLIC);
        delay(1000);
    return 1;
  }
  else return -1;
}

Credits

Kim T.

Kim T.

1 project • 0 followers
Mechanical Engineering Student
Contact
Brian

Brian

1 project • 0 followers
UNCC Mechanical Engineering Student
Contact

Comments

Add projectSign up / Login