Plet the plant plet

For more details, visit here.

Goal

This IOT solution is to explore the possibilities of interacting with plants like pets. By definition, pets are animals, but there is no essential reason that plants can’t be pets.  Pets should be able to provide companionship, emotional support and reduce stress levels. The main barrier for plants is the lack of reaction. In return, humans often feel plants as lifeless. 

With the help of Plet, owners are able to check the status of their plants, and the IOT device expresses “emotions” on behalf of the plant based on their conditions. 

Approach

The device is designed around the interactions the owner anticipates to have with its pet. The Plet should provide emotional support for the owner. 

Since the plant is unlikely to proactively attract attention with movements, the device with also initiate interactions with light, color of the light indicating emotions, and sound.  What’s more, occssional notifications enabled through IFTTT augments this sense of connection even beyond a pet experience, more like a child texting his mom. 

Features

  • Status – When the owner presses on the fsr, the Plet sends a notification to comfort the owner. 
  • Emotional expressions – The Plet responds to outside environment and constantly shows its feeling.
    • Green light: It’s growing! The lighting is suitable and Plet receives appropriate attention.Blue light: Now feeling sad
    • Red light: In danger! Light turns red when the owner has not devoted attention to Plet for a long time. (assuming no watering, the plant needs care)
    • Purple light: Feels happy. Purple light flickers when the owner tends to Plet and also when the temperature is especially suitable. 
// Define pins
int fsrPin = A0;
int fsrReading = 0;
int photoCellPin = A1;
int photoReading = 0;
int piezoPin = D3;
int piezoPitch = 2000;

int redPin = D2;    
int greenPin = D3;  
int bluePin = D4;   

// store the time when you last published
int last_published = -1;
//calculate interval between now and last_published
int interval=-1;
//store the time last fsr
int fsr_press=-1;
//calculate interval between now and fsr_press
int fsr_interval=-1;

int definedInterval=14400000; //4 hours
int maxNoCare=28800000;//8 hours

void setup() {
    
    pinMode( redPin, OUTPUT );
    pinMode( greenPin, OUTPUT );	
    pinMode( bluePin, OUTPUT );
    pinMode(piezoPin, OUTPUT);
    
    pinMode(fsrPin, INPUT); // MUSThave if used with variables other than direct readings
    pinMode(photoCellPin, INPUT);

    Particle.variable("fsr", &fsrReading, INT);
    Particle.variable("light", &photoReading, INT);
    //Particle.variable("r", &redValue );
    //Particle.variable("g", &greenValue );
    //Particle.variable("b", &blueValue);
}

void loop() {
    
    photoReading=analogRead(photoCellPin);
    fsrReading=analogRead(fsrPin); 
    
    interval = millis()-last_published;
    fsr_interval = millis()-fsr_press;
    
    if (fsrReading > 1500) 
    {
        fsr_press=millis();
    }
    
    //light and sound
    
    //Red light: In danger! Light turns red when the owner has not devoted attention to Plet for a long time. (assuming that no watering)
    if (fsr_interval > maxNoCare)
    {
        analogWrite(greenPin, 0);
        analogWrite(bluePin, 0); //make sure the other colors are 0
        for (int i; i<3; i++)
        {
            analogWrite(redPin, 255);
            tone(piezoPin,2000);
            delay(200);
            analogWrite(redPin, 0);
            noTone(piezoPin);
            delay(200);
        }
    }
    
    //Green light: It's growing! The lighting is suitable and Plet receives appropriate attention.
    else if (photoReading < 3500 && photoReading > 2500)
    {
        analogWrite(greenPin, 255);
        analogWrite(redPin, 0);
        analogWrite(bluePin, 0);
    }
    
    //Blue light: Now feeling sad
    else if (photoReading<1000 && fsr_interval > definedInterval)
    {
        analogWrite(bluePin, 255);
        analogWrite(redPin, 0);
        analogWrite(greenPin, 0);
    }
    
    //Purple light: Feels happy. Purple light flickers when the owner tends to Plet and also when the Piezo plays a tune. 
    else if (photoReading>1000 && fsr_interval < definedInterval) 
    {
        analogWrite(redPin, 255);
        analogWrite(bluePin, 255);
        analogWrite(greenPin, 0);
        for (int i; i<3; i++)
        {
            tone(piezoPin,2000);
            delay(100);
            noTone(piezoPin);
            delay(100);
        }
    }
    else //fall back
    {
        analogWrite(redPin, 0);
        analogWrite(bluePin, 0);
        analogWrite(greenPin, 0);
    }
    
    //publish event
    if (fsrReading >1500)
    {
        if (photoReading < 3500 && photoReading > 1500)
        {
            Particle.publish( "fsr_grow", "grow" );
            last_published=millis();
        }
        else
        {
            Particle.publish( "fsr_sad", "sad" );
            last_published=millis();
        }
    }
    else if (photoReading<1000 && interval > definedInterval)
    {
        Particle.publish( "fsr_sad", "sad" );
        last_published=millis();
    }
    else if (photoReading>1000 && interval > definedInterval)
    {
        Particle.publish( "fsr_happy", "happy" );
        last_published=millis();
    }
    
    delay(10000);
 }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s