Plants vs Kylie
by Kylie Caraway
Plants vs Kylie is a program to remind Kylie when her plants are thirsty! Combining Arduino, p5.js, Adafruit IO and IFTTT, Kylie’s plants remind her when they need water through an animated avatar on the web, as well as a notification on her phone. Using moisture soil sensors, Kylie can evaluate if her plants are happy (less than 40 % dry) or thirsty (40% dry or more). Through the
Video of project: https://vimeo.com/242331497
plant reference photos
GIF Animations: https://vimeo.com/242482539
Plants at my Desk
Day 1: Brainstorming.
What could I use in the vicinity of my desk? What can I make that could improve my day to day tasks? I quickly decided I wanted to use Arduino for my input to send data to P5.js. First ideas:
-Audio increases if you fall asleep at computer (proximity sensor and audio- interesting, but I decided I would probably never use this)
– Use proximity sensor to detect me at my computer (Why? Also, it could detect anyone, not just me)
-Measure temperature outside and get a display (I realized I could just look at my phone to get this information, so I abandoned this idea pretty quickly)
– If the temperature inside is too hot, turn fans on (more applicable in Texas than Toronto, also I doubt the fans in our kits would actually cool me down)
– Lights change color based on weather (I still like this one, but I wanted to do something a bit more creative)
– Measure soil and create automatic irrigation system (where is the computer in this idea? I would not need p5 to complete this)
– Measure plants moisture and create a visual and audible response (very creative but too experimental, less practical)
– Measure soil- illustrates plants happiness based off moisture level. ( I really liked this idea: this is something that was different than examples in class, it could be used in the vicinity of my desk with my houseplants, it allowed for creative freedom, and it was a practical use that I would honestly use to help me take care of my plants.)
I made a decision on my project theme. In the end I decided to measure soil moisture that illustrates plant’s happiness and create a visual out of it. I then planned to create a button alongside the visual that, when pressed, would signal for my irrigation system (pump with water) to begin. This would be helpful when I am away from home.
I went to Sheridan Nurseries to purchase soil and a smaller planter that would be easier to bring my desk plant to class for presentation. I ended up buying three plants along with the soil and planters: I couldn’t help myself. I bought an ivy plant, a succulent, and something similar to a philodendron.
I went to Creatron to purchase soil moisture sensors and extra wire. I was very happy to find that the sensors were inexpensive, so I purchased three. After class on Friday, I decided to simplify and not do irrigation for this project, per Nick’s advice. I decided to focus on creating only an interface, not an input that creates a visual, and then a visual that in-turn creates a physical output. This was too complicated. Too many things could go wrong, with too little time. I refocused on the soil moisture sensors to “Neopet” my plants.
Today I tested my soil moisture sensors. I began by using the Arduino Demo Code for soil sensors on Creatron’s website. According to Creatron, “this sensor uses the two probes to pass current through the soil, where it will measure the resistance to calculate the moisture level. More water makes the soil conduct electricity more easily (less resistance), while dry soil conducts electricity poorly (more resistance)” (Creatron). The sensors register moisture on a scale from 0 to 1023, 0 being perfect conductivity and 1023 being no conductivity. I created a short to see how close I could get to 0: the closest I got was 31. When I hold the sensor in the air, it is normally 1023, although sometimes it wavers to 1020 or so.
I began by testing the same soils with different amounts of moisture in them.
The sensor number changed based on plant, amount of soil, location of sensor in the soil, and whether I was moving the sensor back and forth between different plants. The numbers were all over the place. I could not find a consistent trend as I moved the sensor within the same plant, between plants, between moisture levels, etc.
I decided to use one sensor per plant, because my sensor was malfunctioning when I moved it around. I also didn’t like the feeling that I was stabbing my plants every time I re-inserted the sensor.
I later realized my dirt was not dry enough. I attempted to use flour, but it was not effective and would not register with the sensor. In another attempt, I placed a pot of soil on a heating fan in attempts to dry it out.
I also dunked my sensor in water, which did not work very well. I rarely got a reading, and I later realized that different types of water (tap versus bottled) would have different effects on the conductivity. While my first idea was to have various levels of very dry, dry, normal, wet, and too wet, I quickly realized that the numbers were too varied to make strict, narrow distinctions. I then changed my idea and instead decided to do dry and wet only. Using Arduino, I mapped the range of numbers 0 -1023 to a percentile, 0 to 100. I was then able to read the sensor value, as well as the percentile (percentile referred to dryness, so 10 % dry does not need watering, whereas 60% dry needs water).
Sticky Note process: Simplifying data from 0 to 1023 into categories of moisture
Today I connected Arduino code to P5. I used a combination of codes from our practice in class. I used the input code as a reference to get p5 to see my Arduino data. I used the display code from the output code to display the information, and tinkered around with the code. I decided to use if statements, and I told p5 to categorize in 3 areas: Less than 40% = happy. More than 40% = thirsty. 100% = not connected to sensor (this is air, and I did not want it to say “thirsty” when the sensor was not connected, in the plant, or placed correctly.) I decided on 40 % because, after reading recommendations online, the plant moisture data should be around 600 out of 1023 in order for it to be satiated. While this depends on the specific plant, I decided to follow this number as the basis.
Next, I tried to use graphics rather than text, for aesthetic reasons. I ran into the issue of needing a server, because Google Chrome won’t let you reference something straight from your computer. I attempted to use Wamp server, so that it was local and could reference Arduino, but also support my graphics. This worked well. Next, I tried the OCAD webspace, because I was unsure if it would send data from my Arduino to this website. To my surprise, it also worked. I ended up using both servers to test my program.
Days 5 and 6:
I used these days to draw up graphics for my thirsty plant, happy plant, and sensor error images.
I have successfully centered the image and text in the webspace. I am now attempting to connect my sensor information to Adafruit. No success so far. The feed is blank, and I am unsure how to monitor this or fix this. I am going to talk to Kate or Nick about this tomorrow.
Today has been an extremely stressful day. Nothing is working. I have to clear cache and restart my computer to get the data to update from Arduino to p5. Arduino was working, but the local server was not updating the data from Arduino. (I believe this has to do with the serial port: perhaps it is timing out or going into some sort of sleep mode? I am not sure.)
Luckily, I have finished 1 of 2 animations using Photoshop and After Effects. Unfortunately, I can not get p5.play to work. I only have 11 frames in a sequence in a folder, and they are small files. Not sure why I can never get them to work. I instead attempt p5.Gif.js and it works! Now I need to change my animations from image sequences into GIFs, which are crunching the quality of my animations, but they are working nonetheless. I also bought a box from Michael’s to put my breadboard in. I drilled a hole in the side so the USB could fit through to connect my feather to my computer. I was going to glue moss around the box, but the smell of the moss was very chemical and I didn’t like how it looked aesthetically, so I went for the clean wooden box instead. This is easy to transport, it stylistically matches my desk, and the box could be used for various other things.
I have finally animated my happy plant, thirsty plant, and sensor error GIFs. The program is working, but sometimes it gets stuck and stalls out. It seems like the serial port is not updating the information to p5, because while the information is changing in Arduino, it is not changing the percentage value on my p5 webspace. In order to fix this, I have to open Arduino, then p5 serial control, then Atom, then clear cache, then open the file. There must be another work around, but this is the only way I can fix it at the moment.
My final attempt to connect p5 with Adafruit. I decided to start from the basics by following Nick’s code from scratch in separate example. I try sending data. I manage to get it to connect to Adafruit. Then, I connect Adafruit to IFTTT. It works! Except that it is using a mouse click example, and I want it to update without me interacting with the computer. There is also a major lag from my mouse click to the text I receive. It is somewhere in the communication between Adafruit and IFTTT.
Next step: I need to implement this example into my own code. I manage to get it to work with a mouse click.
Next step: I need to change from a mouse press to set it on a timer. This step was trickier, and it took me a while to figure it out. I had to copy and paste various pieces of code from the sending data to adafruit example and receiving data from adafruit example that Nick provided.
First iteration: I need it to constantly check, so I need to place it in function draw rather than function mouse pressed.
Second iteration: I am not wanting to check data, i am wanting to send data. So I need to swap the IFTTT check with the IFTTT send data.
Third iteration: the polling time is way too quick. 2.5 seconds. I need to change that, I instead select 10 seconds (for the purpose of our presentations on Friday; I will likely change this to twice a day or longer when I use this at home).
Fourth iteration / problem: Although it says to send every 10 seconds, Adafruit is updating anywhere from every 10 seconds to almost a minute. There is a lag in information somewhere in this. (I did not fix this, and I am not sure that I can)
Fifth problem: As there is a lag between my webpage and Adafruit, there is an even longer lag between Adafruit and IFTTT. It seems that IFTTT checks for data once every minute or so. This results in me not receiving texts until the next minute, and then receiving 3 or 4 texts in a row. I also want to set a parameter so I don’t get a text when the data is 100, which means the sensor is not connected. It looks like IFTTT only has greater than, less than, equal to, or not equal to parameters. I can not say to send me a text between 40 and 99, I can only say to send me a text if it is greater than 40.
Final test: connect Arduino to computer, open Arduino, open serial port, clear cache, open webspace… wait for plant percentage on healthy plant… working! Change to dying plant… Working! Wait for text…
Not working. Lovely.
I guess I will reload the page. Now it’s working! It is very finicky on when it runs, but when it does, it works well! I just have to make sure the serial port doesn’t randomly close.
I wait for another text…. Minutes later, I get bombarded with 10 texts.
Then 5 minutes later, 10 more texts.
Soon, I am flooded with text messages that have piled up somewhere in the data transfer.
I get an email from IFTTT: i am almost at my limit of texts for the month… Fantastic! I need to stop testing my project so that it will (hopefully) work during the project critiques tomorrow.
I check the morning before presentations: IFTTT emails me letting me know they will not send me any more texts. I quickly download the IFTTT App to send me notifications. It works well, but still has some issues with data lag.
During my presentation, my page became unresponsive due to the serial port closing. When I reload it, it works exactly as it is supposed to. I need to figure out how to fix this, but other than that small issue I am very happy with my peripheral prototype! I plan on using this project at home and further developing it. I know a few friends and family members who could use this with their plants.
Context and References:
Plants are an important piece of our ecosystem. While many people treat plants as inanimate objects, it is important to note that plants are complicated, living organisms that can sense, communicate, and possess memory.
Yet, as we move into increased urbanization, nature is not as accessible to us as it once was. We are slowly moving away from the natural and towards the mechanically produced. This project is an attempt to connect the two, to create a relationship between plants and technology. Plants have numerous healing affects. They are known for improving concentration and productivity, as well as reducing stress. In fact, some plants are known for actually purifying the air, according to studies by NASA. Caring for a living thing such as a plant gives us a sense of purpose — especially when you see it happily thriving. Unfortunately, many people are “plant killers” (the number of online articles titled something along the lines of “How to Not Kill Your Plants” or “Houseplants that are Impossible to Kill” must be in the hundreds). This project hopes to remediate this common issue through data visualization and communication that anthropomorphizes our houseplants.
The notion of plants combined with technology is not new: some artists have transformed plants into musical instruments, while others have opened up communication for plants to tweet or call you when they need some TLC. They can be used for scientific developments (such as these plant lamps that convert bacteria within dirt and vegetation into electricity) or they can be used as installation pieces (such as Botanicus Interacticus) and artwork (Floral Automaton grows flowers digitally). Some artists have gone fully digital, such as Sasha Katz, who uses computer graphics to depict an ever-growing relationship between the natural world and technology.
While the combination of nature and technology might at first seem arbitrary, placing these pieces together can prove to be not only aesthetically pleasing, but also an important development as we become swallowed by technology and shift into “metropolitan dwellers” (Bryant). It is important that we don’t fall away from our connection to the natural world. In our often commodified, urbanized lifestyles, perhaps the relationship of plants and technology can reconnect us to our roots and environment. Perhaps pieces such as those listed above will invite humans to take a step closer in experiencing the consciousness of another organism.
(As a side note: this image popped up on my Facebook during this project. They are obviously data mining my browser history)
Reference for soil moisture sensors: I used Creatron’s demo code to understand how to properly use soil moisture sensors. My sensors came directly from Creatron (they were not the popular SparkFun version I found online) so my safest bet was to follow the code provided from Creatron. The code immediately worked in Arduino, which allowed my coding process to run smoothly.
Reference for sending data between Arduino and P5.js: In order to send my data from Arduino to P5.js, I used the serial-input to p5.js code on the website we used in class on the first day. I edited the code that displayed a graph to instead play one of three animations that would appear based on the data.
Reference for Adafruit and IFTTT: In order for me to send my plant moisture data to Adafruit IO, I followed Nick’s class examples and combined both versions of the IFTTT connect codes. I used version 1 to understand how to send data to Adafruit. I used version two to implement a polling rate within my draw function, so that Adafruit would automatically receive data in specific time intervals, rather than relying on the user to click the screen or interact with the page to send data.
I am very happy with how this project has turned out, and I plan on using it in my home. While it could be used at this very moment to monitor my plants, there are a few ways I would like to improve this project:
- Monitor sunlight intake
- Send information wirelessly, rather than having to plug my plants into my computer every time
- Monitor different plants at once based on their individual water needs; additionally, create a webspace where you can view all plants at once with their individual data
- Create an automatic irrigation system that leaves them alive and well without my need to interact with them ( I am honestly on the fence with this idea – while I of course want my plants to be consistently healthy, and this would help me in times when I am away from home, I also feel like removing myself from the picture removes the relationship between plant and human, something that I really value with my plants)
Bryant, Taylor. “Why Are Millennials Obsessed with House Plants?” Nylon, 21 Mar. 2017, nylon.com/
articles/millennial-house-plants-obsession. Accessed 9 Nov. 2017.
Faludi, Robert, et al., editors. Botanicalls. 2006, www.botanicalls.com/. Accessed 9 Nov. 2017.
Cook, Gareth. “Do Plants Think?” Scientific American, 5 June 2012, www.scientificamerican.com/
article/do-plants-think-daniel-chamovitz/. Accessed 9 Nov. 2017.
Igoe, Tom. “Lab: Serial Input to P5.js.” ITP Physical Computing, 11 Oct. 2017, itp.nyu.edu/physcomp/
labs/labs-serial-communication/lab-serial-input-to-the-p5-js-ide/. Accessed 9 Nov. 2017.
Jobson, Christopher. “Animator Sasha Katz Explores a Symbiotic Relationship between Plants and
Technology.” Colossal, 25 May 2017, www.thisiscolossal.com/2017/05/
9 Nov. 2017.
“Moisture Soil Sensor.” Creatron Inc., www.creatroninc.com/product/moisture-soil-sensor/
?search_query=soil+moisture+sensor&results=4. Accessed 9 Nov. 2017.
Puckett, Nick. “Data and APIs.” Github, 3 Nov. 2017, github.com/DigitalFuturesOCADU/
creationANDcomputation/tree/master/P5examples/DataANDapis. Accessed 9 Nov. 2017.
Rodriguez, Natalia. “Hacking House Plants to Make Music When They’re Touched.” Fast Company, 18 Feb.
Accessed 9 Nov. 2017.
Vezina, Kenrick. ““Plant Lamps” Turn Dirt and Vegetation into a Power Source.” MIT Technology
Review, 23 Nov. 2015, www.technologyreview.com/s/543781/
plant-lamps-turn-dirt-and-vegetation-into-a-power-source/. Accessed 9 Nov. 2017.
Visnjic, Filip. “Floral Automaton – Digital Growth with Physical Adaptation.” Creative Applications,
21 July 2017, www.creativeapplications.net/arduino-2/
floral-automaton-digital-growth-with-physical-adaptation/. Accessed 9 Nov. 2017.
Wolverton, B.C., et al. Interior Landscape Plants for Indoor Air Pollution Abatement. NASA, 15 Sept.
1989, https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19930073077.pdf. Accessed 9 Nov. 2017.