a new motion sequence has been detected makes sure this block of code is only executed again after Int moistureState = 0 // variable for reading the moisturePin status Int moisturePin = 4 // designates pin 4 as hygrometer Int relayPin = 8 // designate pin 8 to control the solenoid relay Int pirPin = 7 //the digital pin connected to the PIR sensor's output before we assume all motion has stopped the amount of milliseconds the sensor has to be low the time when the sensor outputs a low impulse the time we give the sensor to calibrate (10-60 secs according to the datasheet) * assuming continuous motion is present during these phases. * This program deals with this issue by ignoring LOW-phases shorter than a given time, * which might give the impression no motion is present. * However, even if motion is present it goes to LOW from time to time, * The sensor's output pin goes to HIGH if motion is present. * The Parallax PIR Sensor is an easy to use digital infrared motion sensor module. * released under a creative commons "Attribution-NonCommercial-ShareAlike 2.0" license * Kristian Gohlke / krigoo (_) gmail (_) com / * Determines the beginning and end of continuous motion sequences. * Switches a LED according to the state of the sensors output pin. * //making sense of the Parallax PIR sensor's output I took code for "button" and code for PIR and adapted and melded the two, successfully I hope, it compiles fine, but I have no idea if it'll work like I planned. I want the sprinkler to fire momentarily on motion and to fire when the hygrometer signal is high, so the damn dogs and cats stay away and the area stays as wet as I want. I ordered a parallax PIR, a 12v 3/4" solenoid for the garden hose, an adjustable arduino moisture sensor (high = dry), a 5v relay and a sprinkler with a spike to stick in the ground. Hello, I have an area of my yard I want to keep my cats and dogs out of, I also frequently water this garden area, motion activated sprinklers are like $50.00, so I wanted to build a motion activated sprinkler using an uno board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |