49713 Designing for the Internet of Things
· 16 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Give plants back their right to be a pet!
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.
This IOT solution provides a way for owners to interact with their plants, so they receive same level of emotional comfort. 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.
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.
I ideated around how people already interact with their pets, how plants behave or are impacted by the environment, and what people would like to know about their plants.
Considering priorities and constraints, the functions are narrowed down to the following:
1. Sound: If attention is not received for a long time (e.g. 4 hours) the Piezo will play a tune at 10 minute intervals.
2. Status: When the owner presses on the fsr, the Plet sends a notification to comfort the owner.
3. Emotional expressions: The Plet responds to outside environment and constantly shows its feeling.
// 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);
}
Click to Expand
int fsrPin = A0;
int fsrReading = 0;
int redPin = D2;
int last_published = -1;
int interval=-1;
void setup() {
pinMode(fsrPin, INPUT);
Particle.variable("fsr", &fsrReading, INT);
}
void loop() {
fsrReading=analogRead(fsrPin);
if (fsrReading>1500)
{
Particle.publish( "fsr_happy", "happy" );
analogWrite(redPin, 255);
last_published=millis();
}
interval=millis()-last_published;
if (interval>60000){
Particle.publish( "fsr_sad", "sad" );
last_published=millis();
}
delay(1000);
}
Click to Expand
Adding wind detector and moisture detector will generate more possibilities of the Plet's emotion status in combination. It can offer also more data on the plant's growth which can be included in status updates for the owner to take better care of the Plet.
More user research could be done to determine whether the responses align with the user's expectations.
I sought help on the Internet. Sources I referenced and learnt from:
Also, thank Daragh, Andrew and Vaibhav for explanations during and after class.
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Give plants back their right to be a pet!
November 3rd, 2019