Things used in this project

Hardware components:
11026 02
Jumper wires (generic)
×6
13637 01
SparkFun Soil Moisture Sensor (with Screw Terminals)
×1
Photon new
Particle Photon
×2
12002 04
Breadboard (generic)
×2
826 04
Male/Female Jumper Wires
×3
Rg srv180 a
RobotGeek 180 Degree Robot Servo
Simple Servo Motor; EMF
×1
Software apps and online services:
Q8wtlimqnp04fzhtr9v5
IFTTT Maker service
Hackster
ThingSpeak API

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

SoilStatusC/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);

}
ServoC/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

Ea118be236073c46b15fbcc556c4be80
Kim T.
1 project • 0 followers
Mechanical Engineering Student
Contact
1ac956e41cadca0c7e6edcd28b4c5a46
Brian
1 project • 0 followers
UNCC Mechanical Engineering Student
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login