49713 Designing for the Internet of Things
· 16 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
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.
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.
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.
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:
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
What would I do if I took this project forward and why? What would you do differently?
What did I learn from this project? What skills have I acquired? What did I as a student get from the experience?
https://www.newhope.com/blog/build-better-relationship-plants
https://www.electronicwings.com/particle/servo-motor-interfacing-with-particle-photon
https://particle.hackster.io/make-photons-great-again/motion-activated-music-player-ad8878
https://docs.particle.io/reference/device-os/firmware/photon/#particle-synctimedone-
2.426 KB · Download / View
A hands-on introductory course exploring the Internet of Things and connected product experiences.
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.
November 7th, 2019