DigitalFarm: Final Project – (Dan)

Living plant jewellery 

Partner: Vanelly

For this project we recreated the “jewellery with plants” project, this time with the purpose of keeping the plant alive. We focused mainly on ways of creating pseudocontainers in which the plant would have enough space to grow and be watered.

The idea of the project was to introduce living plants as wearables for the sake of encouraging the user to have a more active relationship with the object and to take care of the plant instead of seeing it as a disposable component.

For the first 3D printed object that we created we made some kind of rhombic polyhedron and placed the cylinder that would be used to hold the plant inside.

WechatIMG9 1

However, this shape proved rather difficult to wear because of the pointy angles (which we hadn’t thought of before) and the weight of the plant (which kept falling whenever we tilted it because it still didn’t have roots. So we let that be and it became a ‘desk jewel’ instead. Because the surface was not entirely uniform due to printing errors, the container was also leaky so we had to put plastic inside to cover it. The final ‘desk jewel’ had a spider plant with soil as a medium (since weight wasn’t a problem).

WechatIMG13

For the second 3D printed necklace we made another irregular shape but this time with a flat face to be facing the body, and this time the placed the plant in such a way that it wouldn’t fall. I think that this one is much better although the plant still looks very prominent, but perhaps this has to do with the choice of plant and not with the necklace itself (which imho works very well as its own contained system.) We also covered it with plastic on the inside to prevent any leaking but we did not add any soil this time in order to keep it light.  I think that perhaps it also looks like its too much because its too big, so perhaps if we had experimented with smaller sizes it would have been both lighter and more wearable. Perhaps it would have also been smarter to have a specific plant in mind before fabrication so that we would’ve made a more suitable container.

WechatIMG4

Vanelly got a bunch of vials from Taobao with the idea of putting moss inside to create necklaces and such, and we figured it’d be interesting to have them under different conditions in order to see how long they remained green and how aesthetic the different choices were. Some of them had water inside the container, some had been watered but contained no water, and some were completely dry. Within these three categories we also included three different types of “rocks” we found in the farm; clay pebbles, what looked like growtstone, and another black, brittle rock.

With water

WechatIMG5

‘Wet’

WechatIMG6

Completely dry

WechatIMG7

Unfortunately, we didn’t have enough time to see the results of this little experiment, and even though it’s logical that the ones without water would have dried out faster its not immediately obvious that this would have made them trash or less interesting than the ones with water.

We also made a grass necklace by piling layers of cardboard and growing the grass in the gaps. Because the cardboard is excellent at retaining water the shape would stay wet even days after so that didn’t seem too hygienic nor aesthetic. We covered it with plastic and hoped that it wouldn’t grow mold or bacteria (which it didn’t).

WechatIMG3

If I did this again I would reconsider 1) why do I need that many layers of grass if it’s intended to be worn vertically? 2) putting some other material between cardboard layers 3) why am I using cardboard? I guess at some point we intended it to be worn with the grass facing the viewer and so the cardboard art would’ve been relevant, but otherwise it’d been much cleaner to make this with nylon.

WechatIMG9

In the midst of it all we realised that the 3D printed bracelet we had used for the midterm had a gap that could be used to grow plants if the other end was covered. So we glued some nylon + plastic + moss and used enough glue so that it would not leak. Because we didn’t have time to put ‘real’ plants we put flowers for demonstration purposes.

WechatIMG1

When the bracelet is worn the plants run parallel to the skin, which could be a problem if the plants are too heavy/delicate or need extensive watering (and so they should be probably facing not the hand but the elbow), but could also be interesting aesthetically.

WechatIMG2

I was interested in this project because I think that adding mobility to hydroponics, as well as coming up with new ways to reduce the space and resources needed for cultivation, could be used for interesting applications beyond wearables. However even though we successfully kept the plants alive I feel like we should have thought about the plants we were using and their needs first and then start to design the jewellery. This was easier for the grass necklace, for example, but for the spider plant or even the moss it still felt very experimental.

 

Sprout Works- Robert Prast Final

Name: Robert Prast

Professor Dan

Digital Farm Final Project

5/23/17

 

Project: Sprout Works

Cal and my project focused around using natural filtration methods to support a microgreen incubator completely, and have the system be able to monitor itself to make adjustments. This culminated in a 5 layer filtration system, which would lead into a reservoir with an ultrasonic mister that would keep microgreen hydrated.

The first major facet of our project was the 5 layer filtration system, which would have the most moving parts and be the most complicated to design and assemble. We decided to stick to the contemporary theme of filtering from largest to smallest particles. We began with a storage tank that a user would pour dirty water into. Since we wanted most of the kinetic energy to be generated from gravity, we had the storage tank as the highest fixed item. This tank then ran into a secondary storage tank-whose intended purpose is to filter out the large particles that washed through. This tank also acted as an overflow protection tank.

After passing through those two stages, the water will begin to have smaller particles filtered out by our secondary mediums. The water will first pass through a pebble filter that should filter out small to medium particles. This then filtered into sand, which will filter even smaller particles. This water then would pass through an empty container which is meant to catch any excess sand or stone that had been carried with the flow. Additionally, we could use this stage to add things into the water flow to adjust pH or other variables.

After draining through those layers, the water then gets held in a reservoir with spyder plants and water lilies. After researching which plants would be the most beneficial to filter out toxins, small particles, and heavy metal we decided on just those two above mentioned plants. Then the water is carried to a final reservoir. However, this reservoir is interesting since it meant as an overflow protection. To achieve this effect we have a moisture sensor coupled with a water pump that reverts water back to the beginning.

The second major stage is the hydroponic microgreen incubator, which is supported by the filtered water. We have a simple pump and moisture sensor pairing that feeds that ultrasonic mister. The mister is attached below the microgreen factory to have moisture come from the bottom and then fall back down.

 

Reflection: Doing this project was both rewarding and fun to do. It represented a large culmination of the topics we covered in class, making it rooted in theory we had learned in class. Additionally, we originally planned to have a custom case built to hold all the filtering systems. However, we decided to recycle my midterm which turned out to be the perfect fit for what we wanted to do. For a second or third iteration I would like to have a more modular system that could have slots that a user can interchange the medium based on what effect they wanted. Additionally, I would have liked to scale this up to process larger amounts of water to support more hydroponic systems.

 

11 WeChat_1495082349 WeChat_1495071918 WeChat_1495082347 WeChat_1495071917 WeChat_1495071916 WeChat_1495071915 WeChat_1495071914 WeChat_1495071913 WeChat_1495082352

Digital Farm Final Project—Wearable plant life support system

2

Design a dress that can have tube runs water to the plants.

3

Change I made from the proposal is to have to tube goes vertically down.

1-1

Design the circuit.

5.pic_hd

Moment of creativity. Combination is one way to reach creativity. I combine the circuit and the purse for the dress.

This video shows that the system works.

7.pic_hd

This is the final beautiful dress with life support system.

 

/*
  Turns on an LED on for one second, then off for one second, repeatedly.
 */

long on = 6000;   //60,000 milliseconds equals 1 minute
long off = 6000;  //


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}


// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(on);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(off);              // wait for a second
}

Digital Farm: FINAL PROJECT

22 MAY 2017

PARTNER: GABRIELA

INSTRUCTOR: DANIEL M.

For our final project Gabriela and I decided that we wanted to continue working on what we created with our midterm project. Our midterm project consisted of creating live jewelry that would be made out of recycled items, 3D printing, and of course plants. The idea was to create a life support system for these plants in different ways that not only would be supportive but also look fashionable. In order to improve this from our midterm into our final we had to make sure that we would be able to find ways that the plants would actually survive this time around. We would later realize that this would be a bit more difficult than expected. The first thing we created was a model through 3D printing, we figured that it could be a form of necklace. When printed we realized that it was too big, and could not really be shaped in the right direction that could obtain any plant if worn. Due to this we decided that it would be a form of desk accessory. We reprinted a new necklace after this was not able to work and felt that this necklace was much more of an improvement than the first one. As for necklaces  we experimented with different types of moistures and media to see which could withstand the longest. We used small bottles to do so, in these small bottles contained: moss, rocks, and water. We tried to different ways to align everything to see just how well it could stay put together. We used previous accessories that we had created with our midterm as well, such as the 3D bracelet that we had covered with moss. This time we noticed that there was small openings within the bracelet and decided that what could be done was plant flowers inside. Above all, I feel like what we created was very unique and something that before taking this course would never expect to be possible. I never thought much of plants or how they could be part used as a form of accessory, it really brought new light to things. We may have still faced issues with maintaining the life span of the plants, but it still was a project that I learned a lot from. If I could do this all over again I think experimenting a bit more would have been the best option. Apart from this, I am very much content with our final and this course! Definitely learned a lot and it brought very much insight! 🙂

 

 

 

IMG_2771

 

Processed with VSCO with a6 preset

Processed with VSCO with a6 preset

Processed with VSCO with a6 preset

Processed with VSCO with a6 preset


Screen Shot 2017-05-22 at 6.48.06 PMScreen Shot 2017-05-22 at 6.48.02 PMScreen Shot 2017-05-22 at 6.47.49 PMScreen Shot 2017-05-22 at 6.47.44 PM

Hydroponic System – Digital Farm Documentation

Date: March 16, 2017

Partner: Callum Amor

Instructor: Dan

For this project, we were partnered up and assigned to create a gravity drip, ebb and flow, or NFT hydroponic system that could house at least four plants, use a water pump and drains when full.

Cal and I started with a large styrofoam container we found in the cardboard room. The original idea was to create a fully portable hydroponic system with a lid. But shortly thereafter scrapped the lid idea and just went with a one component project. The styrofoam box we chose conveniently had pockets that could hold plants on the sides and a large reservoir in the middle. The pump would sit in the reservoir and pump water to the first side container, the water would then flow down lower and lower further into the other containers. A tube would then transfer the water to the other side, where the water would flow into the final container. While the water is flowing, it is drained slowly by holes in the side.

Measuring the box

IMG_20170310_102232

Testing the water flow

Creating holes for water drainage

IMG_20170314_170038

We quickly ran into problems when we tried to fill the main reservoir with water. We discovered that the styrofoam could not properly hold water. If we waited a short time the bottom of the box would start to leak. We thought of many fixes, one of them was to cover the entire bottom with wood glue. We finally settled with hot glueing a plastic wrap/bag to the bottom to keep it sealed. We also taped the bottom of the box excessively to keep it from leaking any further.

Leaks!

Lining the box with plastic wrap/bag

IMG_20170314_183155

Hot glueing the plastic on

IMG_20170314_183946

After we properly sealed the reservoir, we started to cut down the edges of each of the containers. It had to drain downwards like a downwards sloping river. We had to test it many times in order to get the right height for each container, but we eventually got it.

Testing with pump to find correct wall heights

IMG_20170314_191700

After finding the correct wall heights, we hot glued the tubing to the side wall. The problems with the styrofoam did not stop at the leaking. The styrofoam also melted when we tried to use hot glue. It did not melt a lot though so it was manageable.

Tube management 

IMG_20170315_172945

Tube insert into the other container

IMG_20170310_103755

The code for the project was very simple. It was just turning the pump on for 15 minutes (900000 milliseconds) and then back off for 15 minutes. It is shown below.

In the end the project worked just alright. It would not be the greatest hydroponics system, but it is still semi portable and could be improved in a lot of ways. One of the biggest downfalls to this project is the material we started with. The styrofoam was in no way designed to handle water. Using the styrofoam caused us to bump into many different problems.

int pumpPin = 3;

void setup() {

pinMode(pumpPin, OUTPUT);

}

void loop() {

digitalWrite(pumpPin, HIGH); 
delay(900000);
digitalWrite(pumpPin, LOW);
delay(900000);

}

Whirlpool Hydroponics – Digital Farm Final Project Documentation

Date: May 21st, 2017

Instructor: Dan

Materials Used:

  • Large Bowl
  • Small Bowl
  • Water Pump
  • Tubing
  • Arduino
  • Relay
  • Jumper Cables
  • USB Cable
  • Power Supply

For our final project, we were assigned with creating a “Plant Life Support System”. Following this prompt I wanted to create more of an aesthetic piece, not so much a technically and mechanically advanced piece. What I settled with was a whirlpool-styled hydroponics system. The concept of the piece was to have small plants such as Basil, to be resting in mesh pots and floating within a whirlpool. A water pump would spin the mesh pots and plants around. Where I got the inspiration for the project was from a night market in Tokyo, where they displayed apples for sale in a similar system. Below is a video:

Japanese Apple Whirlpool

 

When I first proposed the project I was planning on not having a pool, and having a canal for the plants to follow. But after presenting the project and getting feedback I realised that the water had to drain somewhere! Dan and a few people had suggested that I use a bubbler of some sort in order to do so. Keeping the original concept of an aesthetic piece in mind, I decided to just use an overflow system. Where when the first bowl fills up, the second one will take the overflow, and the pump will pump water back up to the first. This way the piece can perpetually flow.

After finding suitable sized bowls on Taobao and also mesh pots to hold my plants I began to create my project. For the first version of my project, I just taped the the pump to the bottom and then held the top bowl. It made a mess but showed that the concept would work.

First test

IMG_20170511_103729

Up close of first test

IMG_20170511_103738

After finding out that the concept was feasible. I simply used a lot of hot glue to glue the pump to the bottom of the bowl, and also glue the top of the bowl to the pump. It stayed in place very well even when the bowl was filled with water. I had to test out how much water the two bowls needed in order to function. I simply had to fill the top smaller bowl to the top and then fill the bottom bowl until the pump was completely submerged. Putting in the “minimum” amount of water also created a nice ambient water splashing sound when the water overflowed to the bottom bowl.

Test with foam blocks

Now that the flow of water was working. I had to find a way to keep the mesh pots afloat. I first thought of using styrofoam as it floats, but remembered that the hot glue would melt it. Also I felt it would be really difficult to cut the styrofoam in even blocks. I decided to settle with the bubbles from bubble wrap. It took a while I cut individual pieces out but it worked. Some of the bubbles also popped when it came in contact with the hot glue, but most of them stayed. I chose to put three each on the mesh pots. They worked very well in keeping the mesh pots afloat and stable.

The coding for the project was very, very simple. It was only turning the pump on and nothing else.

Final Project

Final Thoughts

I received a lot great feedback when presenting my project. Millie suggested that I should have just grabbed some plants that had already grown so I could display what it would actually look like once the plants had grown when I presented. Someone suggested that I could put more of the mesh pots inside so it wouldn’t look like it was going so fast. Dan suggested that I could 3D print a piece to go where the tubing enters the top bowl, so the mesh pots don’t get stuck as they sometimes do. Something that I would have liked to do was to laser cut the box that held my Arduino and wiring that went on the bottom of my piece. I tried to laser cut but it was very last minute and some fellows decided that it was too simple to laser cut a box and suggested I should just use a cardboard box. I looked for the nicest looking cardboard box and went with it.

In the end I am pretty happy with the outcome of my project. I felt maybe it a little bit too simple, but sometimes that is a good thing. I could imagine this piece resting at a reception or perhaps inside a spa somewhere.

int pumpPin = 3;

void setup() {

pinMode(pumpPin, OUTPUT);

}

void loop() {

digitalWrite(pumpPin, HIGH); 

}

Final project: Green Lamp – Echo

Idea

The prompt for the final project is to make a “life support system”. My idea is to build a simple life support system for air plants. Why air plants? When I researched online, air plants grow without soil or any other kind of medium and they can take nutrients from the air. They also don’t need a lot of water and thus are pretty hardy. Since they have really low maintenance, it should not be complicated to make a working life support system for them so I can spend more time on the aesthetic part to make this project  more creative and interesting.

11271fb6c21afe87a96f51476960d2dcIMG_1691

I decided to incorporate the system with some some common object in our life, like the desk lamp. Why the lamp? Because: 1) it can provide light source to the air plants 2) Lamps are pretty easy to make (if you’re not making the bulbs by yourself) and the their structure can be really flexible, which give rise to creative aesthetic designs.

Process

  • Structure of the lamp

Considering the functions of my project, I  divided my lamp into three different parts: 1) Stepper motor with the gear. This is the part that involves electronics and is most crucial to the success of my project. It will “spin the plants” and when the plants are moved to the water bottle place, they will be soaked in the water. This can be interpreted as the “watering system” in my project. 2) Supporting structure for the USB LED. The USB LED came with a bulb connected with an USB cable. I need a structure to hang the bulb and to connect it with the rest of the lamp (if the lamp is separated from the rest of the structure it won’t really be a “desk lamp”)  3) Structure to hold the stepper motor. I need a structure to hold the motor stable so the air plants’ position won’t change every time they spins.

I started working with wires because I was not sure how much weight the stepper motor can hold. So the safe option would be to go with something light. I thought wires can make a light (comparing to laser cut plywood) but also stable (comparing to strings) structure. And wires will also look super cool!

IMG_1710IMG_1715

I built all the structures using wires at first. After I connect the stepper motor to the Arduino, however, I found that the supporting structure was not really stable. Since wires are really stable, it’s easy to change their shapes and it’s hard to keep the motor flat on the horizontal level all the time. I was kind of reluctant to change it because the wire structure looks really cool! And I’m afraid that using other materials instead will spoil my original aesthetic design. But I also realize that the most important thing is to make the project work first and then other aspects can be developed later. No matter how “cool” the outlook is, the project won’t be cool if it’s not working. So I had to sacrifice my aesthetic design to a more stable but less “cool” material: plastic bottle.

I placed the plastic bottle upside down so their will be a large enough flat platform for the stepper motor on the top and there will be a opening at the bottom to connect the wires to Arduino circuit. The plastic bottle proved to be much more stable than the wires and it provide a place to put the driver chip and wires for the motor.

IMG_1726

  • Laser cutting

I need a box to hold my arduino circuit and a large enough place to put the water bottle. So I laser cut a box using Makerbox.com to design it.

I need something connect the motor and the lamp structure. It needs to fit perfectly with the motor so the motor will be also to “spin” the whole structure. I immediately thought of laser cutting as I can design with precise measurements and the plywood is not too thick. I took the measurements from documentation page to draw the gear. For my first draft I use the exact data of the drivershaft’s diameter from the documentation page but the hole turns out to be a little bit lose so the gear won’t move with the stepper motor. I had to experiment with different numbers to find a perfectly working one.

IMG_1727

  • Working with gear stepper motor

I chose 28BYJ-48 – 5V Stepper Motor as the motor in my project because it’s smaller and lighter comparing to the other stepper motors in ER. The 28BYJ-48 – 5V Stepper Motor in the ER came with a driver chip so I don’t need a H bridge for it. But I could find little documentation about the stepper motor with the driver chip online so I didn’t really know how to use it. The first time I tried to run it I broke my arduino circuit because I used a 12V power adapter (because some of the documentations online said I need a power source for it even if it’s 5V) without checking. I had to turn to Antonius and Rudy for help. They helped me connect the motor to the circuit and wrote the code for Arduino based on “one step at a time” example in the Arduino stepper library. At the end, I was able to make my motor spin at a really slow pace.

IMG_1756 IMG_1728 IMG_1729 IMG_1757

  • Air plants

I need to hang the air plants on the lamp structure so it will move with the lamp. I use wire to build a holder for them to ensure good air circulation. I chose different plants because I thought would be more interesting. But the difference in shapes and weight can also brought some challenges to the project. For example, the lamp will lean towards one side because the air plants on that side is slightly heavier than the rest. I also add some moss on the surface of the box to make it more “green” and thought that the extra water that the plants bring from the water bottle when they’re moving out can serve as a water source for the moss. But reality proved be to be too naive, the water was not enough for the moss and my moss changed from free green to dark green as a result of lacking water supply.

IMG_1707 IMG_1709

IMG_1737 IMG_1753

And finally a video of my project working:

Reflection

Over all I’ve learned a lot during the process but there were some improvements I can make if I had more time:

  1. I would probably reconsider/remake the structure for the lamp if I had more time. Because the wire structure seems not to be really stable. It’s not even able to hold the weight of the LED so I had to hang it on the rack, which won’t fit into my idea of a “desk lamp” because it’s not movable.
  2. I would also reconsider my choice of the stepper motor since the motor I chose had little documentation information to work with. Plus its dirveshaft is not in the center of the motor, which made the gear less stable.
  3. I would also improve the watering system. The air plants kind of “struggled” to get in the water bottle. And as the water evaporated, the water level won’t be high enough to soak the plants. So the design is not sustainable. Moving on I would probably use a mist instead because it seems to be a more stable water supply. And it also seems to be easy to control.

 

#include <Stepper.h>

const int stepsPerRevolution = 2048;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int stepCount = 0;         // number of steps the motor has taken

void setup() {
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one step:
  for (int i=0; i < stepsPerRevolution; i++) {
    myStepper.step(1);
      Serial.print("steps:");
      Serial.println(stepCount);
      stepCount++;
    delay(100);
    
  }
  
}

Final Project Reflection

As for my final project, things almost go as I first planned. In general, the only thing that I am not satisfied with is the size of the container, if I were to continue on my project, I would definitely just  make a much larger one.

I first bought a fish bowl and I 3D print the cover of the whole project. The idea behind the cover is just to make the cover being able to connect two bowl as well as having space for grow my “small aquaponic mesh pots.” There goes the inner part.

At first, I was thinking about buying a small glass container on Taobao, which serves the function of holding fruits, but later, I realized that the glass jar is simply too heavy and also it is also hard to find a glass jar that is the right size compared with plastic bowl whose use is more widely. Then, I thought about the take-out container that we always have from Eleme. 54

I measured the size of the glass bowl and, the above us just right to be put on the edge of the glass  fish container. The thing that I am not quite satisfied here is the size of the hole of the cover. But this is hard to improve unless I have a really large fruit container in the first place.

Then I started to think about the plants that I would like to have. Since the initial idea behind my project is that I’d love to see how living plants works with ripe fruits. I would imagine the plants that I have here look good, with flowers being great. I would also image the plants that I grow could have interactions with my fruits. There come two ideas that I think is interesting. I was wondering whether it is possible that by surrounding ripe fruits with certain plants to slower the process of the ripe fruits going rot.  Also, I personally would be quite bothered by the flies that around the fruit bowl in summer time, and therefore, I was thinking whether it is possible to grow certain kinds of plants that could release certain gas that would chase away the flies. And apart from the idea of interaction itself, the plants also need to be able to fit into the aquaponic system. I didn’t find any plants that could fulfill the idea of slower the ripe process as well as aquaponic friendly. However, I am lucky enough to find this Mozzie Buster. This particular plant could largely reduce the flies around the area and with the temperature goes higher, it works better by releasing more gas. It smells good to me, as a human being.

3

And, what’s better is that this Mozzie Buster likes water and being in a aqua environment. The reason that I am not using this in my final project is because this plant is too large that I could not fit it into my mesh pots. But I would definitely experiment more with that if I were to have a huge container. Moreover, I also experiments with plants that look good and likes the aqua environments.

I bought some Pennywort online. They look cute and they have good meanings behind, and they are easy to grow in aqua environment. When I get the Pennywort, they were just roots in soil, and I took them out, watered them gently. And then I put some rocks onto the container, then the Pennywort roots, and then covered the roots with more rocks. Then fill the container with water to submerge the roots in water thoroughly.

9 7 6 1

I changed the water once two days, because the Pennywort roots in this stage of their lives are still quite weak, that it might not being able to survive it with frequent water change. I am happy with how the Pennywort growing. They are one of the perfect plants for my project, because they are small and cute.

I also tried two water lilies. I didn’t know water lilies have mini species. They grow slow, therefore, by the day I present, they were still in the sprouting stage. unnamed

I also testes with the water plants in the Lab’s fish tank system, but they didn’t do well, as you could see in my final project. 10

I should have some fish swimming in the bowl, but after my research, I got to know that even one fish would love to have 1 L of water, but my container is just too small to make the fish happy, and therefore I didn’t borrow fish from Dan.

Even at this point of my project, I still quite love the idea to have fishes swimming in the fruit bowl. It is lively and interesting just to look at.

 

 

 

Final Project – Musical Hydroponic System

My goal with this project was to create a plant life support system that is dependant on daily human activities. The plants would depend on human interaction to sustain life, whilst fostering positive habits for the participant. Consequently I decided to create a watering/ hydroponic system that is triggered by playing the piano. This would make the plants dependant on music, whilst encouraging the participant to practice piano.

I first started the code by making a single pump activated by a sound sensor. The specific sound sensor I was using (V2 analog) detected volume fluctuations. I would have liked to also use a sound sensor attuned to pitch fluctuations, and will include this if I make a second prototype in the future. Once a certain volume threshold is reached, the pumps would activate. I made an extended cable so that the sound sensor could hang under the piano lid, while the watering system could sit a distance away from the piano. When I tested this, the pump responded in time with single notes on the piano (see video below).

Once I established this part of the code, I added two more pumps. Two pumps would react to the sound sensor, whilst the third would continually pump water up to the top of the watering system where a second reservoir was positioned. I initially wanted the pumps to react to two different thresholds of volume so that more water would flow with a dramatic increase in volume. However I decided to set them to the same threshold so that the plants would all get equal amounts of water. In a future iteration I would ideally set up a form of shower head so that the water would be equally distributed no matter the quantity.

For creating the physical watering system, I repurposed what looked like an old metal table frame. By setting it on it’s side and strapping two boards along the top, I could hang recycled bottles that would act as pots. I decided to leave the bottles open so that I could hang basil plants (germinated in foam cubes) from the bottom. The bottles were cut in half so that I could plant spider plants in the top of the pot.

IMG_0109

(germinated basil plants in foam cubes)

IMG_0111

Below each pot I hung the other half of the water bottles to act as water catchers. Water would flow over the basil plants in the bottom of the pots and then into the water catchers. I attached tubes halfway up these ‘catchers’ so that once the water reaches a certain threshold it would flow into the hanging plants on the level below.

In the video below I demonstrate the completed watering system using music on my laptop rather than a piano.

If I was to make a second prototype of this project, there are several things I would adjust. For one, the pumps move water into the first two plants faster than the smaller tubes in the water catchers can drain it out. As a result, the water catchers can overflow. Currently I am using large plastic tubs to catch this overflow. In a future prototype, I would move the drainage holes on the water catchers down so they start draining sooner. Another solution would be to add moisture sensors that stop the pumps before overflow is reached. Otherwise I could make the drainage tubing on the water catchers the same diameter as the pumps so they drain faster.

Another adjustment I would make would be to either change the media to one that is more water absorbent, or code the pumps to activate at time intervals. Currently, the tiger plants become dry as soon as music stops playing. Although I want the watering system to be dependant on music, I still don’t want the plants to die. Using Soil as a media would make the water dirty, so changing the code would be the best solution.

int sensorPin = A0; // select the input pin for the sound sensor
int sensorValue = 0; // variable to store the value coming from the sensor
int pumpPin = 13;  //sensor responding pump
int pumpPin1 = 12; //sensor responding pump
int pumpPin2 = 8; //pump that continually moves water the the upper reservoir

void setup() {
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);
  pinMode(pumpPin, OUTPUT);
  pinMode(pumpPin1, OUTPUT);
  pinMode(pumpPin2, OUTPUT);
}
void loop() {
 //continually pumps water to upper reservoir:
  if (sensorValue = 0) {
  digitalWrite(pumpPin2,1);
  }                  
  else
  {
      digitalWrite(pumpPin2,1);
  }

  
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  Serial.print("sensor = " );
  Serial.println(sensorValue);
  delay(100);

//activate pumps when volume threshold is reached:
  if (sensorValue > 100)
  {
    digitalWrite(pumpPin,1); 
    delay(10);

  }
  else
  {
    digitalWrite(pumpPin,0);
  
  }
 
  if (sensorValue > 100)
  {
    digitalWrite(pumpPin1,1); 
    delay(10);
    
  }
  else
  {
    digitalWrite(pumpPin1,0);
  
  }
  
}

Digital Farm Final – PlantMail

For my final project I originally planned to extend my midterm, which was focused on a completely closed system for growing plants. One small feature I had planned was for the plant to be able to message you and tell you to add more water or food or anything to the system when that was necessary. Once I started working on this feature however, I found it to be more interesting than the rest of the system. While my original idea was to explore how little user interaction I could rely on, this instead focused on pushing the interaction to 11, to the point that your plant was now sending you email messages and complaining about you on its twitter account.

The first step was to figure out which API’s and services I would be using. I focused mainly on email and twitter in this project (more social media could easily be added as well, but for the sake of time and proof of concept I started with these) and decided on working with Mailgun for the email service and tweepy, a set of python wrappers for the twitter API which I had used in past projects. These were pretty easy to set up and I quickly had some mock code to trigger the sending of the email and tweets.

The next step was to figure out how to make Python and Processing talk to each other. To do so, I set up a mock server on python and then had processing act as a client to that server. Even though they were both run locally, this seemed to be the quickest and simplest option. With a bit of basic socket programming, the two talked to each other just fine.

The final major step was to figure out how to gauge the plant’s levels. I used arduino sensors and decided to monitor 3 levels: UV, temperature, and moisture. The big issue here was how unreliable temperature and UV were when taken a snapshot of. To remedy this, I set those values to take the average over the observation period. For presentation purposes the observation intervals were lowered to a minute to give a quicker example, however in actual use, it should have at least an hour to get an accurate reading of the conditions.

With each individual part in place, I was ready to put it together. The following is a basic architecture diagram of the process. PlantMail Architecture Map (1)

Overall I am pleased with the project. If I continue it in the future there are a few issues to remedy. First, I want a more extensive vocabulary for the plant. The results are currently a set of three, so options for speech are limited. I would like to either make this a more sliding scale or add more options to each outcome and have it choose randomly. As it stands, it doesn’t have to feel of giving the plant a personality when it simply goes through if else statements and has only 9 speech possibilities. The other issue is that of outliers. When taking the average of reading with arduino, since I average it over the observation time period, the room could technically be freezing cold for half and hour then burning hot for half an hour and it would report as just fine. I should include a log that reports any individually extreme results.

 

// python code

import socket
import requests
import tweepy

consumer_key = "jXUSVWtNT2qkcjL80Gvlmy7FQ"
consumer_secret = "gRdUvWRUJs1kFSNSul0i8i3ZLhigN3t5lKMhs7qyOJ5h0XF2eS"

access_token = "831141872202502144-00boHhZVKmk1xO4ipunsm3VTfggPGpE"
access_secret = "c1nnaNb5bEx4LtjBKAmctlHShZGaqbovbpHLgtLLiXxRL"

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token,access_secret)

api = tweepy.API(auth)             

curTemp = -1
curUV = -1
curMoist = -1

def send_email(text):
    print("email sent")
    return requests.post(
        "https://api.mailgun.net/v3/sandbox1f65f03f51814fc18ab6231dd72fbde0.mailgun.org/messages",
        auth=("api", "key-36dd7247883ea5bb74c12c83ec18829c"),
        data={"from": "Mailgun Sandbox <postmaster@sandbox1f65f03f51814fc18ab6231dd72fbde0.mailgun.org>",
              "to": "Sam Arellano <msa455@nyu.edu>",
              "subject": "Hello Sam Arellano",
              "text": text})
    
    
def form_message(moist,temp):
    tempMessage = ""
    if moist == 2:
        tempMessage += "I'm drowning over here. "
    elif moist == 0:
        tempMessage += "I could use a bit of water, I'm parched. "
    
    if temp == 2:
        tempMessage += "It's burning up in here. Turn on the ac or something! "
    elif temp == 0:
        tempMessage += "Could you grab me a blanket or something? I'm freezing. "
    
    if temp == 1 and moist == 1:
        tempMessage = "Honestly, I can't complain. I'm feeling great"
    
    return tempMessage

def form_email(moist,temp):
    tempMessage = ""
    if moist == 0:
        tempMessage = "Hey man, I could really use some water. I'm feeling parched."
    elif moist == 2:
        tempMessage = "I'm kinda drowning over here, mind draining me out a bit?"
    elif temp == 0:
        tempMessage = "Mind turning on the heater? I'm about to become an ice cube."
    elif temp == 2:
        tempMessage = "I'm about to fry, turn on the ac or something!!"
    return tempMessage
#store your api key below
key = "key-36dd7247883ea5bb74c12c83ec18829c"
#designate your host and port info
#the blank host info designates it will accept any host
host = ''
port = 5555



#determine if this is first connection for the client
firstConnect = True

#create socket object s
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#attempt to bind the socket object to the designated host and port
#if there is a failure, print the error
try:
    s.bind((host,port))
except socket.error as e:
    print(str(e))
#listen for the processing client to connect to the server
s.listen(1)
print("waiting for a connection...")


while True:    
    conn, addr = s.accept()
    #on initiation notify the client they connected
    if(firstConnect):
        conn.send(str.encode("Server and client connected"))
        print("Server and client connected")
        firstConnect = False
    while True:           
        #notify server side of connection info
        print('connected to: ' + addr[0]+":"+str(addr[1]))
        #create a new thread for server client communication

        data = conn.recv(2048)
        message = (data.decode("utf-8"))
        print(message)
        statuses = message.split(",")
        curUV = int(statuses[0])
        curMoist = int(statuses[1])
        curTemp = int(statuses[2])
            
        newUpdate = form_message(curMoist, curTemp)   
        print(newUpdate)
        try:
            api.update_status(status = newUpdate)
            print("tweeted")
        except:
            pass
        
        if(curMoist == 0 or curTemp == 0 or curTemp == 2):
            email = form_email(curMoist, curTemp)
            print(email)
            send_email(email)
        reply = ("Server: " + message)
   
        print(curUV)
        print(curMoist)
        print(curTemp)

        if not data:
            s.close()
            break

        
// processing code
import processing.net.*; 
import processing.serial.*;
import processing.video.*;
//initiate the client, capture  and serial objects
Client myClient;
Serial myPort;

int curMessage;
int curTemp;
int curUV;
int curMoist;


String messageToSend;
int newMessage;
//this string will be used as a sort of buffer for processing to designate
//where it stored the file to
int newIssue = 0;
void setup() { 
  size(640, 480); 
  myPort = new Serial(this, Serial.list()[0],9600);
  
  //initialize the client on home ip with same port as python server 
  //(the port is arbitrary, just has to be the same as the server)
  myClient = new Client(this, "127.0.0.1", 5555); 
  
  //setup communication to arduino
  //myPort = new Serial(this, "COM6", 9600);
  //setup webcam to take frames from stream
}

void draw() { 
  //read the camera stream and display that in the window
//  image(cam,0,0);

  //check the client is active. Then check if the string value has been changed
  //if the string value has been changed, send that value to the python server
  //then reset the string value to empty
  while(myPort.available() > 0){
    curMessage = myPort.read();
    checkMessage(curMessage);
    print("n");
    newIssue = 1;
    messageToSend = str(curUV) + "," + str(curMoist) + "," + str(curTemp);
  }
  //return server output after it has processed the file
  //*TO DO*: handle dropped client connections 
  if (myClient.active()) {
    if (newIssue == 1) {
      myClient.write(messageToSend);
      newIssue = 0;
    }  
    String cur = myClient.readString();
    if (cur != null) {
      println(cur);
    }
  }
//  println(frameCount);
} 

void mouseClicked() {
  if(mouseX > width/2 && mouseY > height/2){
    myClient.stop();
  }
}

void checkMessage(int message){
  if(message == 'a'){
    curUV = 2;
    print("High UV");
  }
  else if(message == 'b'){
    curUV = 1;
    print("Medium UV");
  }
  else if(message == 'c'){
    curUV = 0;
    print("Low UV");
  }
  else if(message == 'd'){
    curMoist = 2;
    print("High Moisture");
  }
  else if(message == 'e'){
    curMoist = 1;
    print("Medium Moisture");
  }
  else if(message == 'f'){
    curMoist = 0;
    print("Low Moisture");
  }
  else if(message == 'g'){
    curTemp = 2;
    print("High Temperature");
  }
  else if(message == 'h'){
    curTemp = 1;
    print("Medium Temperature");
  }
  else if(message == 'i'){
    curTemp = 0;
    print("Low Temperature");
  }
}

//arduino code

int uvSensorPin = A0;
int uvSensorValue;
int moistSensorPin = A1;
int moistSensorValue;
int tempPin = A2;
int tempValue;
int curMessage = 0;
int moistHigh = 400;
int moistMed = 25;
long uvHigh = 75000;
long uvMed = 40000;
int tempHigh = 30;
int tempMed = 20;

void setup(){
  Serial.begin(9600);
  pinMode(uvSensorPin, INPUT);
  pinMode(moistSensorPin,INPUT);
  pinMode(tempPin, INPUT);
}

void loop(){
  long uvSum = 0;
  long moistSum = 0;
  long tempSum = 0;
  
  for(int i = 0; i<1024;i++){
    uvSensorValue = analogRead(uvSensorPin);
    uvSum = uvSensorValue + uvSum;
    moistSensorValue = analogRead(moistSensorPin);
    moistSum = moistSensorValue + moistSum;
    tempValue = analogRead(tempPin);
    tempSum = tempValue + tempSum;
    delay(2);
  }

  long uvMean = uvSum / 1024;
  long moistMean = moistSum / 1024;
  long tempMean = tempSum / 1024;
  float cel = ((tempMean/1024.0)*5000)/10;
  float uv = (uvMean*1000/4.3-83)-21;

  //Serial.print("Current UV index is: ");
  //Serial.print((uvMean*1000/4.3-83)-21);
  //Serial.print(",");
  //Serial.print("n");
  //Serial.print("Current moisture level is: ");
  //Serial.print(moistMean);
  //Serial.print(",");
  //Serial.print("n");
  //Serial.print("Current temperature is: ");
  //Serial.print(cel);
  //Serial.print("n");
  
  if(uv > uvHigh){
    Serial.write('a');
  }
  else if(uv < uvHigh && uv > uvMed){
    Serial.write('b');
  }
  else{
    Serial.write('c');
  }

  if(moistMean > moistHigh){
    Serial.write('d');
  }
  else if(moistMean < moistHigh && moistMean > moistMed){
    Serial.write('e');
  }
  else{
    Serial.write('f');
  }

  if(cel > tempHigh){
    Serial.write('g');
  }
  else if(cel < tempHigh && cel > tempMed){
    Serial.write('h');
  }
  else{
    Serial.write('i');
  }
  
  //Serial.write((uvMean*1000/4.3-83)-21);
  //Serial.write(",");
  //Serial.write(moistMean);
  //Serial.write(",");
  //Serial.write(cel);
  
  delay(120000);
}