• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Converting Distance to Volume with MyController (water tank)

    Scheduled Pinned Locked Moved General Discussion
    8 Posts 2 Posters 1.5k Views 1 Watching
    Loading More Posts
    • 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.
    • M Offline
      MTBHuw
      last edited by

      Hi, I have set up a distance sensor to measure water level in a tank which seems to be working fine. I have kept the sketch on the sensor very simple, it just sends me the distance to the water level from the top of the tank.

      Am I able to use My Controller to display/calculate the volume of water in the tank, using the tank dimensions and converting distance to water level, to depth of water?

      It's easy enough to do by hand, but is it possible to display a graph for example in My Controller, rather than the "raw" distance from the sensor?

      Thanks

      jkandasaJ 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @MTBHuw
        last edited by

        @mtbhuw This is my old MySensors water level sketch, you may get percentage from Arduino itself.

        https://github.com/mycontroller-org/ArduinoSketches/blob/master/WaterLevelSensor/WaterLevelSensor.ino

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          MTBHuw
          last edited by

          Thanks for the sketch. I was just wondering if it was possible to do the "conversions" in My Controller though, so that the sketch can be left as simple as possible.

          jkandasaJ 1 Reply Last reply Reply Quote 0
          • M Offline
            MTBHuw @jkandasa
            last edited by

            @jkandasa Will I need to add the relevant code to make this work with a nrf2401l module and serial gateway etc? Sketch looks ideal, thanks.

            jkandasaJ 1 Reply Last reply Reply Quote 0
            • jkandasaJ Offline
              jkandasa @MTBHuw
              last edited by

              @mtbhuw

              Thanks for the sketch. I was just wondering if it was possible to do the "conversions" in My Controller though, so that the sketch can be left as simple as possible.

              Yes, it is possible. you have to write a script and trigger when you get new data.

              M 1 Reply Last reply Reply Quote 0
              • jkandasaJ Offline
                jkandasa @MTBHuw
                last edited by

                @mtbhuw

                Will I need to add the relevant code to make this work with a nrf2401l module and serial gateway etc? Sketch looks ideal, thanks.

                Yes, you have to add relevant code to your sketch. No need to worry about NRF code. Mine is old MySensors sketch. Just take conversion code only NOT NRF code.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  MTBHuw @jkandasa
                  last edited by

                  @jkandasa ok, thanks. Do you have any examples of any scripts to show what sort of thing can be done? And also any pointers as to what to do in My Controller to get them running?

                  jkandasaJ 1 Reply Last reply Reply Quote 0
                  • jkandasaJ Offline
                    jkandasa @MTBHuw
                    last edited by

                    @mtbhuw https://forum.mycontroller.org/topic/146/how-to-set-sensor-value-with-javascript

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    0

                    Online

                    586

                    Users

                    529

                    Topics

                    3.4k

                    Posts
                    Copyright © 2015-2025 MyController.org | Contributors | Localization