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. Announcements
  3. 💬 Distance Sensor

💬 Distance Sensor

Scheduled Pinned Locked Moved Announcements
92 Posts 18 Posters 27.7k Views 18 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.
  • jjkJ Offline
    jjkJ Offline
    jjk
    wrote on last edited by
    #26

    @zboblamont lol, yeah that can happen with all the wonderful acronyms we have to deal with :)
    I had played with a JSN-SR04T (cable version) a while ago, but was very disappointed with accuracy and consistency, which also seems to be in line with most online ratings. So I switched to the HC-SR04 which worked well in another (indoor) setup. I'm not sure how that sensor will do in the water tank, but since it will always be at least 1m above the water level, I'm hoping it'll do o.k. - Will report once I got it working and then how it does over time...

    1 Reply Last reply
    0
    • jjkJ Offline
      jjkJ Offline
      jjk
      wrote on last edited by
      #27

      o.k. folks, here's another update. Thanks to a number of rainy days, I have worked on the setup in my lab environment, even got myself a fritzing pcb to make things a bit more stable. Indoors, with a new sensor, things worked out o.k., the readings were stable. With the sun back in our area, brought everything out to the tank. First finding: I proved the sensor that was still out there was faulty! Now everything is installed, readings are transmitted every 15 minutes. That's the good news. The bad news is, the readings are again not consistent! The following is a list of the last 20 or so readings:

      120
      86
      82
      84
      85
      67
      0
      82
      85
      80
      84
      126
      84
      85
      0
      85
      84
      60
      85
      51
      82

      I'd be happy with the "around 85cm" readings, but the other ones really bug me. Anyone has a clue what can cause that? Has anyone ever experienced something similar?

      zboblamontZ Boots33B 2 Replies Last reply
      0
      • jjkJ jjk

        o.k. folks, here's another update. Thanks to a number of rainy days, I have worked on the setup in my lab environment, even got myself a fritzing pcb to make things a bit more stable. Indoors, with a new sensor, things worked out o.k., the readings were stable. With the sun back in our area, brought everything out to the tank. First finding: I proved the sensor that was still out there was faulty! Now everything is installed, readings are transmitted every 15 minutes. That's the good news. The bad news is, the readings are again not consistent! The following is a list of the last 20 or so readings:

        120
        86
        82
        84
        85
        67
        0
        82
        85
        80
        84
        126
        84
        85
        0
        85
        84
        60
        85
        51
        82

        I'd be happy with the "around 85cm" readings, but the other ones really bug me. Anyone has a clue what can cause that? Has anyone ever experienced something similar?

        zboblamontZ Offline
        zboblamontZ Offline
        zboblamont
        wrote on last edited by
        #28

        @jjk Possible echoes confusing the flight time, possibly moisture buildup on the grille?
        For echo minimisation, it largely depends on where it is mounted relative to sidewalls or other objects which can give different flight times relative to the surface to be measured. In the water industry US sensors are frequently blinded to scatter effects by mounting on a tube through which the transducer sounds etc..

        1 Reply Last reply
        0
        • jjkJ Offline
          jjkJ Offline
          jjk
          wrote on last edited by
          #29

          @zboblamont thanks for the thoughts! I think I can rule out moisture build up as the effect started right after everything was installed. The confusing echos might be a lead?! I though I had made sure the sensor is over an area with no other objects around, but... I will see if I can test that by attaching some sort of tubing and report back when it's done

          zboblamontZ 1 Reply Last reply
          0
          • jjkJ jjk

            @zboblamont thanks for the thoughts! I think I can rule out moisture build up as the effect started right after everything was installed. The confusing echos might be a lead?! I though I had made sure the sensor is over an area with no other objects around, but... I will see if I can test that by attaching some sort of tubing and report back when it's done

            zboblamontZ Offline
            zboblamontZ Offline
            zboblamont
            wrote on last edited by
            #30

            @jjk Fair enough. If you try relatively snug fitting tubes in the dry at say the same length as the dead zone at least you can check if it still works ok before trying on the tank. In theory all you are doing is limiting the angles of the return path. It's a puzzle....

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #31

              You could average the last X measures and return the value

              1 Reply Last reply
              0
              • jjkJ Offline
                jjkJ Offline
                jjk
                wrote on last edited by
                #32

                @gohan that's what I'm doing already, I even disregard the "zero" readings and am looking into algorithms to eliminate runaway values. But frankly, that's not how it's supposed to work and you never know when the readings start becoming random, so the trust level is pretty low...
                @zboblamont I've tried a tube (one around the whole sensor for now) and that didn't change a thing, I'm afraid. I did notice, though, that there was quite a bit condesnsation on the box that I placed the sensor in, so maybe your thought about moisture build-up has a hang to it after all... Not sure, yet, how to deal with that, though...

                1 Reply Last reply
                0
                • jjkJ jjk

                  o.k. folks, here's another update. Thanks to a number of rainy days, I have worked on the setup in my lab environment, even got myself a fritzing pcb to make things a bit more stable. Indoors, with a new sensor, things worked out o.k., the readings were stable. With the sun back in our area, brought everything out to the tank. First finding: I proved the sensor that was still out there was faulty! Now everything is installed, readings are transmitted every 15 minutes. That's the good news. The bad news is, the readings are again not consistent! The following is a list of the last 20 or so readings:

                  120
                  86
                  82
                  84
                  85
                  67
                  0
                  82
                  85
                  80
                  84
                  126
                  84
                  85
                  0
                  85
                  84
                  60
                  85
                  51
                  82

                  I'd be happy with the "around 85cm" readings, but the other ones really bug me. Anyone has a clue what can cause that? Has anyone ever experienced something similar?

                  Boots33B Offline
                  Boots33B Offline
                  Boots33
                  Hero Member
                  wrote on last edited by Boots33
                  #33

                  @jjk said in 💬 Distance Sensor:

                  I'd be happy with the "around 85cm" readings, but the other ones really bug me. Anyone has a clue what can cause that? Has anyone ever experienced something similar?

                  You may need to run a waterproof ultrasonic sensor as condensation inside the tank will probably affect unsealed units. I have found the DYP-ME007 units work well for tank sensors.

                  Power supply is critical for the ultrasonic sensor. In testing i could only get stable readings from the DYP out to just over 1m when the circuit was running from my computer usb port. When i ran the same from a stable 5v supply it all worked as it should.

                  The two best filtering methods for ultrasonic sensor are to:

                  A: check for a number of identical readings in a row before transmitting the reading or
                  B: use median filtering to obtain a stable reading
                  if you are using the newping library it has median filtering built in and is very easy to use. See the sketch in my tank sensor project to see how.

                  1 Reply Last reply
                  2
                  • jjkJ Offline
                    jjkJ Offline
                    jjk
                    wrote on last edited by
                    #34

                    @Boots33 thanks for your detailed response! Is the DYP-ME007 the same as the JSN-SR04? As my experience with the latter is not too exciting... Anyways, I might as well give it another try! Also, thanks for the lead to your project and the median filtering in newping. I will definitely look into that and might just have to increase the number of readings the node takes and than filter for a transmission every 15 mins or so.

                    Boots33B 1 Reply Last reply
                    0
                    • jjkJ jjk

                      @Boots33 thanks for your detailed response! Is the DYP-ME007 the same as the JSN-SR04? As my experience with the latter is not too exciting... Anyways, I might as well give it another try! Also, thanks for the lead to your project and the median filtering in newping. I will definitely look into that and might just have to increase the number of readings the node takes and than filter for a transmission every 15 mins or so.

                      Boots33B Offline
                      Boots33B Offline
                      Boots33
                      Hero Member
                      wrote on last edited by
                      #35

                      @jjk said in 💬 Distance Sensor:

                      Is the DYP-ME007 the same as the JSN-SR04

                      They certainly look the same but not sure if they are identical. definitely check on the power, i went around in circles for a while and was nearly ready to give up on the DYP until i found they are very fussy on voltage. at 4.7v I could not get mine to be stable over 1.2m yet it was still rock solid under 1.2m.... nearly drove me crazy :)

                      1 Reply Last reply
                      0
                      • jjkJ Offline
                        jjkJ Offline
                        jjk
                        wrote on last edited by
                        #36

                        @Boots33 o.k. that's good advice! I just ordered some DYP and they have a bit of a lead time, that gives me time to think about getting an extra and stable 5V to the sensor.

                        zboblamontZ 1 Reply Last reply
                        0
                        • jjkJ jjk

                          @Boots33 o.k. that's good advice! I just ordered some DYP and they have a bit of a lead time, that gives me time to think about getting an extra and stable 5V to the sensor.

                          zboblamontZ Offline
                          zboblamontZ Offline
                          zboblamont
                          wrote on last edited by
                          #37

                          @jjk The JSN-SR04 looks very similar to the DYP-ME007 sensor, but what I found even more confusing is that there is a direct board mounted single transducer type advertised under the same type number for both models numbers when you do a search. As Boots33 has said and not the first to say it, these seem very voltage 'fussy'. I was about to order a JSN-SR04T variety to test out when I spotted this exchange. If you still have the JSN version would it not be worth trialling with a beefier supply as a test? I am most curious if this a case of voltage/current rather than faulty device.
                          I would suggest a 5v booster in your own scenario running off two AAs, they are cheap enough these days...

                          1 Reply Last reply
                          0
                          • jjkJ Offline
                            jjkJ Offline
                            jjk
                            wrote on last edited by
                            #38

                            @zboblamont, excellent idea, but unfortunately my previous tries with the JSN-SR04T were in a "previous life" of arduino experimenting quite a while ago and at the time, I dumped pretty much most of it (I hate to say, the JSN failures were one if the reasons...). That said, I have ordered some DYP and will give it another try. The tips you and @Boots33 have provided should get me much farer than last time ;) The key information I guess I was missing at the time was the sensitivity to voltage.

                            On another note... has anyone played around with alternative ways to measure water level, like a pressure tube or so? I'd be interested to see if that's an easier way, maybe?!

                            zboblamontZ Boots33B 3 Replies Last reply
                            0
                            • jjkJ jjk

                              @zboblamont, excellent idea, but unfortunately my previous tries with the JSN-SR04T were in a "previous life" of arduino experimenting quite a while ago and at the time, I dumped pretty much most of it (I hate to say, the JSN failures were one if the reasons...). That said, I have ordered some DYP and will give it another try. The tips you and @Boots33 have provided should get me much farer than last time ;) The key information I guess I was missing at the time was the sensitivity to voltage.

                              On another note... has anyone played around with alternative ways to measure water level, like a pressure tube or so? I'd be interested to see if that's an easier way, maybe?!

                              zboblamontZ Offline
                              zboblamontZ Offline
                              zboblamont
                              wrote on last edited by
                              #39

                              @jjk Fair enough. It will be interesting nevertheless to see how you get on with the newer version now you are looking at voltage, it does seem sensitive to power, both in volts and current (however small the latter).
                              I had a long look at pressure sensors before looking again at ultrasonics, and it is almost impossible to strike a balance between submerged IP68 and cheap. Closest I found were differential sensors (loads of them available from RS, Mouser, etc. to very low mBar ratings) but the problem was always the correspondence between measuring fluid pressure as air pressure. At a near constant temperature there should be no issues, but where you have the pressure vary as it must between -20 and + 45c environmental temperature throws out accuracy, ignoring gassing off.
                              For sewage only non-contact works, for clean water, DP cells can work but only under consistent environmental circumstances. Submerged low pressure cells should work, if you find a cheap one post it up....

                              1 Reply Last reply
                              0
                              • jjkJ jjk

                                @zboblamont, excellent idea, but unfortunately my previous tries with the JSN-SR04T were in a "previous life" of arduino experimenting quite a while ago and at the time, I dumped pretty much most of it (I hate to say, the JSN failures were one if the reasons...). That said, I have ordered some DYP and will give it another try. The tips you and @Boots33 have provided should get me much farer than last time ;) The key information I guess I was missing at the time was the sensitivity to voltage.

                                On another note... has anyone played around with alternative ways to measure water level, like a pressure tube or so? I'd be interested to see if that's an easier way, maybe?!

                                Boots33B Offline
                                Boots33B Offline
                                Boots33
                                Hero Member
                                wrote on last edited by
                                #40

                                @jjk said in 💬 Distance Sensor:

                                I have ordered some DYP and will give it another try.

                                That's the spirit. My tank sensor using the DYP has been running for a few months now and is performing very well so far. During our summer we had daytime temperatures well over 40 deg c and the readings remained stable. So I think the DYP is up to the task.

                                zboblamontZ 1 Reply Last reply
                                0
                                • Boots33B Boots33

                                  @jjk said in 💬 Distance Sensor:

                                  I have ordered some DYP and will give it another try.

                                  That's the spirit. My tank sensor using the DYP has been running for a few months now and is performing very well so far. During our summer we had daytime temperatures well over 40 deg c and the readings remained stable. So I think the DYP is up to the task.

                                  zboblamontZ Offline
                                  zboblamontZ Offline
                                  zboblamont
                                  wrote on last edited by
                                  #41

                                  @Boots33 So it seems on balance from the above experiences that the DYP sensor is proven reliable in use once given good voltage but questions remain on the JSN. The DYP type is not so readily available at reasonable cost over here so will order up a JSN and trial it. If it fails at least it is only $10 wasted, if not, it will answer this puzzle.

                                  Boots33B 1 Reply Last reply
                                  0
                                  • zboblamontZ zboblamont

                                    @Boots33 So it seems on balance from the above experiences that the DYP sensor is proven reliable in use once given good voltage but questions remain on the JSN. The DYP type is not so readily available at reasonable cost over here so will order up a JSN and trial it. If it fails at least it is only $10 wasted, if not, it will answer this puzzle.

                                    Boots33B Offline
                                    Boots33B Offline
                                    Boots33
                                    Hero Member
                                    wrote on last edited by
                                    #42

                                    @zboblamont It will be good to see the final results of both yours and @jjk

                                    zboblamontZ 2 Replies Last reply
                                    1
                                    • Boots33B Boots33

                                      @zboblamont It will be good to see the final results of both yours and @jjk

                                      zboblamontZ Offline
                                      zboblamontZ Offline
                                      zboblamont
                                      wrote on last edited by
                                      #43

                                      @Boots33 Still waiting on the gateway to arrive, as well as the DYP sensor, so had a go at assembling the electronics. Having red elsewhere about potential interference between a booster and ultrasonic, have mounted the booster with the ground plane facing the board and direct mounted onto the SR04T (I see this is 2.0 version which reportedly gave problems before). Although it works electrically with 3v firing the bistable relay feeding the booster feeding the SR04T, and switches off fine, any opinions on the proximity issues?
                                      0_1498892631584_WP_20170701_09_44_38_Pro[1].jpg
                                      0_1498892749650_WP_20170701_09_44_24_Pro[1].jpg

                                      Boots33B 1 Reply Last reply
                                      0
                                      • jjkJ jjk

                                        @zboblamont, excellent idea, but unfortunately my previous tries with the JSN-SR04T were in a "previous life" of arduino experimenting quite a while ago and at the time, I dumped pretty much most of it (I hate to say, the JSN failures were one if the reasons...). That said, I have ordered some DYP and will give it another try. The tips you and @Boots33 have provided should get me much farer than last time ;) The key information I guess I was missing at the time was the sensitivity to voltage.

                                        On another note... has anyone played around with alternative ways to measure water level, like a pressure tube or so? I'd be interested to see if that's an easier way, maybe?!

                                        zboblamontZ Offline
                                        zboblamontZ Offline
                                        zboblamont
                                        wrote on last edited by
                                        #44

                                        @jjk Well I think I am done trying to get this JSN-SR04T-2.0 to work, tried different versions of ping and newping, as well as other sketches from suppliers of this device, but got no joy at all. Even separated the 5v booster in case of potential interference, no joy whatsoever.
                                        Recent complaints on supplier sites seem to confirm problems persist for this version 2.0, and on one site there was a note "Note: Version 2.0 requires echo pin to be pulled up to VCC. A 4.7K to 10K resistor can be used as pull-up resistor."
                                        Fat lot of use that is to me with a 3.3v unit, and if it needs a dedicate sketch to work, good luck with those sales..
                                        I guess I can only wait on the DYP to arrive now....

                                        1 Reply Last reply
                                        0
                                        • zboblamontZ zboblamont

                                          @Boots33 Still waiting on the gateway to arrive, as well as the DYP sensor, so had a go at assembling the electronics. Having red elsewhere about potential interference between a booster and ultrasonic, have mounted the booster with the ground plane facing the board and direct mounted onto the SR04T (I see this is 2.0 version which reportedly gave problems before). Although it works electrically with 3v firing the bistable relay feeding the booster feeding the SR04T, and switches off fine, any opinions on the proximity issues?
                                          0_1498892631584_WP_20170701_09_44_38_Pro[1].jpg
                                          0_1498892749650_WP_20170701_09_44_24_Pro[1].jpg

                                          Boots33B Offline
                                          Boots33B Offline
                                          Boots33
                                          Hero Member
                                          wrote on last edited by
                                          #45

                                          @zboblamont Still no luck with the JSN unit I see. Hope the DYP unit will bring better results.

                                          zboblamontZ 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          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