I'm relatively new to Arduino and am wondering if an Arduino could be used for my project.
I need to turn a light on and off at set intervals, with temperature limits.
I need to turn a sprinkler solenoid on and off at set intervals, with temperature limits.
Would there be a way to control two or three relays which would turn the light and sprinkler on depending on an input temperature?
Example: A temp sensor as an input would allow the sprinkler to be on for 2 hours for every 8 hours only if the temperature was between 50F and 120F. The temp sensor would also allow a light to be on for 2 hours and off for 1 hours continuosly as long as the temperature is not above 120F.
Any info would be awesome. I am just beginning learning program writing for the arduino. I'm only a little bit past the "Hello World." phase. But if this is a doable project, I will have more inquiries.
I wrote down a layout of my initial though on this matter, might be useful, might not.
//PSEUDO CODE
//read temperature
//if (temperature <= 120F)
//if (timeToIncrementHours())
//hours++;
//if (hours==8)
//hours=0; //reset hours when it has reached 8, you only need 8 hour resolution [0,1,2,3,4,5,6,7]
//lightOn(); //default to light on
//if (hours%3==2) //constrain hours to be [ 0, 1, 2 ]
//lightOff(); //if it is time to shut off the light do so
//if (temperature > 120F)
//if (hours < 2)
//sprinklerOn();
//else if (hours >=2)
//sprinklerOff();
Thanks for the quick response. I can follow about 75% of what is going on, the 0,1,2 hour constraint in the program is beyond me at the current time. To be clear, this is just a guide for a program, I couldn't actually use any of this as true program code, correct?
I was also thinking that I could have the outputs to the sprinkler and light controlling relays that get turned on and off through a transistor. The relay would open and close which would turn on or off external timers. Like the motor controlled dial-type appliance timers. That way I wouldn't have to have the arduino control the time intervals. I'm not sure if this would be easier or not. I think I'd like to keep the programming code at a bare minimum. Adding extra hardware such as external timers is not an issue.
I'm just wondering if an Arduino output continuously putting out +5V for long periods will wear the outputs out too fast.