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. Controllers
  3. MyController.org
  4. Soil Sensor Trips wrong way (dry>wet not wet>dry)

Soil Sensor Trips wrong way (dry>wet not wet>dry)

Scheduled Pinned Locked Moved MyController.org
16 Posts 2 Posters 3.2k Views 2 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.
  • crusher70C Offline
    crusher70C Offline
    crusher70
    wrote on last edited by
    #1

    Hi everyone,

    Firstly a big thank you to everyone for your great ideas, guides and guidance. This site got my greenhouse project off to a flying start.
    I have one question which is probably going to expose my noobness.

    I have various sensors running on various test uno boards including multiple temp sensors on one uno and a single soil sensor on another.
    All there are reporting to my Ethernet Gateway then to MyController running on a Pi.
    Im using the digital output of the sensor and it shows up correctly in MyController. However the alarm is only triggered when the sensor goes from dry to wet not wet to dry. I have read through the sketch and it mentions inverting the send to allow for this. Am I missing something?

    Any Help would be greatly appreciated.

    Thanks
    Glen

    J 1 Reply Last reply
    0
    • crusher70C crusher70

      Hi everyone,

      Firstly a big thank you to everyone for your great ideas, guides and guidance. This site got my greenhouse project off to a flying start.
      I have one question which is probably going to expose my noobness.

      I have various sensors running on various test uno boards including multiple temp sensors on one uno and a single soil sensor on another.
      All there are reporting to my Ethernet Gateway then to MyController running on a Pi.
      Im using the digital output of the sensor and it shows up correctly in MyController. However the alarm is only triggered when the sensor goes from dry to wet not wet to dry. I have read through the sketch and it mentions inverting the send to allow for this. Am I missing something?

      Any Help would be greatly appreciated.

      Thanks
      Glen

      J Offline
      J Offline
      jkandasa
      Plugin Developer
      wrote on last edited by
      #2

      @crusher70

      Can you put screen shot of your alarm configuration?

      1 Reply Last reply
      0
      • crusher70C Offline
        crusher70C Offline
        crusher70
        wrote on last edited by crusher70
        #3

        0_1456951122789_SoilAlarm.jpg

        Hi there,

        I have tried setting the "Trigger When" option to 1 and 0 but it still seems to be reversed.
        Many thanks.
        Glen

        J 1 Reply Last reply
        0
        • crusher70C crusher70

          0_1456951122789_SoilAlarm.jpg

          Hi there,

          I have tried setting the "Trigger When" option to 1 and 0 but it still seems to be reversed.
          Many thanks.
          Glen

          J Offline
          J Offline
          jkandasa
          Plugin Developer
          wrote on last edited by
          #4

          @crusher70 said:

          Hi there,

          I have tried setting the "Trigger When" option to 1 and 0 but it still seems to be reversed.
          Many thanks.
          Glen

          What exactly your sensor returns 0 and 1? or string value like wet , dry something like? If it is string should be case sensitive.

          Also you have configured Dampening type as Consecutive with 2 counts, which means this condition should satisfy two times continuously.

          Recommendation: If you are sending string value from sensor Tripped variable is not a suitable one. Better use VAR1...VAR5 or suitable variable type.

          crusher70C 1 Reply Last reply
          0
          • J jkandasa

            @crusher70 said:

            Hi there,

            I have tried setting the "Trigger When" option to 1 and 0 but it still seems to be reversed.
            Many thanks.
            Glen

            What exactly your sensor returns 0 and 1? or string value like wet , dry something like? If it is string should be case sensitive.

            Also you have configured Dampening type as Consecutive with 2 counts, which means this condition should satisfy two times continuously.

            Recommendation: If you are sending string value from sensor Tripped variable is not a suitable one. Better use VAR1...VAR5 or suitable variable type.

            crusher70C Offline
            crusher70C Offline
            crusher70
            wrote on last edited by
            #5

            @jkandasa

            Hi and thank you for your help with this.

            I'm using the default MySensor sketch, the read function is as follows:-
            the serial output shows that when the sensor is wet (not triggered) a 1 is sent and Dry (triggered) a 0 is sent.
            I have changed the Dampening to none for now.

            void loop()     
            {     
              // Read digital soil value
              int soilValue = digitalRead(DIGITAL_INPUT_SOIL_SENSOR); // 1 = Not triggered, 0 = In soil with water 
              if (soilValue != lastSoilValue) {
                Serial.println(soilValue);
                gw.send(msg.set(soilValue==0?1:0));  // Send the inverse to gw as tripped should be when no water in soil
              
                lastSoilValue = soilValue;
              }
            
            J 1 Reply Last reply
            0
            • crusher70C crusher70

              @jkandasa

              Hi and thank you for your help with this.

              I'm using the default MySensor sketch, the read function is as follows:-
              the serial output shows that when the sensor is wet (not triggered) a 1 is sent and Dry (triggered) a 0 is sent.
              I have changed the Dampening to none for now.

              void loop()     
              {     
                // Read digital soil value
                int soilValue = digitalRead(DIGITAL_INPUT_SOIL_SENSOR); // 1 = Not triggered, 0 = In soil with water 
                if (soilValue != lastSoilValue) {
                  Serial.println(soilValue);
                  gw.send(msg.set(soilValue==0?1:0));  // Send the inverse to gw as tripped should be when no water in soil
                
                  lastSoilValue = soilValue;
                }
              
              J Offline
              J Offline
              jkandasa
              Plugin Developer
              wrote on last edited by
              #6

              @crusher70

              Thank you for the code. Yes, your sensor sends 1 and 0. You have to configure two alarm definitions.

              one as you showed here and another one should be like trigger when == 0

              crusher70C 1 Reply Last reply
              0
              • J jkandasa

                @crusher70

                Thank you for the code. Yes, your sensor sends 1 and 0. You have to configure two alarm definitions.

                one as you showed here and another one should be like trigger when == 0

                crusher70C Offline
                crusher70C Offline
                crusher70
                wrote on last edited by crusher70
                #7

                @jkandasa

                Thank you jkandasa,
                I was looking at it from completely the wrong direction trying to cover everything with just one alarm. I have reconfigured as you suggested and also added a forward payload which turns on a relay to water plants and turns it off when soil is wet.

                Working perfectly thank you so much for your help with this.

                Glen

                J 1 Reply Last reply
                0
                • crusher70C crusher70

                  @jkandasa

                  Thank you jkandasa,
                  I was looking at it from completely the wrong direction trying to cover everything with just one alarm. I have reconfigured as you suggested and also added a forward payload which turns on a relay to water plants and turns it off when soil is wet.

                  Working perfectly thank you so much for your help with this.

                  Glen

                  J Offline
                  J Offline
                  jkandasa
                  Plugin Developer
                  wrote on last edited by jkandasa
                  #8

                  @crusher70

                  Perfect! you can also configure one safety alarm for your relay. For example controller turned on relay based on wet, dry signal. Later if we do not receive any data from sensor, relay will be keep on turned ON and water over flow will happened.

                  To avoid this you can configure one additional alarm for relay. Say turn OFF relay if it's continually ON for more than 20 minutes.
                  Condition: Realy == 1 and in Dampening: Active time 20 minutes

                  crusher70C 2 Replies Last reply
                  0
                  • J jkandasa

                    @crusher70

                    Perfect! you can also configure one safety alarm for your relay. For example controller turned on relay based on wet, dry signal. Later if we do not receive any data from sensor, relay will be keep on turned ON and water over flow will happened.

                    To avoid this you can configure one additional alarm for relay. Say turn OFF relay if it's continually ON for more than 20 minutes.
                    Condition: Realy == 1 and in Dampening: Active time 20 minutes

                    crusher70C Offline
                    crusher70C Offline
                    crusher70
                    wrote on last edited by
                    #9

                    @jkandasa
                    Great idea! Ill do that now. Thanks again for being so helpful.

                    Glen

                    1 Reply Last reply
                    0
                    • J jkandasa

                      @crusher70

                      Perfect! you can also configure one safety alarm for your relay. For example controller turned on relay based on wet, dry signal. Later if we do not receive any data from sensor, relay will be keep on turned ON and water over flow will happened.

                      To avoid this you can configure one additional alarm for relay. Say turn OFF relay if it's continually ON for more than 20 minutes.
                      Condition: Realy == 1 and in Dampening: Active time 20 minutes

                      crusher70C Offline
                      crusher70C Offline
                      crusher70
                      wrote on last edited by
                      #10

                      @jkandasa
                      Ok one final nob question if you don't mind?

                      I have configured the Alarm as suggested but set the active time for 1 min for testing. The alarm triggers as it should but I cant see where the triggering of this alarm turns off the relay. Sorry if this is a silly question but I can't for the life of me see where to configure it.

                      Many thanks
                      Glen

                      J 1 Reply Last reply
                      0
                      • crusher70C crusher70

                        @jkandasa
                        Ok one final nob question if you don't mind?

                        I have configured the Alarm as suggested but set the active time for 1 min for testing. The alarm triggers as it should but I cant see where the triggering of this alarm turns off the relay. Sorry if this is a silly question but I can't for the life of me see where to configure it.

                        Many thanks
                        Glen

                        J Offline
                        J Offline
                        jkandasa
                        Plugin Developer
                        wrote on last edited by
                        #11

                        @crusher70

                        Hey, no problem at all. you can ask as many questions you want.

                        Can you post your configuration screenshot?

                        crusher70C 1 Reply Last reply
                        0
                        • J jkandasa

                          @crusher70

                          Hey, no problem at all. you can ask as many questions you want.

                          Can you post your configuration screenshot?

                          crusher70C Offline
                          crusher70C Offline
                          crusher70
                          wrote on last edited by
                          #12

                          @jkandasa

                          As requested this is the alarm i have configured.
                          0_1456959002208_Relayshutoff.png

                          J 1 Reply Last reply
                          0
                          • crusher70C crusher70

                            @jkandasa

                            As requested this is the alarm i have configured.
                            0_1456959002208_Relayshutoff.png

                            J Offline
                            J Offline
                            jkandasa
                            Plugin Developer
                            wrote on last edited by
                            #13

                            @crusher70

                            Alarm triggers but there is no notification to execute for this alarm. You have to create new notification with Send payload relay =1. and map your new notification with this alarm.

                            crusher70C 2 Replies Last reply
                            0
                            • J jkandasa

                              @crusher70

                              Alarm triggers but there is no notification to execute for this alarm. You have to create new notification with Send payload relay =1. and map your new notification with this alarm.

                              crusher70C Offline
                              crusher70C Offline
                              crusher70
                              wrote on last edited by
                              #14

                              @jkandasa

                              Ah now I understand thank you once again.

                              Regards
                              Glen

                              1 Reply Last reply
                              0
                              • J jkandasa

                                @crusher70

                                Alarm triggers but there is no notification to execute for this alarm. You have to create new notification with Send payload relay =1. and map your new notification with this alarm.

                                crusher70C Offline
                                crusher70C Offline
                                crusher70
                                wrote on last edited by
                                #15

                                @jkandasa

                                Thanks jkandasa work great. I shall leave you alone to rest up for a while as its 4:30 am over there. I'm sure I'll have more questions at some point in the future, but for now you have been a great help so thank you very much. Take care and have a great day.
                                Regards
                                Glen

                                J 1 Reply Last reply
                                0
                                • crusher70C crusher70

                                  @jkandasa

                                  Thanks jkandasa work great. I shall leave you alone to rest up for a while as its 4:30 am over there. I'm sure I'll have more questions at some point in the future, but for now you have been a great help so thank you very much. Take care and have a great day.
                                  Regards
                                  Glen

                                  J Offline
                                  J Offline
                                  jkandasa
                                  Plugin Developer
                                  wrote on last edited by
                                  #16

                                  @crusher70 well! Thank you!

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


                                  20

                                  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