Integrating fresh and grey water tank electrode sensors into Venus OS using ESP32 + MQTT

I am running Venus OS on a Raspberry Pi 4B in my camper and I am gradually replacing the original Schaudt control system with Venus OS.

At the moment I have a Schaudt EBL 208S and an Adria/Schaudt LT421 panel, but both will be removed. I would like to keep the original fresh-water and grey-water tank sensors and integrate them directly into Venus OS.

Both tanks use a classic conductive electrode level sensing system.

Each tank has five metal electrodes:

  • one common/base electrode;
  • 25% level electrode;
  • 50% level electrode;
  • 75% level electrode;
  • 100% level electrode.

So, in total for both tanks, I have:

  • 8 level signals;
  • 2 common electrodes.

The original LT421 panel does not power the probes continuously. To check the tank level, the user has to press and hold the tank-level button for a few seconds.

I tested the grey-water tank with a multimeter and confirmed that the brown wire is the common/base electrode. When the LT421 level button is pressed, I measure approximately 12 V DC between that common electrode and negative.

So I understand the original system to work roughly like this:

+12 V only during measurement
          |
          |
     common electrode
          |
         water
          |
  25 / 50 / 75 / 100 %
          |
       LT421 panel

With the new system, I do not want to use 12 V on the probes, and I do not want to leave them powered continuously.

My plan is to use one ESP32 for both tanks and then send the tank levels to Venus OS via Wi-Fi / MQTT, so they can appear as:

Fresh water
0 / 25 / 50 / 75 / 100 %

Waste water
0 / 25 / 50 / 75 / 100 %

To multiplex the eight level electrodes, I am considering using a 74HC4051 8-channel analog multiplexer.

The proposed wiring is roughly:

FRESH WATER

25 %  -- 100 kΩ -- Y0
50 %  -- 100 kΩ -- Y1
75 %  -- 100 kΩ -- Y2
100 % -- 100 kΩ -- Y3

common -- 10 kΩ -- ESP32 GPIO32


GREY WATER

25 %  -- 100 kΩ -- Y4
50 %  -- 100 kΩ -- Y5
75 %  -- 100 kΩ -- Y6
100 % -- 100 kΩ -- Y7

common -- 10 kΩ -- ESP32 GPIO33

The 74HC4051 would be powered at 3.3 V:

ESP32                  74HC4051

3V3  ---------------- VCC
GND  ---------------- GND
GND  ---------------- VEE
GND  ---------------- EN

GPIO25 -------------- S0
GPIO26 -------------- S1
GPIO27 -------------- S2

GPIO34 ADC1 <-------- Z / COM

At the ADC input I am thinking of using:

74HC4051 Z
    |
    +------ ESP32 GPIO34 / ADC1
    |
   1 MΩ
    |
   GND

and possibly a 100 nF capacitor to help stabilise the reading.

The idea is that the probes remain unpowered almost all of the time.

For example, every 30 or 60 seconds:

1. GPIO32 HIGH
2. wait around 20-50 ms
3. read the four fresh-water level electrodes
4. GPIO32 LOW

5. GPIO33 HIGH
6. wait around 20-50 ms
7. read the four grey-water level electrodes
8. GPIO33 LOW

This way, the electrodes would only see 3.3 V for a few milliseconds, instead of being continuously energised, with the aim of minimising electrolysis and corrosion.

The ESP32 would determine the highest wet electrode and publish one of these five values over MQTT:

0 %
25 %
50 %
75 %
100 %

The next step would be to integrate those MQTT values into Venus OS as two tank services using some kind of dbus-mqtt / MQTT tank service, so Venus OS treats them as a native Fresh Water tank and Waste Water tank.

Before building the electronics, I would really appreciate feedback from anyone who has integrated tanks, ESP32 devices, or custom MQTT sensors into Venus OS.

My main questions are:

  1. Does ESP32 + 74HC4051 seem like a sensible way to read these eight electrodes?

  2. Do 10 kΩ, 100 kΩ and 1 MΩ seem like reasonable starting resistor values, or would you use different values?

  3. Since the original Schaudt system uses approximately 12 V during measurement, do you think 3.3 V will provide reliable conductivity detection, especially in the fresh-water tank?

  4. Would you recommend treating the probe signals as simple digital inputs, or using the ESP32 ADC so the dry/wet threshold can be calibrated in software?

  5. Are there any drawbacks to using a 74HC4051 for this kind of conductivity measurement? Would another multiplexer or an external ADC be preferable?

  6. To minimise electrolysis/corrosion, is powering the probes for only a few milliseconds every 30-60 seconds sufficient, or would AC excitation / polarity reversal be recommended?

  7. What is currently the cleanest way to expose two external tanks to Venus OS over MQTT? My goal is for them to appear natively as Fresh Water and Waste Water, initially as percentage and later also in litres.

  8. Is there already an ESP32/Venus OS project doing something similar that would be worth reusing instead of developing everything from scratch?

  9. The original system uses one common electrode per tank. On the grey-water tank I have already confirmed which wire is the common and that it receives 12 V during measurement. Would you recommend any additional electrical measurements before connecting the probes to the ESP32?

  10. Finally, is there anything in this proposed circuit that could put the 3.3 V ESP32 inputs at risk, or that should be protected differently?

My goal is to keep the system as simple and reliable as possible, reuse the existing tank probes, and avoid installing completely new level sensors.

Any corrections, suggestions, or experience with similar systems would be very welcome before I build the final hardware.