Go Down

Topic: Arduino relay controller + Timer (Read 485 times) previous topic - next topic

tylerart

Hello! I am currently working on a automated hydroponics system and have ran into a small issue. The way i currently have it set up is that at every sunday at midnight three peristaltic pumps turn on via relays for x amount of seconds each pumping in the correct amount of nutrients from each pump and then they turn off. This has worked wonderfully without an issue. But i would like it so that week one through four, the pumps pump for x amount of seconds, and then every week after that i can change how long each pump is ran to change much is nutrients pumped in, according to the the amount of days into the grow cycle.

currently they way it is set up is delays after each pump [  delay of 1000 = aprox 1ml of liquid ]


currently I am using a ds1307 rtc module. Any input would be greatly appriciated!

Paul_KD7HB

Doesn't seem like to difficult of a problem to count Sundays, 0,1,2,3 and do something different for each count. Then after 3, reset to zero.

Paul

tylerart

Thanks Paul for the reply! Could you possibly shoot me a small example on how to count Sundays. I have searching for something like this with no success. The goal is for it to start counting weeks after startup of the arduino or after a button is pressed to initiate the start of a grow cycle.

Delta_G

#3
May 21, 2017, 03:15 am Last Edit: May 21, 2017, 03:16 am by Delta_G
Thanks Paul for the reply! Could you possibly shoot me a small example on how to count Sundays.
It's really simple.   Just think about it.


Code: [Select]


int numberOfSundays = 0;


//  later in loop where you turn on the pump

numberOfSundays++;





|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Paul_KD7HB

Thanks Paul for the reply! Could you possibly shoot me a small example on how to count Sundays. I have searching for something like this with no success. The goal is for it to start counting weeks after startup of the arduino or after a button is pressed to initiate the start of a grow cycle.
Your first post said you did the watering on Sunday, so I had to assume you knew when Sunday occurred.

Paul

Go Up