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. Solar Powered Soil Moisture Sensor

Solar Powered Soil Moisture Sensor

Scheduled Pinned Locked Moved My Project
79 Posts 19 Posters 37.8k Views 35 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.
  • P punter9

    side thought

    why not write your sleep setting as a variable on the arduino side that is dependent on battery voltage?

    if v>(full charge) sleep x hours
    if v>(half charge) sleep for y hours
    if v<(close to terminal voltage) sleep for z hours/days

    F Offline
    F Offline
    flopp
    wrote on last edited by
    #36

    @punter9 said:

    side thought

    why not write your sleep setting as a variable on the arduino side that is dependent on battery voltage?

    if v>(full charge) sleep x hours
    if v>(half charge) sleep for y hours
    if v<(close to terminal voltage) sleep for z hours/days
    I don't see that it is needed. It will be no problem to send data every 30 min even when the sun is not shining. During a grey day I had vintage around 1.0-1.2.

    The idea is useful if you think/know that the solar will not charge your battery

    P 1 Reply Last reply
    0
    • F flopp

      @punter9 said:

      side thought

      why not write your sleep setting as a variable on the arduino side that is dependent on battery voltage?

      if v>(full charge) sleep x hours
      if v>(half charge) sleep for y hours
      if v<(close to terminal voltage) sleep for z hours/days
      I don't see that it is needed. It will be no problem to send data every 30 min even when the sun is not shining. During a grey day I had vintage around 1.0-1.2.

      The idea is useful if you think/know that the solar will not charge your battery

      P Offline
      P Offline
      punter9
      wrote on last edited by punter9
      #37

      @flopp
      sure is, It looks like this sketch already has already picked a set single point sleep time that achieved the discharge gradient being less than the charge gradient looking at the angles on the 7 day graph.

      My question is why wouldn't you write an algorithm for your sleep setting so you don't have to mess with it if you get a cloudy week etc? You have variable charge gradients depending on weather so why not have a simple variable discharge gradient?

      A simple one would be case A - sunny day discharge gradient B- very cloudy day discharge gradient C- emergency charge/top off battery

      you could write an equation based off your existing data but honestly you probably wouldn't get much out of it past the simple set listed above that cover 99% of conditions you will see.

      F 1 Reply Last reply
      0
      • P punter9

        @flopp
        sure is, It looks like this sketch already has already picked a set single point sleep time that achieved the discharge gradient being less than the charge gradient looking at the angles on the 7 day graph.

        My question is why wouldn't you write an algorithm for your sleep setting so you don't have to mess with it if you get a cloudy week etc? You have variable charge gradients depending on weather so why not have a simple variable discharge gradient?

        A simple one would be case A - sunny day discharge gradient B- very cloudy day discharge gradient C- emergency charge/top off battery

        you could write an equation based off your existing data but honestly you probably wouldn't get much out of it past the simple set listed above that cover 99% of conditions you will see.

        F Offline
        F Offline
        flopp
        wrote on last edited by
        #38

        @punter9 said:

        @flopp
        sure is, It looks like this sketch already has already picked a set single point sleep time that achieved the discharge gradient being less than the charge gradient looking at the angles on the 7 day graph.

        My question is why wouldn't you write an algorithm for your sleep setting so you don't have to mess with it if you get a cloudy week etc? You have variable charge gradients depending on weather so why not have a simple variable discharge gradient (or complex if you want to make an algorithm off the charted data) ?

        At the moment I don't need it. But if I see that the battery gets drained to much, because of bad weather, I may be use your idea.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          punter9
          wrote on last edited by
          #39

          ha you are on it! caught me editing!

          anyways I love your idea, I can guarantee I am looking for these little lights to be on sale every time I go out. This maxes out the clever scale.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            flopp
            wrote on last edited by flopp
            #40

            The "lamp"(silver) that I run out of battery seems to be damaged, two days ago it stopped sending data, last reported voltage was 1.13V which is good enough to work.
            Maybe the battery got damaged, it is a NiMh and I think they have some kind of memory?
            But why doesn't it get damage when you use the lamp as a lamp?
            Normally the lamp is charging the battery during the day and when it is dark it power on a LED which will lit until the battery is empty or maybe until the IC(YX8018) measure a low voltage.

            Today I change my second "lamp"(black) to a 1.2v AAA NiMh2 800mAh. I think this will help to not getting to low voltage during night.
            The battery that was included was mounted in the lid, I removed it and placed the new battery in the stick.
            I also made the stick little bit shorter, but don't make it too short because then you will measure the moisture at the top of the soil.
            The black round stick is 9 cm and the whole thing, when put togehter, is 28 cm from top(solar) to bottom(tip)
            0_1466357169260_20160619_134452210_iOS.jpg

            gbgent_ncG 1 Reply Last reply
            0
            • F Offline
              F Offline
              flopp
              wrote on last edited by flopp
              #41

              To have in mind

              If you use the lamp with silver stick, it is metal, then remember to protect the battery if you but the battery in the stick.

              Use hot glue at the top around the solar otherwise rain will stay between the solar and the place where it is mounted. I don't get water inside where the electronics are but you never know what will happen after a few month.

              I have some problem with my black lamp it is rust on the positive connection, today it stopped working because if this, I had to remove the connection and put it back.
              Recommend to solder the cable instead of using connectors, which I do0_1467323921262_image.jpeg

              Nca78N 1 Reply Last reply
              0
              • F flopp

                To have in mind

                If you use the lamp with silver stick, it is metal, then remember to protect the battery if you but the battery in the stick.

                Use hot glue at the top around the solar otherwise rain will stay between the solar and the place where it is mounted. I don't get water inside where the electronics are but you never know what will happen after a few month.

                I have some problem with my black lamp it is rust on the positive connection, today it stopped working because if this, I had to remove the connection and put it back.
                Recommend to solder the cable instead of using connectors, which I do0_1467323921262_image.jpeg

                Nca78N Offline
                Nca78N Offline
                Nca78
                Hardware Contributor
                wrote on last edited by Nca78
                #42

                First, thank you very much for making these tests, I found some similar garden lamps in a local store and thought they were cheap so I bought one to have a look. Seems they were not so cheap as I paid nearly 3$ despite living in a developing country :D
                I will make a test with it as soon as I find a step up accepting the 1.xV of the battery, but I'm not sure if it will really work as the battery inside mine is a tiny V80h with a very limited 60mAh capacity, not sure if it will survive the sending of data...

                @flopp said:

                I have some problem with my black lamp it is rust on the positive connection, today it stopped working because if this, I had to remove the connection and put it back.
                Recommend to solder the cable instead of using connectors, which I do!

                I would put some hot glue there too, no ? When all connections are checked and the board is running fine you could even sink the whole electronic in hot glue to solve these problems "forever" ?

                F 1 Reply Last reply
                0
                • Nca78N Nca78

                  First, thank you very much for making these tests, I found some similar garden lamps in a local store and thought they were cheap so I bought one to have a look. Seems they were not so cheap as I paid nearly 3$ despite living in a developing country :D
                  I will make a test with it as soon as I find a step up accepting the 1.xV of the battery, but I'm not sure if it will really work as the battery inside mine is a tiny V80h with a very limited 60mAh capacity, not sure if it will survive the sending of data...

                  @flopp said:

                  I have some problem with my black lamp it is rust on the positive connection, today it stopped working because if this, I had to remove the connection and put it back.
                  Recommend to solder the cable instead of using connectors, which I do!

                  I would put some hot glue there too, no ? When all connections are checked and the board is running fine you could even sink the whole electronic in hot glue to solve these problems "forever" ?

                  F Offline
                  F Offline
                  flopp
                  wrote on last edited by
                  #43

                  @Nca78 said:

                  First, thank you very much for making these tests, I found some similar garden lamps in a local store and thought they were cheap so I bought one to have a look. Seems they were not so cheap as I paid nearly 3$ despite living in a developing country :D

                  Thank you. $3 is not bad but expensive compared to mine :)

                  I will make a test with it as soon as I find a step up accepting the 1.xV of the battery, but I'm not sure if it will really work as the battery inside mine is a tiny V80h with a very limited 60mAh capacity, not sure if it will survive the sending of data...

                  This is what I use as step-up, search for that product you will find cheaper than $1.49
                  http://www.ebay.com/itm/DC-DC-0-8-3V-to-3-3V-Step-UP-Boost-Power-Board-Module-Converter-Voltage-RF-/282029936915?hash=item41aa4b5113:g:3GAAAOSw1DtXLS7Q

                  I would put some hot glue there too, no ? When all connections are checked and the board is running fine you could even sink the whole electronic in hot glue to solve these problems "forever" ?

                  Yes, why not, sounds like a good idea. But keep TX, RX, RESET and GND available to be able to update the sketch

                  1 Reply Last reply
                  1
                  • F flopp

                    The "lamp"(silver) that I run out of battery seems to be damaged, two days ago it stopped sending data, last reported voltage was 1.13V which is good enough to work.
                    Maybe the battery got damaged, it is a NiMh and I think they have some kind of memory?
                    But why doesn't it get damage when you use the lamp as a lamp?
                    Normally the lamp is charging the battery during the day and when it is dark it power on a LED which will lit until the battery is empty or maybe until the IC(YX8018) measure a low voltage.

                    Today I change my second "lamp"(black) to a 1.2v AAA NiMh2 800mAh. I think this will help to not getting to low voltage during night.
                    The battery that was included was mounted in the lid, I removed it and placed the new battery in the stick.
                    I also made the stick little bit shorter, but don't make it too short because then you will measure the moisture at the top of the soil.
                    The black round stick is 9 cm and the whole thing, when put togehter, is 28 cm from top(solar) to bottom(tip)
                    0_1466357169260_20160619_134452210_iOS.jpg

                    gbgent_ncG Offline
                    gbgent_ncG Offline
                    gbgent_nc
                    wrote on last edited by
                    #44

                    @flopp you attached your sensors by two differant methods. Which methods seems to be working the best?

                    F 1 Reply Last reply
                    0
                    • gbgent_ncG gbgent_nc

                      @flopp you attached your sensors by two differant methods. Which methods seems to be working the best?

                      F Offline
                      F Offline
                      flopp
                      wrote on last edited by
                      #45

                      @gbgent_nc
                      The sensor itself is connected the same way, A4 and A5 on both. @gbgent_nc if you mean that one is glued, that is difficult to say if it makes any difference. I tried lamp1 and 2 in same soil but they always had ~10% difference, I also tried same sensor both glued in same soil still difference. You have to measure until the flower/vegetable is dry and check your percentage after this you can set an alarm on that percentage. E.g. I have spices with 30% when it is dry and a flower that right now is 20% and not dry, maybe different soil etc.
                      I recommend to glue the sensor on the arrow, otherwise it is very difficult to remove the lamp from soil, the sensor with stay in soil and you have to dig it out :)
                      I had a test with a cap connected to my voltage measurement A0, but it didn't make any difference. No need to use Cap.
                      I use other battery on one "lamp" only to be able to measure many days without sun.

                      Today I have 3 lamps, yesterday number 3 was put in the soil. I now measure every hour, before every 30 minutes.

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        punter9
                        wrote on last edited by
                        #46

                        I have a couple soil sensors running with simple bolts in the ground. No two sensors will read the same in the same soil, but that is because they are just a relative setup not an accurate setup. Doing what is recommended above is necessary. Determine what % correlates to watering time on the plants. Once this is done it is set and forget.

                        Also, on your batteries
                        "The phenomenon itself is very real. If a NiCd battery is repeatedly charged after it has only been partially discharged it will develop a lower voltage and a lower capacity. Fortunately, this effect is reversible by conditioning NiCds."

                        So I vote to help your poor cheap lamp batteries out by writing logic into your arduino that varies by battery voltage. You can write it in ranges

                        battery > X volts report every Y minutes
                        battery > Z volts report every P minutes
                        battery > .....etc

                        also to keep your battery in good shape you may consider every so many days ( 2 - 5 ) writing logic that says
                        every Q days report every 20 seconds (or another interval that will drain battery) until battery voltage = min
                        then
                        sleep until battery voltage = max

                        1 Reply Last reply
                        2
                        • PaweMedP Offline
                          PaweMedP Offline
                          PaweMed
                          wrote on last edited by PaweMed
                          #47

                          Hello. What should i do, when i have this problems:

                          czujnik:12: error: expected unqualified-id before 'default'

                          default BOD settings.

                          ^

                          C:\Users\Kompek\Downloads\arduino-1.6.9\czujnik\czujnik.ino: In function 'void setup()':

                          czujnik:43: error: 'SENSOR_ANALOG_PINS' was not declared in this scope

                          for (int i = 0; i < N_ELEMENTS(SENSOR_ANALOG_PINS); i++) {

                                                        ^
                          

                          C:\Users\Kompek\Downloads\arduino-1.6.9\czujnik\czujnik.ino:5:35: note: in definition of macro 'N_ELEMENTS'

                          #define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))

                                                         ^
                          

                          C:\Users\Kompek\Downloads\arduino-1.6.9\czujnik\czujnik.ino: In function 'int readMoisture()':

                          czujnik:102: error: 'SENSOR_ANALOG_PINS' was not declared in this scope

                          pinMode(SENSOR_ANALOG_PINS[direction], INPUT_PULLUP); // Power on the sensor

                                 ^
                          

                          exit status 1
                          expected unqualified-id before 'default'

                          1 Reply Last reply
                          0
                          • F Offline
                            F Offline
                            flopp
                            wrote on last edited by
                            #48

                            I would have try to use Ardunio IDE 1.6.8

                            1 Reply Last reply
                            0
                            • HuczasH Offline
                              HuczasH Offline
                              Huczas
                              wrote on last edited by
                              #49

                              it's misstaken source code - line 11 should be deleted and then all is compiling well, it's just end of comment from line 10, [enter] is unnecessery there.

                              1 Reply Last reply
                              0
                              • F flopp

                                @dbemowsk
                                If you have the solar in the sun and the sensors in the shadow and protected from rain that will work.
                                My idea is to use a solar for all my outdoor sensors but have a bigger solar panel and a bigger(more mah) that feeds my nodes, rain, temp, hum, pressure, light, UV and in future lightning.

                                breimannB Offline
                                breimannB Offline
                                breimann
                                wrote on last edited by
                                #50

                                @flopp
                                I've been thinking along the same lines in terms of powering all my outdoor sensors with solar. Have you had a chance to try your ideas out yet? I'd be very interested in what you my have found. Should we start a new thread about that though? i'm very new to the forum so not sure (just joined tonight!).

                                F 1 Reply Last reply
                                0
                                • breimannB breimann

                                  @flopp
                                  I've been thinking along the same lines in terms of powering all my outdoor sensors with solar. Have you had a chance to try your ideas out yet? I'd be very interested in what you my have found. Should we start a new thread about that though? i'm very new to the forum so not sure (just joined tonight!).

                                  F Offline
                                  F Offline
                                  flopp
                                  wrote on last edited by
                                  #51

                                  @breimann
                                  It have been in use since I write this post.
                                  I have had many problems with the nodes. I don't know if the problem is with my repeater node/GW.
                                  Time to time is stop sending and then suddenly without restarting the node, it start to send again.
                                  I have restarted the nodes sometimes also.
                                  Maybe it is to "small" solar panel so it takes time for it to recharge the battery?
                                  If you will do a solar panel node, go for a big panel with high mA output and also a big battery(1000mA), I am using 1.2 v battery. I think it is much better to use at least 2.5 volt battery then you don't need the step-up.

                                  breimannB 1 Reply Last reply
                                  0
                                  • Nca78N Offline
                                    Nca78N Offline
                                    Nca78
                                    Hardware Contributor
                                    wrote on last edited by
                                    #52

                                    I think the problem is the nimh battery, this kind of partial charge/discharge cycles is more suitable for a li-ion battery. It's ok when used as a garden light because the battery will discharge completely during the night and will not have a memory effect, but with the low power usage of a sensor it will lose capacity quickly.

                                    Also if the solar panel is 1.2V like one your picture I don't understand how it could have enough voltage to charge the battery after the voltage drop of the diode ? On the garden light I bought the solar panel is 2V so it's possible to charge the battery to 100% at 1.4V+

                                    F 1 Reply Last reply
                                    0
                                    • Nca78N Nca78

                                      I think the problem is the nimh battery, this kind of partial charge/discharge cycles is more suitable for a li-ion battery. It's ok when used as a garden light because the battery will discharge completely during the night and will not have a memory effect, but with the low power usage of a sensor it will lose capacity quickly.

                                      Also if the solar panel is 1.2V like one your picture I don't understand how it could have enough voltage to charge the battery after the voltage drop of the diode ? On the garden light I bought the solar panel is 2V so it's possible to charge the battery to 100% at 1.4V+

                                      F Offline
                                      F Offline
                                      flopp
                                      wrote on last edited by
                                      #53

                                      @Nca78
                                      Yes it can be the NiMh battery, but it is actually run for days maybe weeks with out any problem.
                                      Today I disconnect the power to ATmega and put it back directly and it started to work.
                                      If the power goes below 0.8-0.9 it seems that I have to disconnect the step-up otherwise the solar panel cannot charge the battery.

                                      Solar panel is 1.4V and battery is 1.2V it seems to work and I have around 1.2-1.3 V during night

                                      P 1 Reply Last reply
                                      0
                                      • F flopp

                                        @breimann
                                        It have been in use since I write this post.
                                        I have had many problems with the nodes. I don't know if the problem is with my repeater node/GW.
                                        Time to time is stop sending and then suddenly without restarting the node, it start to send again.
                                        I have restarted the nodes sometimes also.
                                        Maybe it is to "small" solar panel so it takes time for it to recharge the battery?
                                        If you will do a solar panel node, go for a big panel with high mA output and also a big battery(1000mA), I am using 1.2 v battery. I think it is much better to use at least 2.5 volt battery then you don't need the step-up.

                                        breimannB Offline
                                        breimannB Offline
                                        breimann
                                        wrote on last edited by
                                        #54

                                        @flopp
                                        Thank you for your reply. That's all helpful info.

                                        1 Reply Last reply
                                        0
                                        • F Offline
                                          F Offline
                                          flopp
                                          wrote on last edited by
                                          #55

                                          A funny thing,
                                          Yesterday I power off/on both my solar nodes and now the second one sent the data, haha strange??!! It was about 20 hours ago I powered it off/on

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


                                          15

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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