Smart Dog Bowl

Our Smart Dog Bowl combines a simple dog bowl with the latest technology.

IntermediateShowcase (no instructions)4 hours101
Smart Dog Bowl

Things used in this project

Hardware components

Argon
Particle Argon
×3
Breadboard (generic)
Breadboard (generic)
×3
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Jumper wires (generic)
Jumper wires (generic)
×22
Resistor 220 ohm
Resistor 220 ohm
×1
Variable Resistor
×1
Water Level Sensor
×1
LED
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Google Docs

Story

Read more

Schematics

Water Level Sensor

The Water Level Sensor detects the level of water in the dog bowl.

LED Sensor

The LED burns green when the dog bowl is adequately charged. This also indicates that the system is connected and working.

LCD Screen

The LCD Screen displays a value of "High", "Low" , or "Medium" according to what the Water Level Sensor detects in the bowl.

Code

LED Code

C/C++
int waterVal;
int led = D7;
void setup() {
    
pinMode(led, OUTPUT);

Particle.subscribe("Wwaterbowl5678", Level, "LOW    ");


}

void loop() {
    
}

void Level(const char *event, const char *data) {
    
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
        digitalWrite(led, LOW);
        delay(1000);
        digitalWrite(led, HIGH);
        delay(1000);
      

  }

LCD Code

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <LiquidCrystal.h>


LiquidCrystal lcd(5, 4, 3, 2, 1, 0);


void setup() {

    lcd.clear();
    lcd.begin(16, 2);
    lcd.setCursor(0,0);
    lcd.print("Water Level"); //Print line 1: Water Level 
    Particle.subscribe("waterbowl5678", Level, "LOW");
    Particle.subscribe("waterbowl5678", Level, "MEDIUM");
    Particle.subscribe("waterbowl5678", Level, "HIGH");

}

void loop() {

}

void Level(const char *event, const char *data) {


    lcd.setCursor(0,1);
    lcd.print(data);          //Print line 2: LOW, MEDIUM, or HIGH
}

Water Level Code

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <JsonParserGeneratorRK.h>


int waterSens = A0; //define water sensor
int led = D7;//define led to pin 9
int waterVal; //define the water sensor value

void createEventPayload(int level)
{
 JsonWriterStatic<256> jw;
 {
   JsonWriterAutoObject obj(&jw);

   jw.insertKeyValue("waterbowl5678ig", level);
   
 }
}
Particle.publish("env-vals", jw.getBuffer(), PRIVATE);
createEventPayload(level);

void setup() {
pinMode(led, OUTPUT); //set led as an output
pinMode(waterSens, INPUT);//set water sensor as an input

}


void loop() {


  waterVal = analogRead(waterSens); //read the water sensor
  delay(1000);

String level = String(waterVal);
  Particle.publish("waterbowl5678ig", level, PRIVATE);
  delay(1000);

if (waterVal>0 && waterVal<=300){
    Particle.publish("waterbowl5678", "LOW   ",PRIVATE);
    
}
else if (waterVal>300 && waterVal<=600){
    Particle.publish("waterbowl5678","MEDIUM",PRIVATE);

}
else if (waterVal>600){
    Particle.publish("waterbowl5678", "HIGH  ",PRIVATE );



}

}

Credits

Landon Barbee

Landon Barbee

1 project • 1 follower
Nicholas Garrett Jones

Nicholas Garrett Jones

1 project • 1 follower
Kayla Lenz

Kayla Lenz

1 project • 2 followers

Comments

Add projectSign up / Login