Sowhatwe'regonna d'ohisifwe'regetting a readingofbelow 300.
Thenwe'regoingtolightupthegreenledbecausethatsays, Okay, we'regetting a lotofconductivitythroughhere, sothatmeansthere's there's moisturehere, sowe'regoingtosaythatthesoilismoist, butifthenumberisabove 300 we'regoingtoturnonthered L e d.
Tosay, Hey, weprobablyneedtowatertheplants.
Oh, thisisgoingtogiveyou a visualcue a visualnotificationonwhentoornottowantinyourplant.
Soifyou'regoingtodothisintherealworld, what I wouldsayisfigureoutwhatmoisturelevelyourplantsshouldbeshoved a littlemoisturesensorinthere, getyourreadingandthencreatetheveryopalbasedoffofthatreading.
Sowiththat, let's gooverandtake a lookatthecodetoseehowthiscomestogetherinthecup.
Sohereis a codeforthisparticularproject, andagainit's relativelysimple.
Sothefirstthingthatwe'regoingtohavetodoiswe'regoinghavetodefinetheanalogpensforthesoilsensors, sowe'llsimplyhavesoilsensoronethatwillgotoanalogPennzero a zerosoilsensortotoantelopein a one.
Thenwe'regoingtohavetodefinethe L E D lightstobeabletoturnthemon.
I justsimplyset a valueof 300 becausethatworksforthisparticularprojectagaintosayagain, Figureoutwhatnumberworksforyourplant.
Don't Scottbebasedanyways?
Thenwe'regonnagodown.
We'regonnasetuptheenvironmentthanwiththis.
Allweresimplydoingisthepinmodefunctionwe'resettingGreenledRedledGreenledtoReadledtoweresettingallofthosetwooutputbasicallyjusttobeabletoturnonthe l ladiesandthenfortroubleshootingpurposes.
Ifyou'redealingwiththesemoisturesensors, they'renotexactlyItisdone a lotofwaterthereago.
We'regonnadothisthegeekway.
We'regonnadothisthegeekway.
Thereyougo.
Sothereyouare.
There's theproject.
Soforallyougeeksouttherethatyouknow, one a betteroflife, a healthierlife, having a havingindoorplants.
Maybenow, maybenowwhenyouseethatredled, youwerelike, Oh, I shouldprobablywaterthatthing.
That's a goodidea.
Doremembertodoremember, poweringandledisthesameaspoweringlike a P S O buzzersoyoucanactuallypower a buzzer.
SoifyouthinkOh, I don't I don't knowif I'llremembertolookatanledlight.
Maybeifyouhave a buzzerandthebuzzersbuzzing, maybethatwillgetyoutonoticeorand a futureprojectonethingswe'regoingtodointhefutureiswe'reactuallygoingtoconnectsetuplikethistopower a waterpump, andthenandthennotonlyyoucanyoubenotifiedthatthere's a problem?
Esoifyou'regoingtobedoingthisathome, Oneofthebigthingsthat I wouldsayiswhenyou'resettingthosevariables, youmayactuallywanttocreatedifferentvariablesforthegoodmoisture, right?
Goodmoistureforpotoneandgoodmoistureforpotto a goodmoistureforpotthreeandthenseewhatthesensorisreadingandthencreatethevalueforthosevariablesbasedoffoftheindividualpotsandtheindividualsensors.
Thatisjustoneofthosethingsthat I willwarnyouwiththeseparticularsensorsisyoucanputtwo.
Whatareofwhataresupposedtobe?
I don't It's supposedtobeidenticalsensorsintotheexactsamepot, notthatfarawayfromeachotheron, andyouwillget a prettylargevariants.
I wasgettingupto, ah, 100 variancewithwhatthesensorswereseen.