Converting Distance to Volume with MyController (water tank)
-
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
-
@mtbhuw This is my old MySensors water level sketch, you may get percentage from Arduino itself.
-
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.
-
@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.
-
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.
-
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.
-
@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?
-