Connect with your plant

Made by Rahul Vignesh Sekar

Found in DioT 2019: Internet of Plants

This smart IoT system aims to bring back the lost connect of homo sapiens with nature. With this IoT system, people get a chance to get closer to their plants at least once a day. Also, people are primed to associate a pleasant scent(could be their favourite perfume) as being near the plants(nature) thereby enacting the connection with nature a pleasurable one.

0

Solution

This smart IoT system aims to bring people to get closer to their plants at least once a day. Also, people are primed to associate a pleasant scent(could be their favourite perfume) as being near the plants(nature) thereby enacting the connection with nature a pleasurable one.

           

0
0

Approach

How did you approach the design of your device?

I used to grow two indoor plants in India before I started my studies here. To be more accurate, I was growing along with the plant. My best memory of growing the plant is that I used to water it every morning, as my first job after waking up. The few minutes of being near the plant made me happy. I liked the connect. In this project, I want to bring the same connection with an extra element of a pleasant smell.            

0

Process

What ideas did I generate and how did you I refine or reject them? What did I research and explore? what were the design choices? What challenges were encountered and how did I resolve them?

I did initially thought about using a soil moisture sensor, however, from my previous experience with using a rain sensor module, I know that the sensor anti-rust surface deteriorates after some time. So I decided not to use a soil moisture sensor. Also, my best memory growing a plant was getting closer near it every day. I wanted to augment getting closer to the plant with pleasurable sense and experience.       

Below are the Challenges I faced: 

  • Sporadic PIR sensor reading (this is still a problem, I fixed this by having. a lower threshold value) 
  • Servo continuously running 
  • I was trying to add timezone to my code (my initial project idea is to open the perfume box early in the morning at a specified time, I googled and tried to learn from the particle library, but I couldn't get my servo rotating. I couldn't debug this problem).   
  • Getting a melody for the plant. I tried adding melody inside the code, but due to time constraints, I saved this for later. 

0

Implementation

  • Completed code (Below)
  • A circuit diagram (Below)
  • A list of parts (attached)
0
int PIRPin = D2;
//define the pin we will connect the PIR sensor to
int PiezoPin = D2;
//define the pin we will connect the piezo sensor to
Servo myservo;
// create servo object to control a servo
int pos = 0;    
// variable to store the servo position
int ledPin = D4; 
//define the pin we will connect the LedPin to
int PIRReading = 0;
//initially assign PIR sensor as ZERO. This line of code is optional too.
int PiezoReading = 0;
//initially assign piezo as ZERO. This line of code is optional too.
int ledBrightness = 0;
//initially assign fsrReading as ZERO. This line of code is optional too.  
int i=0;
//declare a integer i to ZERO so that we can use it later
// store the time when you last published
int melody[] = {1000,1500,2000,2000,750,0,200,1700}; 
// create an array for the notes in the melody:
//C4,G3,G3,A3,G3,0,B3,C4
int noteDurations[] = {4,8,8,4,4,4,4,4 };
// create an array for the duration of notes.
// note durations: 4 = quarter note, 8 = eighth note, etc.
int last_published = -1;
int hour= Time.hour();
//get the hour value of the local time. 
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(PiezoPin, 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(PiezoPin);
    }
}
void log_to_spreadsheet(  )
{
  // check if 1 minute has elapsed
	if( last_published + 60000 < millis() )
	{
		Particle.publish( "log_to_spreadsheet", String( PIRReading ) );
		last_published = millis();
	}
}

void setup()
{
    
  pinMode(PIRPin, INPUT);
  //setup the PIR Pin for input
  pinMode(PiezoPin, OUTPUT);
  //setup the flexPin for input too
  pinMode(ledPin, OUTPUT);
  // Set up the LED for output
  Particle.variable("Proximity", &PIRReading, INT);
  // Create a cloud variable of type integer called 'proximity' mapped to PIR Reading
  myservo.attach(D3);   
  // attach the servo on the D0 pin to the servo object
  Time.zone(-5);
  //Set the timezone to local timezone
  Serial.begin(9600);
  //
  Particle.syncTime();
  //sync the current local time with the particle board.
}
void loop()
{ 
  delay(86400000);
  //This is the delay time for opening the perfume box next day. 
  //The user can  manipulate this number to change the frequency of engagement with the plant in a day. Right now, the value is for 24 hours  
  myservo.write(100);    
  // open the perfume box hole. The servo rotates to the mentioned value. 
  delay(1000);
  //This delay is the time need to sense the PIR sensor before triggering 
  PIRReading = analogRead(PIRPin); 
  //get the analog value from the Photoresistor Pin
  ledBrightness = map (PIRReading, 0, 4095, 0, 255);
  //}
  if (PIRReading>200) 
  {
      digitalWrite(ledPin, HIGH);
      //having a digitalWrite instead of analogWrite would make the LED blink at full brightness  
      playNotes();
      //we are calling the playnotes function
      myservo.write(50);
      //close the perfue box. The servo now closes the perfume box by a whole rotation
      digitalWrite(ledPin, LOW);
      //turn off the LED after the servo closes the box
      delay(1000);
  } 
  else 
    { 
      digitalWrite(ledPin, LOW);
    }
    log_to_spreadsheet(  );
  delay(100);
  //wait for 1/10 of the second and then loop
}
Click to Expand
0

Next Steps

What would I do if I took this project forward and why? What would you do differently?

  • Syncing the code to the local time zone and also to the desired time of the day the user wants to check his plant. The system could be augmented by a moisture sensor too, in case the plant needs water in between the day. 
  • I was envisioning a proximity sensor which would trigger when the user waves at the plant(like saying 'Hii' to the plant). The current PIR sensor gives me very sporadic values.  
  • I would plan to power my particle board with a stand-alone PV cell battery.  
  • I would add a melody to the speaker (maybe a better speaker).
  • Spiral the LEDs around the plants to add aesthetic value to the plant.  
  • Some cost constraint is that the user has to buy the perfume in particular intervals     

0

Reflection

What did I learn from this project? What skills have I acquired? What did I as a student get from the experience? 

  • I learnt that coding is a very logical approach. In case I didn't know, I googled and understood the code. I am getting confidence in my coding skills. 
  • I am getting confidence in interface sensors and playing around with it.         
  • I tried to apply the '20 minute' rule exposed by Prof.Daaragh. I would set tasks to be completed for the next 20 minutes, work towards it and then start working on the next task. this absolutely helped me.   
  • I applied the 'minimum viable project' concept to get my project moving on. I would aim for the basic working circuit and then build on other things on top of it. I like this design approach.    

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
Tools
About

This smart IoT system aims to bring back the lost connect of homo sapiens with nature. With this IoT system, people get a chance to get closer to their plants at least once a day. Also, people are primed to associate a pleasant scent(could be their favourite perfume) as being near the plants(nature) thereby enacting the connection with nature a pleasurable one.

Created

November 7th, 2019