Braxton BowenKelvin Turner
Published

Smart Pet System

System that alerts when water in the water bowl needs to be refilled and when pets are fed.

IntermediateFull instructions provided4 hours158
Smart Pet System

Things used in this project

Hardware components

Argon
Particle Argon
×2
LED (generic)
LED (generic)
×2
Elegoo Water Level Sensor
×1
Elegoo Button
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×2
Water Bowl
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Maker service
IFTTT Maker service

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

Particle Argon with Water Sensor Connected

Particle Argon with Button Sensor Attached

Code

Particle Argon with Water Sensor Connected

C/C++
int wtr = A0;
int LED = D7;
int analogValue;

void setup() {

pinMode(wtr, INPUT);
pinMode(LED, OUTPUT);
Particle.subscribe("button-pressed", on);
}

void on(const char *event, const char *data) 
   
  {digitalWrite(LED,HIGH);
  delay(5000);
  digitalWrite(LED,LOW);
}
void loop() {
analogValue = analogRead(wtr);
if (analogValue<=500){
        Particle.publish("Water_Level_Low", "low");
        delay(10000);
        
    }
      else if (analogValue>500){
        Particle.publish("Water_Level_Good", "good");
        delay(1000);

}}

Particle Argon with Button Connected

C/C++
int button = D4;
int LED = D7;
int digitalValue;


void setup() {
pinMode(button, INPUT);
pinMode(LED, OUTPUT);
Particle.subscribe("Water_Level_Low", low);

}
void low(const char *event, const char *data) 
   
  {digitalWrite(LED,HIGH);
  delay(5000);
  digitalWrite(LED,LOW);
}

void loop() {
 digitalValue = digitalRead(button);
 if (digitalValue == 0) {
    Particle.publish("button-pressed","on");
    delay(1000);

}}

Credits

Braxton Bowen

Braxton Bowen

1 project • 0 followers
Kelvin Turner

Kelvin Turner

1 project • 0 followers

Comments

Add projectSign up / Login