Beruflich Dokumente
Kultur Dokumente
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
AllPlaces > DesignChallenges > VerticalFarming > Blog > 2015> October > 19
VerticalFarming
$XWRPDWHG*UHHQ+RXVH%ORJ:DWHU
0HWHU&DOLEUDWLRQ
Postedbym.ratcliffeinVerticalFarmingonOct19,20153:01:00PM
InthepreviouswatermeterBlogsweusedacheapflowmetertogiveusameasureofwater
flowrateandtotalwaterused.Theflowmetersarecheapandthespecsheetcanbemisleading,
thiscodeisusedtogetarealworldvalueofnumberofpulsesperLofwaterdelivered.
>Connectthewatermeterinline,andprimesystem
>Turntapoff
>StartArduino
>Turntapontofillupaknownvolume
ClicksperL=Volume/PulseCount[VolumemustbeinL]
Wecanusethisvalueinourpreviouscodetogetreallyaccuratereadings
LCDShiledthatitwillworkwith:
Cookiesontheelement14Communitywebsite
Continue
Weusecookiestoensurethatwegiveyouthebestexperienceonourwebsite.Ifyoucontinuetousethesite
withoutchangingyoursettings,we'llassumethatyouarehappytoreceiveallcookiesonthesite.Youcanfindout
moreaboutcookiesandhowtomanageyourcookiesettingsatanytimebyclickinghere.
Pinout[SolderontoLCDshiledispreferred]:
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
Ignoreexternalpullup,wearedoingthatinsoftwareinstead
Header1
/*Thisscriptisusedtomakesenseoftheoutputfromahalleffectwaterflowmeterfor
calibration
CalibratingWaterMeters:
>LoadCalibrationCode
>Connectthewatermeterinline,andprimesystem
>Turntapoff
>StartArduino
>Turntapontofillupaknownvolume
ClicksperL=Volume/PulseCount[VolumemustbeinL]
FeedbackSurvey
Wecanusethisvalueinourpreviouscodetogetreallyaccuratereadings
Whenyouaredonewithyourvisittooursite,
MichaelRatcliffe Mike@MichaelRatcliffe.com
pleasefilloutourfeedbacksurvey.
nothanks[x]
StarttheSurveyNow!
Thisprogramisfreesoftware:youcanredistributeitand/ormodify
poweredindependentlybyQualtrics
itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby
theFreeSoftwareFoundation,eitherversion3oftheLicense,or
(atyouroption)anylaterversion.
Thisprogramisdistributedinthehopethatitwillbeuseful,
butWITHOUTANYWARRANTYwithouteventheimpliedwarrantyof
MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe
GNUGeneralPublicLicenseformoredetails.
YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
alongwiththisprogram.Ifnot,see<http://www.gnu.org/licenses/>.
Components:
Seemainfolderforsensordatasheets,requiredliabariesandextrainformation:[canbe
downloadedviawww.michaelratcliffe.com]
AllpowersystemsshouldbepowerdofDCvoltageofbelow48vforsafter[waterisaround]
12visprefferableandcheapest.AsalwaysthisisaDIYprojectanddoneatyourownrisk.
>ArduinoUno
>HallEffectWaterFlowMeter5v
>LCDbuttonShield[Hobbytronix]
*/
//includingsomelibrariesforinterfacingwithharware
#include<LiquidCrystal.h>//StandardLCDLbrary
#defineWater_pin2
#defineRelayA2
//*********************8*SettingupLCD************************//
//selectthepinsusedontheLCDpanel
LiquidCrystallcd(8,9,4,5,6,7)
//*****************************EndOfUserDefinedVariables
**************************************************//
unsignedlongPulseCount=0//counterforwatermeterpulses
//****************************SetupRoutine,RunsOnceandSetsusedpinstocorrect
value*******************//
voidsetup(){
//Stopingnoisefrombeingaproblem,pinishighuntillhallsensorpullsitlow
pinMode(Water_pin,INPUT)
digitalWrite(Water_pin,HIGH)//saveshavinganexternalpullup
//ExternalInterrupts:Thisiswhatthewatrmeterpulsecountiscollectedfrom
attachInterrupt(0,WaterCounter,FALLING)//watermeterpulseoutputconnectedtopin2
lcd.begin(16,2)//startthelibrary
lcd.setCursor(0,0)
lcd.print("")
delay(3)
lcd.setCursor(1,1)
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
lcd.print("")
//**************************************MainLoopthatwillcontinualyrun
******************************************//
voidloop(){
lcd.setCursor(0,0)
lcd.print("Pulse_Count:")
lcd.setCursor(0,1)
lcd.print(PulseCount)
delay(300)//justashortdelaytoletthingssettle
}
//*************InteruptroutineforwatermeterreadingsRunseverytimesensorhasa
pulse*************//
voidWaterCounter(){
//Incrementthepulsecounter
PulseCount++
156Views
Tags:adapted_greenhouse
&RPPHQWV
LoginorRegistertocomment
DABOct19,20157:32PM
Nicesimpleinterface.
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
Ididnotknowthattheyhadmeterslikethisformeasuringfluidflow.
DAB
Like(0)
m.ratcliffeOct19,20157:51PM(inresponsetoDAB)
Theyaregreatproducts,thespecsheetsarntthataccuratebutforafewdollarsthey
aregreat.
Itsainlineturbinewithmagnetsmountedandahallsensortopicktheturning
motionup,sonotmuchtogowrong.
Like(0)
Topics
Resources
Content
Design
Center
Members
3DPrinting
AskIndustry
Blogposts
Arduino
Experts
Documents
Products
Directory
Businessof
TheBenHeck
Discussions
AnalogDemo
Memberofthe
Month
Member
Engineering
Show
Polls
Boards
Embedded
CadSoftEAGLE
Videos
Development
Ranking&
Industrial
Design
Events
Platforms&
Points
CodeExchange
Kits
AskIndustry
Robotics
Design
Emulation&
Experts
Internetof
Challenges
Debugging
TopMembers
Feedback&
Software
WhyJoin?
OpenSource
Support
IDEs&
Thisweekon
Hardware
Learning
Compilers
element14
Power&
Center
OS&
Energy
Legislation
Middleware
RaspberryPi
Manufacturers
Test&
RaspberryPi
News
Simulation
Accessories
PCB
EDATools
RaspberryPi
Prototyping
Projects
Purchasing
GetStarted
Solutions
WithPi
RoadTest
Sensors/MEMS
STEMAcademy
SingleBoard
Watch
Computers
element14TV
Testand
Webinarsand
Measurement
Training
Automation&
Things
Wearable
Technology
Featured
Store
Visitstorefor
UnitedKingdom
Choosea
differentstore
Technologies
AtmelXplained
CircuitStudio
PCBDesign
Freescale
Freedom
Platform
MATLABfor
Students
LPCXPRESSO
EcoSystem
SingleBoard
Computers
element14isthefirst
onlinecommunity
specificallyforengineers.
Connectwithyourpeers
andgetexpertanswersto
yourquestions.
AboutUs
OurEvolution
FollowUs
STMDiscovery
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE
9HUWLFDO)DUPLQJ$XWRPDWHG*UHHQ+RXVH%ORJ_HOHPHQW
Series
TILaunchpads
TimesysLinux
Support
ViewAll>>
CircuitDesign
MobileApp
DownloadiOSapp
DownloadAndroidapp
&Tools
AltiumPCB
Design
EAGLEPCB
Design
PCBFabrication
PCBAssembly
Design
Services
Find
Search&Filter
Technial
Library
Wheredid
theknodego?
KWWSZZZHOHPHQWFRPFRPPXQLW\FRPPXQLW\GHVLJQFKDOOHQJHVYHUWLFDOIDUPLQJEORJDXWRPDWHGJUHHQKRXVHEORJZDWHUPHWHUFDOLE