https://eclass.yorku.ca/eclass/pluginfile.php/3107479/mod_resource/content/1/MinorProject_EECS1011_MainDoc_Nov2021_v2 EECS 1011 Minor Project Info Document (v2) Nov XXXXXXXXXX Copyright James Andrew...

1 answer below »
please anwer all parts


https://eclass.yorku.ca/eclass/pluginfile.php/3107479/mod_resource/content/1/MinorProject_EECS1011_MainDoc_Nov2021_v2 EECS 1011 Minor Project Info Document (v2) Nov 24 2021 Copyright James Andrew Smith; you do not have permission to upload or transmit or share this document outside of York University. Minor Project: Auto Plant Watering with Arduino and Matlab James Andrew Smith Assoc. Prof., York University [update] This document begins with a discussion of an important software concept for your project: state machines. It then goes on to describe the components in the project. This is a major revision of an earlier document and so some elements that describe the project, the reporting and the goals will be added at a later date. Introduction to State Machines State machines are a fundamental concept in developing programs and control systems. They’re not really “machines” like a car engine, elevator or amusement ride. Instead, think of them as the core of a program that takes actions based on things that are sensed or measured. Hunger example It’s almost lunch time and you’re in a state of hunger. What do you do? You go eat. Once you’re done eating, you’re in a state of satiation (you’re not hungry). So, you no longer eat. What I’ve just described is you as a “state machine”: a machine with states (e.g. conditions, feelings, sensed things). What is sensed drives the state of you or an object. In response to the sensing and the state it results in, an action is taken. In other words, a state machine produces an action in response to what it senses or perceives. Figure 1 A state machine to describe what to do when you're hungry or not. Reference: Finite State Machines on Wikipedia: https://en.wikipedia.org/wiki/Finite-state_machine Watering example EECS 1011 Minor Project Info Document (v2) Nov 24 2021 Copyright James Andrew Smith; you do not have permission to upload or transmit or share this document outside of York University. Something similar to the hunger example on the previous page happens in an automated plant watering system like the one you’ll work on for your minor project. To control the plant watering in your project you’ll need to organize your Matlab program so that it is reactive: 1. if the soil is dry, then water it; 2. if the soil is wet, but not too wet, then also water it; 3. if the soil is wet enough, then don’t water it. In the list above the soil being dry is the first state of your system. The second state is described by the soil being “wet, but not too wet”. The third state is “wet enough”. Each of these states has an action associated with it: 1. State: dry à Action: Water 2. State: wet, but not too wet à Action: Water 3. State: wet enough à Action: Don’t Water What does this maybe look like in a program?1 1. if(readVoltage(myBoard,soilSensor) < reallydryvalue)="" then="" writedigitalpin(myboard,pumppin,onsignal)="" 2.="" if(readvoltage(myboard,soilsensor)="">< moisturethreshold)="" then="" writedigitalpin(myboard,pumppin,onsignal)="" 3.="" if(readvoltage(myboard,soilsensor)=""><= saturatedvalue)="" then="" writedigitalpin(myboard,pumppin,offsignal)="" of="" course,="" the="" code="" written="" isn’t="" strictly="" correct…="" it’s="" close.="" you’ll="" have="" to="" adapt="" it="" to="" matlab="" by:="" 1.="" writing="" the="" if-else="" structure="" correctly="" 2.="" defining="" the="" myboard,="" soilsensor,="" reallydryvalue,="" etc.="" values.="" 1="" this="" is="" pseudo-code.="" it="" won’t="" run="" without="" modification.="" eecs="" 1011="" minor="" project="" info="" document="" (v2)="" nov="" 24="" 2021="" copyright="" james="" andrew="" smith;="" you="" do="" not="" have="" permission="" to="" upload="" or="" transmit="" or="" share="" this="" document="" outside="" of="" york="" university.="" a="" traffic="" light="" state="" machine="" function="" in="" matlab="" here’s="" a="" classic="" state="" machine:="" traffic="" lights.="" we="" use="" time="" as="" the="" measured="" input="" and="" return="" two="" outputs:="" a="" displayed="" value="" and="" a="" function="" output.="" in="" the="" table="" below,="" you="" can="" see="" how="" i="" call="" the="" matlab="" function="" from="" the="" command="" line,="" providing="" the="" starting="" time="" as="" 0="" as="" the="" first="" input="" parameter="" and="" the="" current="" time="" as="" the="" second="" input="" parameter.="" example:="" green="" light="" state="" example:="" yellow="" light="" state="" example:="" red="" light="" state="" you="" can="" see="" that="" the="" function="" responds="" by="" displaying="" a="" message="" and="" also="" by="" returning="" a="" string="" (“green”,="" “yellow”="" or="" “red”).="" function="" trafficlightstate="..." whatlightcolourisit(starttime,="" currenttime)="" %="" define="" boundary="" times="" for="" light="" signals="" (0="" -="" 12="" seconds)="" redstart="0;" %="" red="" starts="" at="" 0="" sec="" redend="5;" %="" red="" ends="" at="" 5="" sec="" yellowstart="redEnd;" %="" yellow="" starts="" @="" red="" end="" yellowend="7;" %="" yellow="" ends="" at="" 7="" sec="" greenstart="yellowEnd;" %="" green="" strt="" @="" yellow="" end="" greenend="12;" %="" green="" ends="" at="" 12="" seconds="" %="" what="" part="" of="" the="" timed="" light="" cycle="" are="" we="" on?="" %="" use="" the="" "modulo"="" operation="" to="" synchronize="" on="" 12="" %="" seconds="" limit="" (greenend)="" cyclepart="mod(currentTime,greenEnd);" %="" if="" cyclepart="" is="" 0="" we="" have="" restarted.="" %="" begin="" the="" "if",="" linking="" cyclepart's="" time="" to="" the="" light's="" state.="" if(cyclepart="">< redend)="" %="" red="" light="" "state"="" disp("state:="" red="" light.");="" trafficlightstate="Red" ;="" elseif(cyclepart="">< yellowend)="" %yellow="" "state"="" disp("state:="" yellow="" light.");="" trafficlightstate="Yellow" ;="" elseif(cyclepart=""><= greenend) % green "state" disp("state: green light."); trafficlightstate = "green"; else % error "state" disp("error: big time error!"); trafficlightstate = "error"; end % end of the if statement end % end of the function source code state machine diagram the details for creating the function are below, along with a visualization of the flow of the program. the complete traffic cycle is expected to last 12 seconds in this example. we use the eecs 1011 minor project info document (v2) nov 24 2021 copyright james andrew smith; you do not have permission to upload or transmit or share this document outside of york university. modulo function to deal with time above 12 seconds as simply a multiple of the same process, so that 12 to 24 seconds behaves the same as 0 to 12. eecs 1011 minor project info document (v2) nov 24 2021 copyright james andrew smith; you do not have permission to upload or transmit or share this document outside of york university. the minor project the minor project involves using a matlab program connected to an arduino-compatible board to monitor and maintain plant soil moisture. objective and execution you should create a program in matlab that allows long-term monitoring of the plant soil to ensure that the plant receives water as it needs it. that means measuring the soil moisture using a soil moisture sensor attached to your arduino or grove board. when the soil is dry, have a mosfet or relay board turn a water pump on to deliver water to the soil, turning off the pump when there is enough water in the soil. then wait until the soil is dry again and start the process over again. while you should be able to connect your computer to your arduino or grove board for days at a time to let the dry-wet-dry-wet cycle occur over and over, you can also unplug the board and restart the program if need be. the core of your matlab program should resemble a state machine, as shown in the previous pages. however, instead of controlling traffic lights, your state machine should be controlling water flow. submission for final report and video all students are to submit 1. a three page report describing their project 2. a one minute video describing their project 3. the matlab source code for their project eecs 1011 minor project info document (v2) nov 24 2021 copyright james andrew smith; you do not have permission to upload or transmit or share this document outside of york university. the report the report must 1. include a cover page with a. your name and student id b. the class name c. the date d. an abstract i. an example abstract is given to the right ii. include all of the bolded headings iii. one paragr 2. show your plant and your hardware setup a. label the different parts, in a similar fashion to how i have with my plant watering setup. 3. include an illustration of the flow of your matlab program. this is commonly known as a flow-chart. a. what is a flowchart? read this page: https://en.wikipedia.org/wiki/flowchart b. you can draw the flowchart by hand or with the help of a computer program (even powerpoint can do it!) c. make sure that components like loops and conditional statements are clearly illustrated greenend)="" %="" green="" "state"="" disp("state:="" green="" light.");="" trafficlightstate="Green" ;="" else="" %="" error="" "state"="" disp("error:="" big="" time="" error!");="" trafficlightstate="ERROR" ;="" end="" %="" end="" of="" the="" if="" statement="" end="" %="" end="" of="" the="" function="" source="" code="" state="" machine="" diagram="" the="" details="" for="" creating="" the="" function="" are="" below,="" along="" with="" a="" visualization="" of="" the="" flow="" of="" the="" program.="" the="" complete="" traffic="" cycle="" is="" expected="" to="" last="" 12="" seconds="" in="" this="" example.="" we="" use="" the="" eecs="" 1011="" minor="" project="" info="" document="" (v2)="" nov="" 24="" 2021="" copyright="" james="" andrew="" smith;="" you="" do="" not="" have="" permission="" to="" upload="" or="" transmit="" or="" share="" this="" document="" outside="" of="" york="" university.="" modulo="" function="" to="" deal="" with="" time="" above="" 12="" seconds="" as="" simply="" a="" multiple="" of="" the="" same="" process,="" so="" that="" 12="" to="" 24="" seconds="" behaves="" the="" same="" as="" 0="" to="" 12.="" eecs="" 1011="" minor="" project="" info="" document="" (v2)="" nov="" 24="" 2021="" copyright="" james="" andrew="" smith;="" you="" do="" not="" have="" permission="" to="" upload="" or="" transmit="" or="" share="" this="" document="" outside="" of="" york="" university.="" the="" minor="" project="" the="" minor="" project="" involves="" using="" a="" matlab="" program="" connected="" to="" an="" arduino-compatible="" board="" to="" monitor="" and="" maintain="" plant="" soil="" moisture.="" objective="" and="" execution="" you="" should="" create="" a="" program="" in="" matlab="" that="" allows="" long-term="" monitoring="" of="" the="" plant="" soil="" to="" ensure="" that="" the="" plant="" receives="" water="" as="" it="" needs="" it.="" that="" means="" measuring="" the="" soil="" moisture="" using="" a="" soil="" moisture="" sensor="" attached="" to="" your="" arduino="" or="" grove="" board.="" when="" the="" soil="" is="" dry,="" have="" a="" mosfet="" or="" relay="" board="" turn="" a="" water="" pump="" on="" to="" deliver="" water="" to="" the="" soil,="" turning="" off="" the="" pump="" when="" there="" is="" enough="" water="" in="" the="" soil.="" then="" wait="" until="" the="" soil="" is="" dry="" again="" and="" start="" the="" process="" over="" again.="" while="" you="" should="" be="" able="" to="" connect="" your="" computer="" to="" your="" arduino="" or="" grove="" board="" for="" days="" at="" a="" time="" to="" let="" the="" dry-wet-dry-wet="" cycle="" occur="" over="" and="" over,="" you="" can="" also="" unplug="" the="" board="" and="" restart="" the="" program="" if="" need="" be.="" the="" core="" of="" your="" matlab="" program="" should="" resemble="" a="" state="" machine,="" as="" shown="" in="" the="" previous="" pages.="" however,="" instead="" of="" controlling="" traffic="" lights,="" your="" state="" machine="" should="" be="" controlling="" water="" flow.="" submission="" for="" final="" report="" and="" video="" all="" students="" are="" to="" submit="" 1.="" a="" three="" page="" report="" describing="" their="" project="" 2.="" a="" one="" minute="" video="" describing="" their="" project="" 3.="" the="" matlab="" source="" code="" for="" their="" project="" eecs="" 1011="" minor="" project="" info="" document="" (v2)="" nov="" 24="" 2021="" copyright="" james="" andrew="" smith;="" you="" do="" not="" have="" permission="" to="" upload="" or="" transmit="" or="" share="" this="" document="" outside="" of="" york="" university.="" the="" report="" the="" report="" must="" 1.="" include="" a="" cover="" page="" with="" a.="" your="" name="" and="" student="" id="" b.="" the="" class="" name="" c.="" the="" date="" d.="" an="" abstract="" i.="" an="" example="" abstract="" is="" given="" to="" the="" right="" ii.="" include="" all="" of="" the="" bolded="" headings="" iii.="" one="" paragr="" 2.="" show="" your="" plant="" and="" your="" hardware="" setup="" a.="" label="" the="" different="" parts,="" in="" a="" similar="" fashion="" to="" how="" i="" have="" with="" my="" plant="" watering="" setup.="" 3.="" include="" an="" illustration="" of="" the="" flow="" of="" your="" matlab="" program.="" this="" is="" commonly="" known="" as="" a="" flow-chart.="" a.="" what="" is="" a="" flowchart?="" read="" this="" page:="" https://en.wikipedia.org/wiki/flowchart="" b.="" you="" can="" draw="" the="" flowchart="" by="" hand="" or="" with="" the="" help="" of="" a="" computer="" program="" (even="" powerpoint="" can="" do="" it!)="" c.="" make="" sure="" that="" components="" like="" loops="" and="" conditional="" statements="" are="" clearly="">
Answered Same DayNov 30, 2021

Answer To: https://eclass.yorku.ca/eclass/pluginfile.php/3107479/mod_resource/content/1/MinorProject_EECS1011_M...

Sathishkumar answered on Dec 01 2021
126 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here