Difference between revisions of "Soil Solutions"

From ESE205 Wiki
Jump to navigation Jump to search
m (Protected "Soil Solutions" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(62 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Overview==
 
==Overview==
*For our project, we will be designing a method of watering various plants autonomously. We will do this by using a raspberry pi to monitor the moisture level in the soil and determine how much water should be added to the plants. This will be done with a moisture level sensor designed for the arduino but that should work with the pi as well (we will need an analog to digital convertor for this). If water must be added, the mechanical component will be turned on and water the plant until a sufficient level of moisture is detected by our moisture sensor in the soil. For the mechanical component of the project, we will have a hose with a dripper on the end attached to the water source. The water source will hang directly above the plants and water it from that position. We will also be using the raspberry pi to create a web based application for our system that will record logs of amount of water used, when water was used and current moisture level. This application will solely be used for viewing results that will be updated overtime the plant is watered. It will also be updated when the water level is critically low.
+
*For our project, we will be designing a method of watering various plants autonomously. We will do this by using a raspberry pi to monitor the moisture level in the soil and determine how much water should be added to the different types of plants. This will be done with a moisture level sensor designed for the arduino but that should work with the pi as well (we will need an analog to digital convertor for this). If water must be added, a solenoid also controlled by the pi will be opened and water will flow from the the water source to the plant until a sufficient level of moisture is detected by our moisture sensor in the soil. In order to water various plants and respect the differing needs of water for each plant we will 3D print a spigot for the water source that splits the water path into two directions. Each path will have its own solenoid that will open and close based on the specific plants needs. connected to the solenoids and the spigot will be drip irrigation tubing with button drippers attached to the sides of the tubing. We will also be using the raspberry pi to create a web based application (using Amazon AWS and PyCharm) for our system that will record logs of amount of water used, when water was used and moisture level in the soil. This application will solely be used for viewing results that will be updated every time the plant is watered. It will also be updated when the water level is critically low.
 +
[[Soil_Log| SoilSolutions Log]]
  
 
==Team Members==
 
==Team Members==
*Matt Wilson, Sean Rogers, and Natalie Ng
+
*Matt Wilson  
 +
*Sean Rogers
 +
* Natalie Ng (TA)
  
 
==Objectives==
 
==Objectives==
Line 9: Line 12:
 
#We would like to build on our understanding of coding and learn new techniques that will be useful to us as engineers.
 
#We would like to build on our understanding of coding and learn new techniques that will be useful to us as engineers.
 
#We want this system be compact enough so that it would be easy to install.
 
#We want this system be compact enough so that it would be easy to install.
#Make a system that would be secure from any kind outsider.
 
 
#Overall make everything run smoothly and give ourselves plenty of time to test out our project.
 
#Overall make everything run smoothly and give ourselves plenty of time to test out our project.
#Allow for the system to detect water level in the water source.
+
#Allow for the system to detect the water level in the water source.
  
 
==Challenges==
 
==Challenges==
Line 19: Line 21:
 
*Using the time we have efficiently and not digging ourselves into a hole.
 
*Using the time we have efficiently and not digging ourselves into a hole.
 
==Gantt Chart==
 
==Gantt Chart==
[[File:SGC2.jpeg]]
+
[[File:SGC4.jpg|800px]]
 
 
  
 
==Budget==
 
==Budget==
*FC-28-D Soil Moisture Sensor - $9.99
+
*FC-28-D Soil Moisture Sensor - $5.00
*3Pk 2.5" Terra Cotta Pot - $10.99
+
**[https://www.amazon.com/dp/B06ZYVBRND/_encoding=UTF8?coliid=I376DNVJ36EKUS&colid=TCIV3G12NR41 Soil Moisture Sensor]
*ADC for Raspberry Pi (MCP3008 - 8 Channel 10-Bit ADC with SPI interface) - $7.52
+
*ADC for Raspberry Pi (MCP3008 - 8 Channel 10-Bit ADC with SPI interface) - $3.75
*Drip Irrigation Tubing - 11.98
+
**[https://www.adafruit.com/product/856  Analog to Digital Convertor]
*3 Gallon Plastic Water Bottle - $24.99
+
*Drip Irrigation Tubing (50ft) - $7.66
 +
**[https://www.amazon.com/gp/product/B06ZY8NF61/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1  Tubing]
 +
*1.25 Gallon Plastic Water Bottle - $7.26
 +
**(Bought at Walmart)
 
*Drip Irrigation Button Dripper - $7.37
 
*Drip Irrigation Button Dripper - $7.37
*Miracle Grow Potting Mix - $4.89
+
**[https://www.amazon.com/gp/product/B00J9Q2TQE/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1  Button Drippers]
*2 5V Stepper Motor - $8.59
+
*Potting Mix - $4.89
*2 Water Level Sensors - $9.99
+
**(Bought at Home Depot)
 +
*One Pot - $1.26
 +
**(Bought at Home Depot)
 +
*Water Level Sensors - $39.95
 +
**[https://www.adafruit.com/product/464  Water Level Sensor]
 +
*Peristaltic Pump - $24.95
 +
**[https://www.adafruit.com/product/1150 Pump]
 +
*12V Power Source - $7.48
 +
**[https://www.amazon.com/inShareplus-Mounted-Switching-Connector-Adapter/dp/B01GD4ZQRS/ref=sr_1_4?ie=UTF8&qid=1511990922&sr=8-4&keywords=12v+power+supply 12v Power Supply]
 +
*Hosting Service - $7.67
 
*Raspberry Pi - Provided
 
*Raspberry Pi - Provided
 
*Breadboard - Provided
 
*Breadboard - Provided
 
*Power Source - Provided
 
*Power Source - Provided
*Total - 96.31
+
*Home Depot Sales Tax - $0.75
[[https://www.amazon.com/gp/registry/wishlist/ref=nav_youraccount_wl?ie=UTF8&requiresSignIn=1| Soil Solutions Budget]]
+
*Adafruit Shipping - $7.17
 +
*Amazon Shipping - Free
 +
*Total - $125.16
 
[[Category:Projects]]
 
[[Category:Projects]]
 
[[Category:Fall 2017 Projects]]
 
[[Category:Fall 2017 Projects]]
 +
 +
==Design and Solutions==
 +
We started this project by looking at different sensors we could use for the system. We ended up ordering a moisture sensor, water level sensor, 12V relay(information about setting this up can be found here: [[How_To_Connect_a_12V_Relay_With_a_Raspberry_Pi| 12V Relay Tutorial]]), and a peristaltic pump. All of our purchases for the project can be found on the budget page. For the project to work, we also needed an analog to digital converter. This is because the raspberry pi is not able to take analog inputs on its own so the ADC is needed to convert the digital values into analog values. The circuit diagram to the right shows exactly how to wire all the sensors and how to connect the relay with the pump (this is also shown in our How To).  We needed to use a relay because the water pump that we were using is powered by more than 5v, which is all the raspberry pi can supply. Once the wiring is correct and you have all the components, Implement the code SoilSolutions.py from our repository ([https://github.com/mattgwilson/soilsolutions Soilsolutions Repository]) onto your raspberry pi. Once you have finished this part, you can now move on to the website portion of the project. For the website part of this project, we used Amazon Web Services to host our website. [[File:Soil Solutions Circuit Diagram bb.png|400px|thumb|right]]The first thing to do is make an AWS account. Once that has been done you should navigate to the services tab in the top right of the menu and find Elastic Beanstalk under the tab Compute. Click create environment and make sure you select web server environment. You can name your environment whatever you like. Under Platform, choose preconfigured platform and select Python as the platform you wish to use; also select sample application as the application code (this can be changed from the console menu). Once you environment is created and you are the console menu, you now need to upload and deploy a zip file for your website to be run on. This zip file will contain your python code, html code, css code, and anything else you need to make your website. The code i used is on the GitHub link above. The codes that were zipped together were application.py, requirements.txt, soilsolutions205.db, splash.html, dataview.html, and soilsolutions.css. Once you zip those files together, you can upload and deploy that zip file to the AWS server and once it has finished upload, you can click on the URL at the top of the console and access your website. If you would like to make the homepage of the website look different, you can edit our splash.html code and upload a new zipfile with a new splash.html. At this point nothing is being updated, but you can check that the table is there by entering your URL with the following "/get?id=test" this will show the data points in a table with all there values as test. This is because of the application.py code that defines test and what the values will be when id = test. Because the pi has not been involved, we need to implement a way to update the pi. This is done by adding the code input_data.py into our application.py code(we have already done this). This basically sets the pis ID value to whatever ID you make it and updates the data values based on the results of your sensors. We set our pis ID to 1 (see application.py) so when we type in the browser URL + /get?id=1 it will return the values for our pi. This is the end of the steps for the website. It is secure in a sense that nothing but your pi can affect the data but not secure because anyone can input your ID number and see your data.
 +
 +
==Results==
 +
The project was a success and we completed it with many of our goals satisfied. The website portion of the project was completed but was delayed until after the demonstration. All of the sensors were working and producing values that coincided with our expected results. The website is now functional and is secure from any outside sources trying to distort values but there is no password protection on the values themselves (meaning anyone can view anyones values). All of our modules were completed and we were proud of our results but our projected did consist of a couple of technical difficulties along the way. The original way we were going to dispense the water was with Solenoids and 3D printed parts that connect them. This became very unreliable due to not being able to achieve the minimum pressure on the solenoids needed to stop leakage. As a result we decided to ditch the solenoids last minute and use a peristaltic pump that was much more reliable. We also had some trouble with the website due to some security issues with our hosting provider. We just had to scrap the platform we were using and switch back to AWS which was our original plan. This became a better way to do and met our expectations a lot better. The system did not really meet our cost efficient objective but we did make it water efficient (the pump stops flowing water right when the system turns off meaning we won't have an excess flow of water). The project runs smoothly and detects the water lever and moisture levels accordingly. The objectives we made were met and we are happy with the outcome. Below you will find a video of our project along with the poster used in our demonstration.[[File:Soilsolutions.MOV|thumb|right]] [[FIle:Soil-Solutions.jpg|450px]]

Latest revision as of 12:49, 12 December 2017

Overview

  • For our project, we will be designing a method of watering various plants autonomously. We will do this by using a raspberry pi to monitor the moisture level in the soil and determine how much water should be added to the different types of plants. This will be done with a moisture level sensor designed for the arduino but that should work with the pi as well (we will need an analog to digital convertor for this). If water must be added, a solenoid also controlled by the pi will be opened and water will flow from the the water source to the plant until a sufficient level of moisture is detected by our moisture sensor in the soil. In order to water various plants and respect the differing needs of water for each plant we will 3D print a spigot for the water source that splits the water path into two directions. Each path will have its own solenoid that will open and close based on the specific plants needs. connected to the solenoids and the spigot will be drip irrigation tubing with button drippers attached to the sides of the tubing. We will also be using the raspberry pi to create a web based application (using Amazon AWS and PyCharm) for our system that will record logs of amount of water used, when water was used and moisture level in the soil. This application will solely be used for viewing results that will be updated every time the plant is watered. It will also be updated when the water level is critically low.

SoilSolutions Log

Team Members

  • Matt Wilson
  • Sean Rogers
  • Natalie Ng (TA)

Objectives

  1. We would like to make a system that is both cost and water efficient.
  2. We would like to build on our understanding of coding and learn new techniques that will be useful to us as engineers.
  3. We want this system be compact enough so that it would be easy to install.
  4. Overall make everything run smoothly and give ourselves plenty of time to test out our project.
  5. Allow for the system to detect the water level in the water source.

Challenges

  • Learning how to design a web based app with the raspberry pi.
  • Learning how to code in python and interfacing with the pi.
  • Designing a mechanical component that does not take up too much space.
  • Using the time we have efficiently and not digging ourselves into a hole.

Gantt Chart

SGC4.jpg

Budget

  • FC-28-D Soil Moisture Sensor - $5.00
  • ADC for Raspberry Pi (MCP3008 - 8 Channel 10-Bit ADC with SPI interface) - $3.75
  • Drip Irrigation Tubing (50ft) - $7.66
  • 1.25 Gallon Plastic Water Bottle - $7.26
    • (Bought at Walmart)
  • Drip Irrigation Button Dripper - $7.37
  • Potting Mix - $4.89
    • (Bought at Home Depot)
  • One Pot - $1.26
    • (Bought at Home Depot)
  • Water Level Sensors - $39.95
  • Peristaltic Pump - $24.95
  • 12V Power Source - $7.48
  • Hosting Service - $7.67
  • Raspberry Pi - Provided
  • Breadboard - Provided
  • Power Source - Provided
  • Home Depot Sales Tax - $0.75
  • Adafruit Shipping - $7.17
  • Amazon Shipping - Free
  • Total - $125.16

Design and Solutions

We started this project by looking at different sensors we could use for the system. We ended up ordering a moisture sensor, water level sensor, 12V relay(information about setting this up can be found here: 12V Relay Tutorial), and a peristaltic pump. All of our purchases for the project can be found on the budget page. For the project to work, we also needed an analog to digital converter. This is because the raspberry pi is not able to take analog inputs on its own so the ADC is needed to convert the digital values into analog values. The circuit diagram to the right shows exactly how to wire all the sensors and how to connect the relay with the pump (this is also shown in our How To). We needed to use a relay because the water pump that we were using is powered by more than 5v, which is all the raspberry pi can supply. Once the wiring is correct and you have all the components, Implement the code SoilSolutions.py from our repository (Soilsolutions Repository) onto your raspberry pi. Once you have finished this part, you can now move on to the website portion of the project. For the website part of this project, we used Amazon Web Services to host our website.

Soil Solutions Circuit Diagram bb.png

The first thing to do is make an AWS account. Once that has been done you should navigate to the services tab in the top right of the menu and find Elastic Beanstalk under the tab Compute. Click create environment and make sure you select web server environment. You can name your environment whatever you like. Under Platform, choose preconfigured platform and select Python as the platform you wish to use; also select sample application as the application code (this can be changed from the console menu). Once you environment is created and you are the console menu, you now need to upload and deploy a zip file for your website to be run on. This zip file will contain your python code, html code, css code, and anything else you need to make your website. The code i used is on the GitHub link above. The codes that were zipped together were application.py, requirements.txt, soilsolutions205.db, splash.html, dataview.html, and soilsolutions.css. Once you zip those files together, you can upload and deploy that zip file to the AWS server and once it has finished upload, you can click on the URL at the top of the console and access your website. If you would like to make the homepage of the website look different, you can edit our splash.html code and upload a new zipfile with a new splash.html. At this point nothing is being updated, but you can check that the table is there by entering your URL with the following "/get?id=test" this will show the data points in a table with all there values as test. This is because of the application.py code that defines test and what the values will be when id = test. Because the pi has not been involved, we need to implement a way to update the pi. This is done by adding the code input_data.py into our application.py code(we have already done this). This basically sets the pis ID value to whatever ID you make it and updates the data values based on the results of your sensors. We set our pis ID to 1 (see application.py) so when we type in the browser URL + /get?id=1 it will return the values for our pi. This is the end of the steps for the website. It is secure in a sense that nothing but your pi can affect the data but not secure because anyone can input your ID number and see your data.

Results

The project was a success and we completed it with many of our goals satisfied. The website portion of the project was completed but was delayed until after the demonstration. All of the sensors were working and producing values that coincided with our expected results. The website is now functional and is secure from any outside sources trying to distort values but there is no password protection on the values themselves (meaning anyone can view anyones values). All of our modules were completed and we were proud of our results but our projected did consist of a couple of technical difficulties along the way. The original way we were going to dispense the water was with Solenoids and 3D printed parts that connect them. This became very unreliable due to not being able to achieve the minimum pressure on the solenoids needed to stop leakage. As a result we decided to ditch the solenoids last minute and use a peristaltic pump that was much more reliable. We also had some trouble with the website due to some security issues with our hosting provider. We just had to scrap the platform we were using and switch back to AWS which was our original plan. This became a better way to do and met our expectations a lot better. The system did not really meet our cost efficient objective but we did make it water efficient (the pump stops flowing water right when the system turns off meaning we won't have an excess flow of water). The project runs smoothly and detects the water lever and moisture levels accordingly. The objectives we made were met and we are happy with the outcome. Below you will find a video of our project along with the poster used in our demonstration.

Soil-Solutions.jpg