OpenMarine
Non Invasive Tank Level Sensor build - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How I did it (https://forum.openmarine.net/forumdisplay.php?fid=6)
+--- Thread: Non Invasive Tank Level Sensor build (/showthread.php?tid=5386)



Non Invasive Tank Level Sensor build - Krishna - 2024-05-08

Hello All,

I was interested in getting tank level measurements from my water and fuel. There were no access hatches at the top of the tanks, and I didn't want to drill holes unnecessarily. I had seen some projects which use capacitive sensors to provide an indication of tanks status being full, half full, quarter full etc. But I was wanting to understand 'fullness' as a percentage of the total capacity.

I had seen a handful of projects documenting a solution using a DS1603L Ultrasonic Level Sensor, together with some resistors and ESP-8266. I hadn't been able to get those to compile and my programming knowledge was non existent.

I was most interested in a solution that would send data to OpenPlotter and SignalK. The ESP-8266 is not supported on SignalK 2.0 or above and documented workarounds did not resolve the issues. So I ditched the ESP-8266 for a esp32 wroom from AZ-Delivery and set about learning how to stitch bits of python code and some libraries together.

Using a couple of projects documented here as inspiration I created this project. One sensor currently costs £25 on Amazon.

I'm completely new to programming - so if someone could tell me how I could make tank height and the signalK path for the level output configurable at run time that would be the icing on the cake (for me at least !?!)

https://github.com/SV-Krishna/Ultrasonic-Liquid-Level-Sensor-SenseEsp
  • Install the code on a esp32 wroom from AZ-Delivery using Visual Code. Before uploading the code go to line 148 and change the tank height to the height of your own tank.
  • Connect all four leads from the sensor to the corresponding pins on the esp32. The yellow lead of the sensor goes to Pin 16, the white to pin 17. Connect sensor ground to ESP32 Ground, and Sensor power to the ESP32 5v pin. Note, no resistors, or hardware serial converters etc are required between the sensor and the esp32.
  • Power up the ESP32.
  • The ESP32 will create a wireless access point. Connect to the wireless access point using the password 'thisisfine'.
  • Once connected to the wireless access point a Wi-Fi configuration page will be displayed on 192.168.4.1. Use that page to connect to your boats Wi-Fi.
  • Using a mobile phone or similar that is connected to your boats Wi-Fi you will then be able to access the ESP32 using the address http://sensesp.local
  • From this portal you can check the status of the ESP32 and make run time configuration changes to Wi-Fi settings and sample rates as well as rebooting the device. At this point you can also change the device hostname sensesp.local to something more meaningful to your set up - e.g. watersensor.local.
  • Configure SignalK to accept data from the sensor following SensESP documentation
  • Test the sensor using methods outlined on this site.



RE: Non Invasive Tank Level Sensor build - SCarns - 2024-05-10

I did this with capacitive foil sensors on the outside of my plastic holding tank and uses and ESP32 with SensESP to send info over wifi to Openplotter. Worked great. Sold the boat though and I don't know where my code is, but there should be a reference thread on here about it. Might have even posted the code. SensESP made it easy, as I am not much of a programmer, but was able to figure it out.