Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Irrigation Controller (up to 16 valves with Shift Registers)

Irrigation Controller (up to 16 valves with Shift Registers)

Scheduled Pinned Locked Moved My Project
371 Posts 56 Posters 248.8k Views 52 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sergio RiusS Sergio Rius

    @AWI
    While that would be a logical approach, the the dimmer control in Domoticz it's complex and sometimes requires more than one click to activate. In other interfaces (Android, etc) that could be worse, and should change in the future.

    @dbemowsk
    I did not use S_INFO in my sketch, but I managed to use an array for valves configuration and may be pretty interesting if we mix the two of them.

    Note that this is a version 2.0 sketch, and that I removed all the remote management stuff. Due to the flow change in v2, the display menu was so difficult to do.
    Perhaps you can adapt it back and get back to the original idea.

    ///// Mysensors options /////
    //#define MY_DEBUG
    #define MY_RADIO_NRF24
    #define MY_NODE_ID 1 // Having some problems with auto Id on my installation.
    
    #include <Time.h>
    #include <Wire.h>
    #include <SPI.h>
    
    #include <LiquidCrystal_I2C.h>
    #include <MySensors.h>
    
    #define SKETCH_NAME "GardenController"
    #define SKETCH_VERSION "1.0"
    
    /////// Display output options /////
    //#define USING_DISPLAY
    //boolean showTime = true;
    //#ifdef USING_DISPLAY
    //	LiquidCrystal_I2C lcd(0x27, 16, 2);
    //	//#define LCDINIT (DEBUG_PRINTLN("Setting up LCD..."); lcd.init(); lcd.clear(); lcd.backlight();)
    //#else
    //	#define LCDINIT
    //#endif
    
    const int latchPin = 8;
    const int clockPin = 4;
    const int dataPin = 7;
    
    unsigned char bitStatus;
    
    #define ACTIVE_LOW // comment out this line if your relays are active high
    #ifdef ACTIVE_LOW
    	#define ALL_ELEMENTS_OFF 0xFFFF
    	#define myShiftOut (shiftOut(dataPin, clockPin, MSBFIRST, ~bitStatus))
    #else
    	#define ALL_ELEMENTS_OFF 0U
    	#define myShiftOut (shiftOut(dataPin, clockPin, MSBFIRST, bitStatus))
    #endif
    
    boolean clockSetup = false;
    
    ///// Serial interface options /////
    #define DEBUG_ON   // comment out to supress serial monitor output
    #ifdef DEBUG_ON
    	#define DEBUG_PRINT(x)   Serial.print(x)
    	#define DEBUG_PRINTLN(x) Serial.println(x)
    	#define SERIAL_START(x)  Serial.begin(x)
    #else
    	#define DEBUG_PRINT(x)
    	#define DEBUG_PRINTLN(x)
    	#define SERIAL_START(x)
    #endif
    
    ///// Control elements /////
    class myElement {
    public:
    	myElement(char* name, int runningTime, unsigned long Started);
    	char* Name;
    	int RunningTime;
    	unsigned long Started;
    };
    
    myElement::myElement(char* Name, int RunningTime, unsigned long Started = 0)
    {
    	this->Name = Name;
    	this->RunningTime = RunningTime;
    	this->Started = Started;
    };
    
    myElement myElements[] =
    {
    	{ "Irrigation Zone 1", 1 },
    	{ "Irrigation Zone 2", 1 },
    	{ "Pond Pump", 0 },
    	{ "Pond Lights", 0 },
    	{ "Front way lights", 0 },
    	{ "Acc1", 0 },
    	{ "Acc2", 0 },
    	{ "Acc3", 0 },
    };
    
    int NUMBER_OF_ELEMENTS = sizeof(myElements) / sizeof(*myElements);
    
    MyMessage msg1valve(0, V_STATUS);
    
    void setup()
    {
    	SERIAL_START(9600);
    	DEBUG_PRINTLN("Initialising...");
    
    	pinMode(latchPin, OUTPUT);
    	pinMode(clockPin, OUTPUT);
    	pinMode(dataPin, OUTPUT);
    
    	//LCDINIT;
    	//DEBUG_PRINTLN("Setting up LCD..."); lcd.init(); lcd.clear(); lcd.backlight();
    
    	//DEBUG_PRINTLN("Requesting time from Gateway");
    	//requestTime();
    
    	//DEBUG_PRINTLN("Ready!");
    }
    
    void presentation() 
    {
    	sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
    	for (int i = 0; i < NUMBER_OF_ELEMENTS; i++) {
    		myElement Elm = myElements[i];
    		present(i, S_BINARY, Elm.Name);
    		wait(50);
    		DEBUG_PRINT("Presented element (id/name/preset time): "); DEBUG_PRINT(i); DEBUG_PRINT("/");  DEBUG_PRINT(Elm.Name); DEBUG_PRINT("/"); DEBUG_PRINTLN(Elm.RunningTime);
    		request(i, V_STATUS);
    		wait(50);
    	}
    }
    
    void loop()
    {
    	//Check if there are some timer lights to shutdown
    	for (int i = 0; i < NUMBER_OF_ELEMENTS; i++) {
    		//DEBUG_PRINT(myElements[i].Name); DEBUG_PRINT("/"); DEBUG_PRINT(myElements[i].RunningTime); DEBUG_PRINT("/"); DEBUG_PRINTLN(myElements[i].Started);
    		if (myElements[i].Started > 0) {
    			DEBUG_PRINT("Running element ("); DEBUG_PRINT(i); DEBUG_PRINTLN(")");
    			if ((millis() - myElements[i].Started) >= (myElements[i].RunningTime * 60000)){
    				DEBUG_PRINT("ELEMENT TIMEOUT! ("); DEBUG_PRINT(i); DEBUG_PRINTLN(")");
    				updateRelay(i, 0);
    				send(msg1valve.setSensor(i).set(false), false);
    			}
    		}
    		wait(500);
    	}
    }
    
    //void receiveTime(time_t newTime)
    //{
    //	DEBUG_PRINTLN("Received time value, updating...");
    //	int lastSecond = second();
    //	int lastMinute = minute();
    //	int lastHour = hour();
    //	setTime(newTime);
    //	if (((second() != lastSecond) || (minute() != lastMinute) || (hour() != lastHour)) )|| showTime)
    //	{
    //		DEBUG_PRINT("Node's time currently set to: ");
    //		DEBUG_PRINT(day());
    //		DEBUG_PRINT("/");
    //		DEBUG_PRINT(month());
    //		DEBUG_PRINT(F("/"));
    //		DEBUG_PRINT(year());
    //		DEBUG_PRINT(hour() < 10 ? F(" 0") : F(" "));
    //		DEBUG_PRINT(hour());
    //		DEBUG_PRINT(minute() < 10 ? F(":0") : F(":"));
    //		DEBUG_PRINTLN(minute());
    //		showTime = false;
    //	}
    //	else
    //	{
    //		DEBUG_PRINTLN("Node's time did NOT need adjustment greater than 1 second.");
    //	}
    //	clockSetup = true;
    //}
    
    void receive(const MyMessage &message) {
    	// We only expect one type of message from controller. But we better check anyway.
    	switch (message.type)
    	{
    	case V_STATUS:
    		DEBUG_PRINT("Received: Position "); DEBUG_PRINT(message.sensor); DEBUG_PRINT(" Value "); DEBUG_PRINTLN(message.getBool());
    		//DEBUG_PRINT("Before status: "); DEBUG_PRINTLN(bitStatus);
    		updateRelay(message.sensor, message.getBool());
    		break;
    	default:
    		break;
    	}
    }
    
    //void RESET() {
    //	digitalWrite(latchPin, LOW);
    //	shiftOut(dataPin, clockPin, MSBFIRST, ALL_ELEMENTS_OFF);
    //	digitalWrite(latchPin, HIGH);
    //}
    
    void updateRelay(int whichPin, byte whichState) {
    	if (myElements[whichPin].RunningTime > 0){
    		if (whichState == 1){
    			myElements[whichPin].Started = millis();
    			DEBUG_PRINT("Stored start time ("); DEBUG_PRINT(myElements[whichPin].Started); DEBUG_PRINT(") for "); DEBUG_PRINTLN(whichPin);
    		}
    		else
    		{
    			myElements[whichPin].Started = 0;
    			DEBUG_PRINT("Reset start time for "); DEBUG_PRINTLN(whichPin);
    		}
    	}
    
    	digitalWrite(latchPin, LOW);
    	bitWrite(bitStatus, whichPin, whichState);
    	//DEBUG_PRINT("updateRelay: bitStatus -> "); DEBUG_PRINTLN(bitStatus);
    	myShiftOut;
    	digitalWrite(latchPin, HIGH);
    }
    

    As you may noticed, it can control up to 32 valves and you only have to populate the array. It'll be nice to request this data to domoticz and after a timer or received it, store in eeprom and populate the sub-nodes. Then in subsequent starts, boot with the info on eeprom and ask for changes.
    The sensor shuts itself the "valves" and if time is set to zero runs them without limit.

    That's not my irrigation controller, but my whole garden controller. (thaks the op for the idea)

    AWIA Offline
    AWIA Offline
    AWI
    Hero Member
    wrote on last edited by
    #224

    @Sergio-Rius said:

    the dimmer control in Domoticz it's complex and sometimes requires more than one click to activate

    Can you elaborate on this? In my setup the Dimmer is as reliable as any other control. Main limitation is that the standard dimmer can only assume 16 "states"/ values.

    Sergio RiusS 1 Reply Last reply
    0
    • dbemowskD dbemowsk

      @AWI I am still not a big fan of the V_PERCENTAGE route. I like the flexibility of the all zones time as well as the individual zone times. I suppose from a scripting sense it wouldn't matter too much, but I still think it's easier and more flexible the other way.

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #225

      @dbemowsk said:

      I am still not a big fan of the V_PERCENTAGE route

      While introducing the V_TEXT/S_INFO type we were aware that this would be a would open up the route to many "non standard" applications. I personally try to keep everything in the standard types or to have a standard defined for it. (like in the V_ORIENTATION suggestion in the Orientation actuator ).
      Sometimes the choice is limited as with the V_PERCENTAGE/ DIMMER implementation in Domoticz as there is no "generic" type to represent just a value (int/float) or date/time (y/m/d h:m:s).

      1 Reply Last reply
      0
      • dbemowskD dbemowsk

        @Sergio-Rius Just a few things. I am assuming that the array you are talking about is "myElement". I am fairly new to MySensors and Domoticz. How do you use this array with Domoticz to send the zone times to the controller? It looks like you are setting the valve names and times within the sketch as if they are permanently set on the controller. I am a little confused about the presentation of the S_BINARY, Elm.Name:

                myElement Elm = myElements[i];
                present(i, S_BINARY, Elm.Name);
        

        My understanding is that S_BINARY is just for on/off which I am guessing is the on/off control for the zone. What does the Elm.Name do though? Do yoy have a way to set valve times from within Domoticz?

        I also noticed that you removed the time sync with the receiveTime() function. This tells me that you are not sending the current time to the controller. Any reason for this?

        As for my sketch, I am thinking of another route to go with this where I can send the valve times and names using a single S_INFO sensor. I plan to use some of the information from this forum post: Splitting a string. The idea is to use a separator character such as ":" or "|" to create a pseudo array using a single string. Doing this will eliminate 2 S_INFO sensors for each zone, and also make it easier to configure. I am going to work on this tonight and see where I get with it.

        Sergio RiusS Offline
        Sergio RiusS Offline
        Sergio Rius
        wrote on last edited by
        #226

        @dbemowsk said:

        How do you use this array with Domoticz to send the zone times to the controller? It looks like you are setting the valve names and times within the sketch as if they are permanently set on the controller.

        Yes, that was the part where we supposedly had to join our sketches. Just getting all the array contents from an S_INFO. Perhaps using some Json to array conversion. Should be some library for conversions there.

        I am a little confused about the presentation of the S_BINARY, Elm.Name:

                myElement Elm = myElements[i];
                present(i, S_BINARY, Elm.Name);
        

        My understanding is that S_BINARY is just for on/off which I am guessing is the on/off control for the zone. What does the Elm.Name do though?

        Elm.Name assigns a name to the valve. And presents to Domoticz. Still doesn't exists a way to get from domoticz.

        Do yoy have a way to set valve times from within Domoticz?

        Again, still doesn't....

        I also noticed that you removed the time sync with the receiveTime() function. This tells me that you are not sending the current time to the controller. Any reason for this?

        Yes. as I said it was so complicated for me to integrate the "stand-alone functions" that use loop cycles for running the menu. I planned to make dedicated functions for it, but didn't have time.

        As for my sketch, I am thinking of another route to go with this where I can send the valve times and names using a single S_INFO sensor. I plan to use some of the information from this forum post: Splitting a string. The idea is to use a separator character such as ":" or "|" to create a pseudo array using a single string. Doing this will eliminate 2 S_INFO sensors for each zone, and also make it easier to configure. I am going to work on this tonight and see where I get with it.

        And why not using this approach on a single S_INFO, that could feed the array I have in my sketch?

        dbemowskD 1 Reply Last reply
        0
        • AWIA AWI

          @Sergio-Rius said:

          the dimmer control in Domoticz it's complex and sometimes requires more than one click to activate

          Can you elaborate on this? In my setup the Dimmer is as reliable as any other control. Main limitation is that the standard dimmer can only assume 16 "states"/ values.

          Sergio RiusS Offline
          Sergio RiusS Offline
          Sergio Rius
          wrote on last edited by Sergio Rius
          #227

          @AWI said:

          Can you elaborate on this? In my setup the Dimmer is as reliable as any other control. Main limitation is that the standard dimmer can only assume 16 "states"/ values.

          The dimmer is reliable. I was talking of interface widget being complex. In Domoticz, to activate one zone you would have to first click, and when the popup appears, click again on the blue (sphere?) for it to start.
          In Imperihome, you would have up to 32 rgb dial indicators on your page and still don't get the current set value, and when you set it on, most of times it doesn't respect the current intensity value.

          And that doesn't solve the double timing setup nor the naming.
          I always like to apply the KISS rule to my developments and avoid to depend on other systems. Specially if they don't walk in the same direction. Imagine that in the future the dimmer system changes, for example, into a hue pallete.

          And it's true that mysensors and domoticz is lacking a sensors configuration system.

          AWIA 1 Reply Last reply
          0
          • Sergio RiusS Sergio Rius

            @AWI said:

            Can you elaborate on this? In my setup the Dimmer is as reliable as any other control. Main limitation is that the standard dimmer can only assume 16 "states"/ values.

            The dimmer is reliable. I was talking of interface widget being complex. In Domoticz, to activate one zone you would have to first click, and when the popup appears, click again on the blue (sphere?) for it to start.
            In Imperihome, you would have up to 32 rgb dial indicators on your page and still don't get the current set value, and when you set it on, most of times it doesn't respect the current intensity value.

            And that doesn't solve the double timing setup nor the naming.
            I always like to apply the KISS rule to my developments and avoid to depend on other systems. Specially if they don't walk in the same direction. Imagine that in the future the dimmer system changes, for example, into a hue pallete.

            And it's true that mysensors and domoticz is lacking a sensors configuration system.

            AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #228

            @Sergio-Rius Think I understand ;) and keep my systems as autonomous and simple as possible.
            The route with S_INFO/V_TEXT won't bring you any luck, regarding the customization to be done in Domoticz to get values in V_TEXT (LUA / JSON).
            btw. Like your sketch :thumbsup:

            Sergio RiusS 1 Reply Last reply
            0
            • AWIA AWI

              @Sergio-Rius Think I understand ;) and keep my systems as autonomous and simple as possible.
              The route with S_INFO/V_TEXT won't bring you any luck, regarding the customization to be done in Domoticz to get values in V_TEXT (LUA / JSON).
              btw. Like your sketch :thumbsup:

              Sergio RiusS Offline
              Sergio RiusS Offline
              Sergio Rius
              wrote on last edited by
              #229

              @AWI
              You'r right, that's not the best route. But until we have sensors configuration routines... ;)
              Will we have? :grimacing:

              AWIA 1 Reply Last reply
              0
              • Sergio RiusS Sergio Rius

                @AWI
                You'r right, that's not the best route. But until we have sensors configuration routines... ;)
                Will we have? :grimacing:

                AWIA Offline
                AWIA Offline
                AWI
                Hero Member
                wrote on last edited by
                #230

                @Sergio-Rius Don't expect too much in either MySensors/ Domoticz unless you know of a "industry standard" approach which can be implemented with reasonable efforts by the community..

                dbemowskD 1 Reply Last reply
                0
                • AWIA AWI

                  @Sergio-Rius Don't expect too much in either MySensors/ Domoticz unless you know of a "industry standard" approach which can be implemented with reasonable efforts by the community..

                  dbemowskD Offline
                  dbemowskD Offline
                  dbemowsk
                  wrote on last edited by
                  #231

                  @AWI said:

                  @Sergio-Rius Don't expect too much in either MySensors/ Domoticz unless you know of a "industry standard" approach which can be implemented with reasonable efforts by the community..

                  Are you saying that Domoticz primary focus is to follow existing industry standards? Some times you need to shift away from the standards. Giving users more options will only increase the software's user base. If it were me, I'd rather become the standard than chase it.

                  Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                  Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                  1 Reply Last reply
                  0
                  • Sergio RiusS Sergio Rius

                    @dbemowsk said:

                    How do you use this array with Domoticz to send the zone times to the controller? It looks like you are setting the valve names and times within the sketch as if they are permanently set on the controller.

                    Yes, that was the part where we supposedly had to join our sketches. Just getting all the array contents from an S_INFO. Perhaps using some Json to array conversion. Should be some library for conversions there.

                    I am a little confused about the presentation of the S_BINARY, Elm.Name:

                            myElement Elm = myElements[i];
                            present(i, S_BINARY, Elm.Name);
                    

                    My understanding is that S_BINARY is just for on/off which I am guessing is the on/off control for the zone. What does the Elm.Name do though?

                    Elm.Name assigns a name to the valve. And presents to Domoticz. Still doesn't exists a way to get from domoticz.

                    Do yoy have a way to set valve times from within Domoticz?

                    Again, still doesn't....

                    I also noticed that you removed the time sync with the receiveTime() function. This tells me that you are not sending the current time to the controller. Any reason for this?

                    Yes. as I said it was so complicated for me to integrate the "stand-alone functions" that use loop cycles for running the menu. I planned to make dedicated functions for it, but didn't have time.

                    As for my sketch, I am thinking of another route to go with this where I can send the valve times and names using a single S_INFO sensor. I plan to use some of the information from this forum post: Splitting a string. The idea is to use a separator character such as ":" or "|" to create a pseudo array using a single string. Doing this will eliminate 2 S_INFO sensors for each zone, and also make it easier to configure. I am going to work on this tonight and see where I get with it.

                    And why not using this approach on a single S_INFO, that could feed the array I have in my sketch?

                    dbemowskD Offline
                    dbemowskD Offline
                    dbemowsk
                    wrote on last edited by
                    #232

                    @Sergio-Rius said:

                    And why not using this approach on a single S_INFO, that could feed the array I have in my sketch?

                    The main part of my new approach is this bit here:

                          if (message.type == V_TEXT)
                          {
                            String valveMessage = String(message.data);
                            char* valveData = &valveMessage[0]; //.c_str();
                            DEBUG_PRINT(F("Recieved valve data:"));
                            DEBUG_PRINT(i);
                            DEBUG_PRINT(F(" = "));
                            DEBUG_PRINTLN(valveMessage);
                    
                            char* var = strtok(valveData, "|");
                    
                            int variable1 = atoi(var); // RUN_ALL_ZONES time
                            
                            if (variable1 != allZoneTime[i])
                            {
                              allZoneTime[i] = variable1;
                    
                              zoneTimeUpdate = true;
                            }
                            
                            var = strtok(NULL, "|");
                            
                            int variable2 = atoi(var);// RUN_SINGLE_ZONE time
                            
                            if (variable2 != valveSoloTime[i])
                            {
                              valveSoloTime[i] = variable2;
                    
                              zoneTimeUpdate = true;
                            }
                            
                            var = strtok(NULL, "|");
                            
                            String newMessage = String(var);
                            if (newMessage.length() == 0) 
                            {
                              DEBUG_PRINT(F("No Name for "));
                              DEBUG_PRINTLN(i);
                              break;
                            }
                            if (newMessage.length() > 16)
                            {
                              newMessage.substring(0, 16);
                            }
                            valveNickName[i] = "";
                            valveNickName[i] += newMessage;
                            DEBUG_PRINT(F("Recieved name "));
                            DEBUG_PRINT(i);
                            DEBUG_PRINT(F(" called: "));
                            DEBUG_PRINTLN(valveNickName[i]);
                          }
                          receivedInitialValue = true;
                        }
                      }
                    

                    The key is using strtok() to split the incoming string into it's parts. The code that I posted from my tests seems to work, at least from what I have tested so far. It uses one S_INFO sensor for each zone to carry the 3 parts that would be the V_VAR1 - V_VAR3 info in the original sketch. Granted it is only for 1.5, but if you can use anything from my 1.5 sketch in your 2.0 sketch, feel free.

                    Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                    Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                    1 Reply Last reply
                    1
                    • impertusI Offline
                      impertusI Offline
                      impertus
                      wrote on last edited by
                      #233

                      Hi first Great projekt. All the things is Just ordred from eBay. But i Wonder what the yellow component is.

                      And mayby a tuturial have to make a complete HA kontroller. And have to set i Up. Rigtig now i have a raspberry pi with calaos. But i Dont know have to the it Up with the system.

                      Hope there is some help in here :)

                      impertusI 1 Reply Last reply
                      0
                      • BulldogLowellB BulldogLowell

                        I put together an extension of the multi-Relay controller for use as a controller for your irrigation project if you have more zones than available pins on your Arduino.

                        This sketch features the following:

                        • Allows you to cycle through All zones or individual zone control.
                        • Use the (n+1)th device to activate each zone in numeric sequence (zero to n) using
                          Variable1 as the "ON" time in minutes in each of the vera devices created.
                        • Use the individual zone controller to activate a single zone. This feature uses
                          Variable2 as the "ON" time for each individual device/zone.
                        • Connect according to pinout in the sketch and uses an 74HC595 (or equiv) Shift Register as to
                          allow the MySensors standard radio configuration and still leave available digital pins
                        • Compiles to ~12,000 Bytes, so will run on any Arduino
                        • Turning on any zone will stop the current process and begin that particular process.
                        • Turning off any zone will stop the current process and turn off all zones.
                        • Sketch must collect your desired intervals so it takes several minutes to startup.
                        • If you change your desired time intervals for your zones, simply restart your arduino
                          and it will self update to reflect those changes.

                        Example, I am using with 8 relays:

                        This will create 9 devices. Zero through 7 are the individual relays. Eight is the Sequencer, so to speak (refer to attachment).

                        Once you create this and add it using the gateway, go to each of zero through 7 and edit Variable1 and Variable2 for what time you want to use for the Sequencer or Zone respectively. Then save the settings. Then, restart your arduino; your arduino will extract these settings and save them to an array.

                        When you turn on device 8 (aka the Sequencer) the relays will actuate in order from zero to seven, each one staying on for the period entered in the Variable1 field. There is a 5 second delay at the start of a new zone to allow for the valves to hydraulically reset.

                        When you turn on any of devices zero through 7, it will run that zone only for the period of time entered in Variable2.

                        Selecting any new zone (0-8) will stop the current process and start as per above.

                        Hope you have a use for it. If you see any opportunity to improve, or find a bug, let me know.

                        Jim
                        modified. Attached wrong file, whoops!

                        Sprinkler.ino

                        wasamW Offline
                        wasamW Offline
                        wasam
                        wrote on last edited by
                        #234

                        @BulldogLowell

                        I love your programming skills, it is superb. Haven gone through your video, l was happy and l needed a modification to your setup. I want to use the arduino to power my irrigation with the following function.

                        Arduino with soil moisture sensor check. once the soil is dry, arduino to switch on the electric 1horse power pumping machine and at the same time open the solenoid valve to irrigate at a specified timing.

                        As per powering the pumping machine, arduino should check if there is public electricity supply before switching on the pump and if there is no public power supply then it should switch on the power generating set to power the pumping machine and solenoid valve.

                        After the sensor has confirmed that the soil is wet and moist, then arduino stops the pumping machine and then closes the electric 220v solenoid valve.

                        Second task.

                        Overhead Mist Sprayer (uses a different AC 1horse power pump)

                        A sensor to check when the sun temperature is 35 or 40 degrees or any programmed temperature and switch on the pumping machine to power the sprayer for a specified timing. Also arduino should should check if there is public electricity supply before switching on the pump and if there is no public power supply then it should switch on the power generating set to power the pumping machine.

                        Also irrigation records of time and dates and other function will be added up in the setup.

                        I like to know the hardwares l will need for this project, a guide and codes. I appreciate this .

                        Thanks

                        BulldogLowellB 1 Reply Last reply
                        0
                        • wasamW wasam

                          @BulldogLowell

                          I love your programming skills, it is superb. Haven gone through your video, l was happy and l needed a modification to your setup. I want to use the arduino to power my irrigation with the following function.

                          Arduino with soil moisture sensor check. once the soil is dry, arduino to switch on the electric 1horse power pumping machine and at the same time open the solenoid valve to irrigate at a specified timing.

                          As per powering the pumping machine, arduino should check if there is public electricity supply before switching on the pump and if there is no public power supply then it should switch on the power generating set to power the pumping machine and solenoid valve.

                          After the sensor has confirmed that the soil is wet and moist, then arduino stops the pumping machine and then closes the electric 220v solenoid valve.

                          Second task.

                          Overhead Mist Sprayer (uses a different AC 1horse power pump)

                          A sensor to check when the sun temperature is 35 or 40 degrees or any programmed temperature and switch on the pumping machine to power the sprayer for a specified timing. Also arduino should should check if there is public electricity supply before switching on the pump and if there is no public power supply then it should switch on the power generating set to power the pumping machine.

                          Also irrigation records of time and dates and other function will be added up in the setup.

                          I like to know the hardwares l will need for this project, a guide and codes. I appreciate this .

                          Thanks

                          BulldogLowellB Offline
                          BulldogLowellB Offline
                          BulldogLowell
                          Contest Winner
                          wrote on last edited by
                          #235

                          @wasam

                          There are several examples out there (either here or in the Arduino forum) of how to combine sketches for added functionality. Fortunately, you are starting with my code that is already non-blocking and uses little in the way of system resources so it should be straightforward from here.

                          The community here (including me) can assist in giving you what you want.

                          first thing is the hardware... assuming your using metric means you are 220VAC... you need a person familiar with mains switching to help you out there!

                          1 Reply Last reply
                          0
                          • impertusI impertus

                            Hi first Great projekt. All the things is Just ordred from eBay. But i Wonder what the yellow component is.

                            And mayby a tuturial have to make a complete HA kontroller. And have to set i Up. Rigtig now i have a raspberry pi with calaos. But i Dont know have to the it Up with the system.

                            Hope there is some help in here :)

                            impertusI Offline
                            impertusI Offline
                            impertus
                            wrote on last edited by
                            #236

                            @impertus said:

                            Hi first Great projekt. All the things is Just ordred from eBay. But i Wonder what the yellow component is.

                            And mayby a tuturial have to make a complete HA kontroller. And have to set i Up. Rigtig now i have a raspberry pi with calaos. But i Dont know have to the it Up with the system.

                            Hope there is some help in here :)
                            @BulldogLowell

                            petewillP 1 Reply Last reply
                            0
                            • impertusI impertus

                              @impertus said:

                              Hi first Great projekt. All the things is Just ordred from eBay. But i Wonder what the yellow component is.

                              And mayby a tuturial have to make a complete HA kontroller. And have to set i Up. Rigtig now i have a raspberry pi with calaos. But i Dont know have to the it Up with the system.

                              Hope there is some help in here :)
                              @BulldogLowell

                              petewillP Offline
                              petewillP Offline
                              petewill
                              Admin
                              wrote on last edited by
                              #237

                              @impertus said:

                              But i Wonder what the yellow component is.

                              Where are you seeing the yellow component? Maybe it's the LED? Can you post a picture?

                              My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                              impertusI 1 Reply Last reply
                              0
                              • petewillP petewill

                                @impertus said:

                                But i Wonder what the yellow component is.

                                Where are you seeing the yellow component? Maybe it's the LED? Can you post a picture?

                                impertusI Offline
                                impertusI Offline
                                impertus
                                wrote on last edited by
                                #238

                                @petewill this One. 0_1476216631327_Screenshot_20161011-220800.png

                                petewillP 1 Reply Last reply
                                0
                                • impertusI impertus

                                  @petewill this One. 0_1476216631327_Screenshot_20161011-220800.png

                                  petewillP Offline
                                  petewillP Offline
                                  petewill
                                  Admin
                                  wrote on last edited by
                                  #239

                                  @impertus Ah, ok. That is a .1uf capacitor.

                                  My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                                  BulldogLowellB 1 Reply Last reply
                                  0
                                  • petewillP petewill

                                    @impertus Ah, ok. That is a .1uf capacitor.

                                    BulldogLowellB Offline
                                    BulldogLowellB Offline
                                    BulldogLowell
                                    Contest Winner
                                    wrote on last edited by
                                    #240

                                    @petewill

                                    which can be easily substituted by a flux capacitor.

                                    :wink:

                                    impertusI 1 Reply Last reply
                                    0
                                    • BulldogLowellB BulldogLowell

                                      @petewill

                                      which can be easily substituted by a flux capacitor.

                                      :wink:

                                      impertusI Offline
                                      impertusI Offline
                                      impertus
                                      wrote on last edited by
                                      #241

                                      @BulldogLowell Thx :)

                                      Is this the rigth setup.

                                      Irrigationcontroller <-----> Radio + ethernet (Gateaway) ------> Router + Wifi ------> RaspB with (Calaos HA controller)

                                      Wifi -----> Calaos Mobile app

                                      How does the HA controller detects the signal from the irrigation controller? some mystisk setup :) or plug an play..

                                      What HA will you use (Opensouce)(With mobil function)

                                      petewillP 1 Reply Last reply
                                      0
                                      • impertusI impertus

                                        @BulldogLowell Thx :)

                                        Is this the rigth setup.

                                        Irrigationcontroller <-----> Radio + ethernet (Gateaway) ------> Router + Wifi ------> RaspB with (Calaos HA controller)

                                        Wifi -----> Calaos Mobile app

                                        How does the HA controller detects the signal from the irrigation controller? some mystisk setup :) or plug an play..

                                        What HA will you use (Opensouce)(With mobil function)

                                        petewillP Offline
                                        petewillP Offline
                                        petewill
                                        Admin
                                        wrote on last edited by
                                        #242

                                        @BulldogLowell Ha! Unfortunately I'm fresh out of those...

                                        @impertus Both @BulldogLowell and I use Vera as our home automation controller (not open source). My setup looks like: Irrigation Controller <> Ethernet Gateway <> Vera <> Vera Mobile App (usually AutHomationHD). I haven't tested any other controllers with this device but reading up a little in this forum post it appears that some people have got it to work with Domoticz.

                                        My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                                        impertusI 1 Reply Last reply
                                        1
                                        • petewillP petewill

                                          @BulldogLowell Ha! Unfortunately I'm fresh out of those...

                                          @impertus Both @BulldogLowell and I use Vera as our home automation controller (not open source). My setup looks like: Irrigation Controller <> Ethernet Gateway <> Vera <> Vera Mobile App (usually AutHomationHD). I haven't tested any other controllers with this device but reading up a little in this forum post it appears that some people have got it to work with Domoticz.

                                          impertusI Offline
                                          impertusI Offline
                                          impertus
                                          wrote on last edited by
                                          #243

                                          @petewill yeahh i did a little bit of surfing on the forum. And felt over Domoticz. I see that also can run on RaspBerryPi. So think i will give that at try. It will be nice with a newbie guide how to setup my sensors to Domo. step by step..

                                          now im waiting for the mailman with all my components :)

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          11

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular