• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • 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.7k 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 20 Nov 2017, 12:48

    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

    J 1 Reply Last reply 20 Nov 2017, 13:52 Reply Quote 0
    • J Offline
      jkandasa @MTBHuw
      last edited by 20 Nov 2017, 13:52

      @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 20 Nov 2017, 18:55 Reply Quote 0
      • M Offline
        MTBHuw
        last edited by 20 Nov 2017, 17:22

        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.

        J 1 Reply Last reply 22 Nov 2017, 01:44 Reply Quote 0
        • M Offline
          MTBHuw @jkandasa
          last edited by 20 Nov 2017, 18:55

          @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.

          J 1 Reply Last reply 22 Nov 2017, 01:45 Reply Quote 0
          • J Offline
            jkandasa @MTBHuw
            last edited by 22 Nov 2017, 01:44

            @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 22 Nov 2017, 07:23 Reply Quote 0
            • J Offline
              jkandasa @MTBHuw
              last edited by 22 Nov 2017, 01:45

              @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 22 Nov 2017, 07:23

                @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?

                J 1 Reply Last reply 23 Nov 2017, 13:04 Reply Quote 0
                • J Offline
                  jkandasa @MTBHuw
                  last edited by 23 Nov 2017, 13:04

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

                  1 Reply Last reply Reply Quote 0
                  7 out of 8
                  • First post
                    7/8
                    Last post

                  0

                  Online

                  629

                  Users

                  532

                  Topics

                  3.4k

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