Plant Caring

Made by Lin Xu

Found in DioT 2019: Internet of Plants

This IoT device is designed to protect the plant from hurt. It will release a sound and light when someone is touching or treading on it.

0

Solution

How to protect a plant can always brother a plant-owner, especially for some parents with young kids. The young kids always touch even squeeze the plant hardly driving by their strong curiosity. For some poor plants, their life ended miserably by this torment. In order to solve this problem, I built up a device that is able to beep and lighten when it detects touch and squeeze. The plant owners can attract by the noise and light and stop their naughty kids, then save the plant on time. 

0

Approach

As a  novice in IoT, my approach is to minimize my work and maximize my utility to solve a real-life problem. I came up with my idea by using the sensor I have had already and familiar with. Since my family has a young kid who always kills the plant, this becomes the problem that I desire to solve the most. 

0

Process

1. Complete a circuit with only the LED lightbulb

2.  Write the code and transfer to the Argon to check the LED lightbulb can work or not

3. The LED lightbulb works

4. Complete a circuit with the LED light and speaker

5. Write the code and transfer to the Argon to check the speaker can beep or not

6. The speaker beeps

7. Add an FSR resistor 

8. Write the code and make sure when I squeeze the FSR resistor, the speaker would beep and the LED lightbulb would shine simultaneously. When I release the FSR, there is no sound and the light is off.  

9. Share sensor information on the internet

0

Implementation

Parts Used:

Particle Microcontroller

Jumper Wires

Breadboard

1 FSR resistor

2 1kΩ Resistor

1 Red LED

1 10kΩ Resistor

1 Speaker

0

Circut Diagram

0

Video

0
0

Code

0
int ledPin = D2;
int speakerPin = D4;
int melody[] = {1908,2551,2551,2273,2551,0,2024,1908}; 
int noteDurations[] = {4,8,8,4,4,4,4,4 };
int fsrPin = A0;
int fsrReading = 0;
int last_published = -1;



void setup() {
  pinMode(ledPin, OUTPUT);
  Particle.variable("force", &fsrReading, INT);
}


void loop() {
  fsrReading = analogRead(fsrPin);
  
  if(fsrReading > 1000 ){
    digitalWrite(ledPin, HIGH);   
    delay(100);               
    digitalWrite(ledPin, LOW);   
    delay(100);  
    
    digitalWrite(ledPin, HIGH);   
    delay(100);               
    digitalWrite(ledPin, LOW);   
    delay(100);  

    digitalWrite(ledPin, HIGH);   
    delay(100);               
    digitalWrite(ledPin, LOW);   
    delay(100);  

    playNotes();
}else{
	digitalWrite(ledPin, LOW );
}



}

void playNotes()
{
    // iterate over the notes of the melody:
    for (int thisNote = 0; thisNote < 8; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 1000/noteDurations[thisNote];
      tone(speakerPin, melody[thisNote],noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
      // stop the tone playing:
      noTone(speakerPin);
    }
}

void log_to_spreadsheet(  ){

  // check if 1 minute has elapsed
	if( last_published + 60000 < millis() ){
		Particle.publish( "log_to_spreadsheet", String(fsrReading   ) );
		last_published = millis();
	}

}
Click to Expand
0

Reflection

I am excited about my work and I think it can solve the problem that my family has. I feel good because I can utilize the thing I learned from the class to a real-life project.

0

Next Steps

1. Volume up the speaker so it can attract the attention from the plant-owner more effectively

2. Enable to connect the device to the phone or other removable devices, so the plant-owners can check the plant anytime and anywhere

3. Make the FSR resistor invisible and stick on the plants to make sure it can work out successfully

0

Connect to the Internet

This device is connected to Google Drive via IFTTT. A Google Sheet was generated with collected data on the amount of light detected on a per-minute basis. A 10-hour monitor was then conducted. 

x
Share this Project

Courses

49713 Designing for the Internet of Things

· 16 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

This IoT device is designed to protect the plant from hurt. It will release a sound and light when someone is touching or treading on it.

Created

November 7th, 2019