Irrigation Controller (up to 16 valves with Shift Registers)
-
@Mark-Jefford said:
one thing to note the shift register 0b0000000010000000 does not seem to work, will work out a plan around this as i need to run a 12 pump off the relay bank to draw water from the water butt.
Can you explain more? is there a bug?
@BulldogLowell
Hi! :)Rather than using valve 8, i am using only a block of 4, but currently have a 2 channel for testing.
My reading into shift registers showed 0b0000000010000000 is 2x 8 bit outputs, B0-B7
tried configuing B0 and B7 to try and activate relay 1, was still seeing 5V on all pins apart from the output pin for the zone in use (EG zone 2 expecting Zone1 to alway be on)
or am i doing this completely wrong? :)
-
@BulldogLowell
Hi! :)Rather than using valve 8, i am using only a block of 4, but currently have a 2 channel for testing.
My reading into shift registers showed 0b0000000010000000 is 2x 8 bit outputs, B0-B7
tried configuing B0 and B7 to try and activate relay 1, was still seeing 5V on all pins apart from the output pin for the zone in use (EG zone 2 expecting Zone1 to alway be on)
or am i doing this completely wrong? :)
hmmm... are your relays ACTIVE HIGH (actuate wiht a 5V signal) or ACTIVE LOW (actuate when brought to ground) type?
-
hmmm... are your relays ACTIVE HIGH (actuate wiht a 5V signal) or ACTIVE LOW (actuate when brought to ground) type?
Oh, well this is strange, if i disconnect the pin to the relay, it does not activate when unpowered.
but from the shift register it is +5 when the zone is not active, and 0V when active, so i assume its an active low not active high by your example... surely removing the 5V feed to the relay pin should make it activate.. not sure whats going on there, some sort of black magic :P
My reading of shift registers has made my brain hurt.. do i need to reverse the 0000000010000000 for 1111111101111111?
-
Dear all,
i have trying to make the irrigation controller to start all zones in same time and run for the specified. I'm using version for domoticz. Can you please help me out with hint of what i can change in the code ?
Another thing is that from domoticsz when i start a zone that zone start and previous is stopped but that status is not updated.Thank you in advance.
P.S. I will post some pictures of the hardware build soon.
-
Dear all,
i have trying to make the irrigation controller to start all zones in same time and run for the specified. I'm using version for domoticz. Can you please help me out with hint of what i can change in the code ?
Another thing is that from domoticsz when i start a zone that zone start and previous is stopped but that status is not updated.Thank you in advance.
P.S. I will post some pictures of the hardware build soon.
have you tried changing the eight to one?
#define NUMBER_OF_VALVES 8 // Change this to set your valve count up to 16.trigger all your relays with the same output.
-
Well, that's not the point.
I will have 4 zones that need different type of water needs. For example one zone will be with micro irrigation watering, another one with lawn sprinkler. i do not understand why not to start all zones at once and they will finish according to the time set and not to start one after other. Another thing is why to wait for a zone to finish when you trigger another one.To start all valve at once when is trigger all zones i did change:
else if (state == RUN_ALL_ZONES) { if (lastValve != valveNumber) { for (byte i = 0; i <= NUMBER_OF_VALVES; i++) { if (i == 0 || i == valveNumber) { gw.send(msg1valve.setSensor(i).set(true), false); } else { gw.send(msg1valve.setSensor(i).set(false), false); } } } lastValve = valveNumber; fastToggleLed(); if (state != lastState) { valveNumber = 1; updateRelays(ALL_VALVES_OFF); DEBUG_PRINTLN(F("State Changed, Running All Zones...")); } unsigned long nowMillis = millis(); if (nowMillis - startMillis < VALVE_RESET_TIME) { updateRelays(ALL_VALVES_OFF); } else if (nowMillis - startMillis < (allZoneTime[valveNumber] * 60000UL)) { updateRelays(BITSHIFT_VALVE_NUMBER); } elsewith
else if (state == RUN_ALL_ZONES) { if (lastValve != valveNumber) { for (byte i = 0; i <= NUMBER_OF_VALVES; i++) { if (i == 0 || i == valveNumber) { gw.send(msg1valve.setSensor(i).set(true), false); } else { gw.send(msg1valve.setSensor(i).set(true), false); //to update domoticz } } } lastValve = valveNumber; fastToggleLed(); if (state != lastState) { valveNumber = 1; updateRelays(ALL_VALVES_OFF); DEBUG_PRINTLN(F("State Changed, Running All Zones...")); } unsigned long nowMillis = millis(); if (nowMillis - startMillis < VALVE_RESET_TIME) { updateRelays(0); //all outputs will be on } else if (nowMillis - startMillis < (allZoneTime[valveNumber] * 60000UL)) { updateRelays(BITSHIFT_VALVE_NUMBER); } else -
Well, that's not the point.
I will have 4 zones that need different type of water needs. For example one zone will be with micro irrigation watering, another one with lawn sprinkler. i do not understand why not to start all zones at once and they will finish according to the time set and not to start one after other. Another thing is why to wait for a zone to finish when you trigger another one.To start all valve at once when is trigger all zones i did change:
else if (state == RUN_ALL_ZONES) { if (lastValve != valveNumber) { for (byte i = 0; i <= NUMBER_OF_VALVES; i++) { if (i == 0 || i == valveNumber) { gw.send(msg1valve.setSensor(i).set(true), false); } else { gw.send(msg1valve.setSensor(i).set(false), false); } } } lastValve = valveNumber; fastToggleLed(); if (state != lastState) { valveNumber = 1; updateRelays(ALL_VALVES_OFF); DEBUG_PRINTLN(F("State Changed, Running All Zones...")); } unsigned long nowMillis = millis(); if (nowMillis - startMillis < VALVE_RESET_TIME) { updateRelays(ALL_VALVES_OFF); } else if (nowMillis - startMillis < (allZoneTime[valveNumber] * 60000UL)) { updateRelays(BITSHIFT_VALVE_NUMBER); } elsewith
else if (state == RUN_ALL_ZONES) { if (lastValve != valveNumber) { for (byte i = 0; i <= NUMBER_OF_VALVES; i++) { if (i == 0 || i == valveNumber) { gw.send(msg1valve.setSensor(i).set(true), false); } else { gw.send(msg1valve.setSensor(i).set(true), false); //to update domoticz } } } lastValve = valveNumber; fastToggleLed(); if (state != lastState) { valveNumber = 1; updateRelays(ALL_VALVES_OFF); DEBUG_PRINTLN(F("State Changed, Running All Zones...")); } unsigned long nowMillis = millis(); if (nowMillis - startMillis < VALVE_RESET_TIME) { updateRelays(0); //all outputs will be on } else if (nowMillis - startMillis < (allZoneTime[valveNumber] * 60000UL)) { updateRelays(BITSHIFT_VALVE_NUMBER); } else@rechin304 said:
Well, that's not the point.
I will have 4 zones that need different type of water needs. For example one zone will be with micro irrigation watering, another one with lawn sprinkler. i do not understand why not to start all zones at once and they wi finish according to the time set and not to start one after other. Another thing is why to wait for a zone to finish when you trigger another one.I see your point an understand your questions. The purpose of zone cycling is to be able to have enough pressure in each zone independently while also having pressure for household use. Drawing water to every zone (in my case 9) makes the pressure so low, there may not be enough to open the individual pop-up valves, much less fill the washing machine.
The wait period (which you may set) is there to allow the time for hydraulic actuation of solenoid valves. These types of valves close slowly, and since they are in a manifold, the next valve to start opens faster if the water pressure at the manifold is allowed time to reach normal static pressure.
The beauty of open source is that you get to do it your way. If you have the pressure to run all your valves at the same time, with enough to spare to take a shower, then you are fortunate!
So, did you add another 'switch' to your controller to send the all zone command?
-
@rechin304 said:
{ updateRelays(0); //all outputs will be on }I did this so all relays on is ok now.
What i miss is to start individual zones more than once at a time :). -
Hi I just finished building my first project in arduino ( this one) but the code is too large now for the arduino memory its 32748 bytes could you please share with me the older version of the code / libraries to run it in code bender ?
-
Hi I just finished building my first project in arduino ( this one) but the code is too large now for the arduino memory its 32748 bytes could you please share with me the older version of the code / libraries to run it in code bender ?
@David-Mora's question was double-posted. See https://forum.mysensors.org/topic/3921/code-grew-larger-dan-promini/ for the other thread.
-
Hi I just finished building my first project in arduino ( this one) but the code is too large now for the arduino memory its 32748 bytes could you please share with me the older version of the code / libraries to run it in code bender ?
@David-Mora I responded to your comment on the YouTube video but I'll respond here as well just in case people are reading this thread instead.
This is probably because debug is enabled in the MyConfig.h file. Please comment out this line: #define DEBUG
Make sure to save the .h file then recompile the Arduino code. It should be around 25,342 bytes. -
Hi Pete thank you very much, I am using mysensors online editor , not sure if I should edit that code?

-
It's not possible to disable this from codebender. You'll need to install the Arduino IDE onto your computer.
@hek in computer I get this:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory#include <../Wire/Wire.h>
^compilation terminated.
exit status 1
Error compilación en tarjeta Arduino Pro or Pro Mini. -
@hek in computer I get this:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory#include <../Wire/Wire.h>
^compilation terminated.
exit status 1
Error compilación en tarjeta Arduino Pro or Pro Mini.@David-Mora Maybe this will help:
https://www.youtube.com/watch?v=qUey_X9n2KI -
thank you for your help ! I just reinstaled arduino and now I getthis ( I just downloaded the I.5 and copy and paste all libraries in the libraries folder:
TENCIÓN: Categoría '' en librería UIPEthernet no es válida. Configurando a 'Uncategorized'
C:\Users\David\Desktop\IrrigationController\IrrigationController.ino:92:31: fatal error: LiquidCrystal_I2C.h: No such file or directory#include <LiquidCrystal_I2C.h>
^compilation terminated.
exit status 1
Error compilación en tarjeta Arduino Pro or Pro Mini.
-
thank you for your help ! I just reinstaled arduino and now I getthis ( I just downloaded the I.5 and copy and paste all libraries in the libraries folder:
TENCIÓN: Categoría '' en librería UIPEthernet no es válida. Configurando a 'Uncategorized'
C:\Users\David\Desktop\IrrigationController\IrrigationController.ino:92:31: fatal error: LiquidCrystal_I2C.h: No such file or directory#include <LiquidCrystal_I2C.h>
^compilation terminated.
exit status 1
Error compilación en tarjeta Arduino Pro or Pro Mini.
@David-Mora quite sad I´ve spent two days now installing and uninstalling arduino and libraries and no luck
-
@David-Mora quite sad I´ve spent two days now installing and uninstalling arduino and libraries and no luck
-
@David-Mora Did you close all instances of Arduino and open again after you added the LiquidCrystal library? It looks like it can't find it.
@petewill Yes Pete it doesnt work at all
