Skip to the content
2 layers112 × 57 mmCaravansensor, the printed circuit board in 3D

DIY project to build a smart fuel sensor for RVs or in other projects. It is based on air pressure and is able to measure fresh water as well as grey and black water levels with high precision.

Size
112 × 57 mm
Copper layers
2
Thickness
1.6 mm
Parts
226
Nets
175
Pads
642
Tracks, vias
2,118, 226
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
12 Dec 2021
Updated
23 Aug 2023

Overview

Caravansensor is an open-source printed circuit board by MartinVerges, from the MartinVerges/womolin-waterlevel repository on GitHub. It is a 2-layer board of 112 × 57 mm with 226 parts on 175 nets, routed with 2,118 tracks and 226 vias.

It is built around the ESP32-WROOM-32D, TJA1021T/10/C and HX711, with the LMV321, BMP388 and TPS54331D among its other parts. Its parts include 91 resistors, 53 capacitors, 43 diodes, 16 transistors and 11 ICs. It belongs with the sensors and measurement boards and the ESP32 boards of this library.

Main components

12

README

README.md

womolin.tanklevel

DIY project to build a smart tank level sensor for RVs or in other projects. It is based on air pressure and is able to measure fresh water as well as grey and black water levels with high precision.

This project is still in development, it's a working sensor and I'm happy about pull requests to add more functionality, improve existing ones or just feedback.

Why?

After I have long found on the market for camping nothing that is on the one hand affordable and on the other hand also technically good, I have started the development of my own tank sensor.

Thanks to the ESP32 this can be queried directly via WLAN or Bluetooth. In addition MQTT, the sensor value can be pushed into an MQTT broker.

Focus of this Project

The following aspects are the focus of this project:

  • Easy to use and rebuild
  • Precise in the evaluation of the data
  • Stand alone usable
  • Usable in all type of liquids

Show me how it looks

Video Demonstration

Live video demonstration

Screenshots from the mobile UI

StatusCalibrationUniform calibrationConfigurationWifi Management

Photos of the prototype

Prototype PicturesPrototype PicturesMounting

Prototype inside the housingPrototype inside the housing

Photos of the immersion tube

immersion tubeimmersion tubeimmersion tube

Schematics
Schematic
Housing

The 3D printed housing can be found on onshape as a editable document, or inside the folder housing/* as STL files.

BOM - Bill of Materials

To build this sensor yourself, you need:

  • 1x ESP32 ESP32-WROOM-32
  • 1x MPX53DP Pressure Sensor (~8.00€)
  • 1x HX711 24-bit ADC
  • 1x Pushbutton (~0.15€)
  • 1x Tube with 20mm outher dimension (~1€) HDPE 20mm
  • 1x Tube with 4mm inner width (~1€) PVC 4x1mm
  • 1x Mini Air Pump (~2€) 3V 370
  • 1x Small 12V to 5V power supply (~1€)
  • 1x PG screw fitting in the dimension for the 20mm tube
  • 1x Connector for the Tank itself, strongly depending on your individual situation

In addition you need some few small cables and soldering equipment to build the circuit.

Webinstaller

To make it super simple, our pre build firmware can be uploaded to your ESP32 using our Webinstaller. You can find it at https://webinstaller.womolin.de.

OTA (Over-the-Air) Firmware files

If you want to update an already installed Sensor, you can upload the binarys directly to the sensor using the Web UI. The latest version (current git main branch) is available at https://s3.womolin.de/webinstaller/waterlevel-latest/firmware.bin and https://s3.womolin.de/webinstaller/waterlevel-latest/littlefs.bin.

How to build this PlatformIO based project

  1. Install PlatformIO Core
  2. Run these commands:
text
    # Change directory into the code folder
    > cd womolin.tanklevel

    # Build project
    > platformio run -e esp32dev

    # Upload firmware
    > platformio run -e esp32dev --target upload

Upload prebuild file

Here is a example command to upload existing firmware files.

text
/path/to/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 921600 --before default_reset --after hard_reset \
    write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB \
    0x1000 bootloader_dio_80m.bin \
    0x8000 partitions.bin \
    0xe000 boot_app0.bin \
    0x10000 firmware.bin \
    0x190000 firmware.bin \
    0x310000 littlefs.bin

Please make sure that your ESP32 runs with these settings before uploading it.

How to build the UI

As the UI requires a valid FontAweSome License, you can find a generated littlefs.bin with my subscription. It's automatically uploaded to our S3 at https://s3.womolin.de/webinstaller/gaslevel-latest/littlefs.bin. Please feel free to take this one for your sensor.

Build your own littlefs.bin

As I haven't found good icons with a free license, I choosed the pro version of fontawesome. Therefore it's required to have a valid subscription in order to build the UI yourself.

Set your FontAweSome key:

text
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" XXXXXXXXXXXXXXXXXXXX

Build the UI:

text
cd ui
npm install
npm run build
cd ..
pio run -e esp32dev -t buildfs

Operation

When the sensor is started for the first time, a WiFi configuration portal opens via which a connection to the central access point can be established. As soon as the connection has been established, the sensor is available on the IP assigned by the DHCP and the hostname tanklevel.local provided by MDNS. You can now log in to the webobverface and proceed with the sensor setup. To obtain a tank level, it is necessary to measure the tank. This can be done in 2 different ways:

  1. Uniformly shaped tanks whose water level rises evenly.
  2. Unevenly shaped tanks that contain bulges, tapers or other complex shapes.

Uniform

Install the Sensor in an empty Tank, navigate to the setup. Press the button to determine the lower value of the tank. The value then appears in the input field.

Unevenly

Install the Sensor in an empty Tank, navigate to the setup. Prepare everything to achieve a constant inflow into the tank. The best way to do this is to use water connections to city networks with a larger cross-section. Refueling through this water connection should be done within about 3 minutes.

Once you have prepared everything, start the setup and now turn on the water tap. The sensor now determines the increase in water level and calculates the percentage distribution in the tank at the end of the process. Once the tank is completely filled, turn off the water supply and wait about 5 seconds before completing the setup via the web interface so that the pressure can normalize.

Android Bluetooth Low Energy (BLE) App

This sensor can be displayed using my Android App.

Power saving mode

This sensor is equipped with various techniques to save power. Unfortunately, the operation of WiFi causes relatively high power consumption (45~55mA idle, up to 250mA during transmission). This is not a problem in RVs with larger batteries or solar panels, but may be too high in small installations. Therefore, the WiFi module can be easily and conveniently switched off via the web interface, putting the sensor into a deep sleep mode. Here, the consumption of the esp32 officially drops to about 10μA. Including the used step down power supply it will still consume 12.2mA in this sleep mode with RTC ADC enabled, so around 1/4 of full featured wifi enabled consumtion. At regular intervals, the sensor switches on briefly, checks the tank level and updates the analog output of the sensor.

Since the WiFi portal is not available in this mode, you can reactivate the WiFi by pressing the button on the device once.

Wifi connection failed or unable to interact

The button on the device switches from Powersave to Wifi Mode. When the button is pressed again, the sensor restarts and opens its own access point. Here you can correct the WLAN data.

Alternatives

Pressure based (like this project)

The only know alternative SuperSense tank sensor is available at around 259€ for purchase, but the price is extremely high and the data cannot be accessed digitally as it's proprietary.

Resistance based

There are a lot of cheapest probes which all show only rough and mostly wrong data. These are mostly based on measuring the resistance or continuity between two or more conductive rods that come into contact with water.

These probes usually cost more than the components in this project, but are extremely inaccurate, prone to calcification and malfunction.

Using it with Home Assistant

To use the data of the sensor in the best possible way from the MQTT in HomeAssistant, here is an example configuration. Please put it into your configuration.yaml file.

text
mqtt:
  sensor:
    - name: "Freshwater Level"
      unique_id: "freshwaterlevel"
      state_topic: "freshwater/tanklevel1"
      unit_of_measurement: "%"
      icon: "mdi:water-percent"

    - name: "Freshwater sensor temperature"
      unique_id: "freshwatertemp"
      state_topic: "freshwater/temperature1"
      unit_of_measurement: "°C"
      icon: "mdi:temperature-celsius"

    - name: "Freshwater sensor air pressure"
      unique_id: "freshwaterpressure"
      state_topic: "freshwater/airPressure1"
      unit_of_measurement: "hPa"
      icon: "mdi:gauge"

Your dashboard configuration could look like that:

text
square: false
columns: 2
type: grid
cards:
  - type: vertical-stack
    cards:
      - type: gauge
        entity: sensor.freshwater_level
        severity:
          green: 50
          yellow: 20
          red: 0
        needle: false
        min: 0
        max: 100
      - type: entities
        entities:
          - entity: sensor.freshwater_sensor_temperature
            name: Temp.
          - entity: sensor.freshwater_sensor_air_pressure
            name: Airpres.
        show_header_toggle: false

License

womolin.tanklevel (c) by Martin Verges.

This Project is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You should have received a copy of the license along with this work. If not, see http://creativecommons.org/licenses/by-nc-sa/4.0/.

Parts

226
QtyValueFootprintReferences
3810kResistor_SMD:R_0402_1005MetricR19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31, R32, R33, R34 +22
23100nCapacitor_SMD:C_0402_1005MetricC1, C2, C10, C11, C12, C13, C14, C20, C21, C40, C41, C42, C43, C44, C47, C48 +7
21RCLAMP0521P-NDiode_SMD:D_0402_1005MetricD17, D18, D19, D20, D31, D32, D33, D34, D35, D36, D37, D38, D39, D40, D41, D42 +5
201kResistor_SMD:R_0402_1005MetricR35, R36, R37, R38, R39, R40, R41, R42, R59, R60, R61, R62, R63, R64, R65, R66 +4
1810nCapacitor_SMD:C_0402_1005MetricC24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39 +2
17100rResistor_SMD:R_0402_1005MetricR7, R13, R14, R15, R16, R71, R72, R77, R78, R79, R80, R81, R82, R83, R84, R85 +1
10ESD5Z15VDiode_SMD:D_SOD-523D13, D14, D15, D16, D25, D26, D27, D28, D29, D30
81N4148WSDiode_SMD:D_SOD-323FD9, D10, D11, D12, D21, D22, D23, D24
8LBSS260DWPackage_TO_SOT_SMD:SOT-363_SC-70-6Q5, Q6, Q7, Q8, Q11, Q12, Q13, Q14
4LBSS84DWPackage_TO_SOT_SMD:SOT-363_SC-70-6Q9, Q10, Q15, Q16
347uCapacitor_SMD:C_0805_2012MetricC22, C23, C50
2100kResistor_SMD:R_0402_1005MetricR73, R74
2100pCapacitor_SMD:C_0402_1005MetricC15, C52
210uCapacitor_SMD:C_1206_3216MetricC3, C4
21nCapacitor_SMD:C_0402_1005MetricC18, C51
2200kResistor_SMD:R_0402_1005MetricR68, R70
220kResistor_SMD:R_0402_1005MetricR1, R3
24k7Resistor_SMD:R_0402_1005MetricR86, R87
24u7Capacitor_SMD:C_0805_2012MetricC16, C17
28k2Resistor_SMD:R_0402_1005MetricR2, R4
2B340ADiode_SMD:D_SMAD2, D4
2Conn_01x04Connector_Phoenix_MC:PhoenixContact_MC_1,5_4-G-3.81_1x04_P3.81mm_HorizontalJ9, J10
2HX711Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU3, U4
2Jumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP2, JP3
2LInductor_SMD:L_0402_1005MetricL2, L3
2LMV321Package_TO_SOT_SMD:SOT-23-5U8, U9
2MMBT5401Package_TO_SOT_SMD:SOT-23Q3, Q4
2MMBTA92-Transistor_BJTPackage_TO_SOT_SMD:SOT-23Q1, Q2
2MPX53Caravansensor:344CU1, U2
2SMF16ADiode_SMD:D_SOD-123D1, D3
110k2Resistor_SMD:R_0402_1005MetricR17
112kResistor_SMD:R_0402_1005MetricR88
129k4Resistor_SMD:R_0402_1005MetricR12
1332kResistor_SMD:R_0402_1005MetricR10
13k24Resistor_SMD:R_0402_1005MetricR18
147pCapacitor_SMD:C_0402_1005MetricC19
168k1Resistor_SMD:R_0402_1005MetricR11
1BMP388Caravansensor:PQFN50P200X200X80-10NU10
1Conn_01x05Connector_Phoenix_MC:PhoenixContact_MC_1,5_5-G-3.81_1x05_P3.81mm_HorizontalJ11
1Conn_02x03_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalJ1
1DB25_FemaleConnector_Dsub:DSUB-25_Female_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mmJ8
1ESP32-WROOM-32DRF_Module:ESP32-WROOM-32U5
1ME6209A50M3GPackage_TO_SOT_SMD:SOT-23U11
1PolyfuseFuse:Fuse_1806_4516MetricF1
1SLO0630H6R8MTTInductor_SMD:L_Neosid_SM-PIC0512HL1
1TJA1021TPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU6
1TPS54331DPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU7
1TS-1093A-A12B3-D2Button_Switch_THT:SW_Tactile_SKHH_AngledSW1

Similar boards

  • 2 layers80.8 × 99.1 mmEsper v1, the printed circuit board in 3D

    Esper v1

    Antonio-Ciociola/esper

    Esp32 based eurorack module.

    82 parts1
  • 4 layers47 × 39.5 mmStealthburner Toolhead PCB, the printed circuit board in 3D

    Stealthburner Toolhead PCB

    acha666/RP2040_ToolheadPCB_SB

    A Toolhead PCB for VORON StealthBurner based on RP2040

    145 parts43GPL-3.0
  • 2 layers55 × 8 mmAls board, the printed circuit board in 3D

    Als board

    blu006/blu_BOB_and_MISC

    My breakout boards and miscellaneous boards

    27 parts
  • 4 layers116 × 62 mmAccesscontrol, the printed circuit board in 3D

    Accesscontrol

    catphish/accesscontrol

    64 parts
  • 2 layers71.1 × 73.7 mmStep Down 3 3V, the printed circuit board in 3D

    Step Down 3 3V

    ha-y-z/Diplom-Thesis-Smart-Solar-Seeker

    My high school diploma thesis about a solar panel which seeks to the sun by itself.

    40 parts
  • 2 layers191.5 × 116 mmPiDaughterBoard, the printed circuit board in 3D

    PiDaughterBoard

    mekatrol/electronics

    This repository contains the electronics, embedded firmware, support software, and reference material for a collection of home-automation and workshop projects.

    175 parts
  • 2 layers52 × 38 mmEsp32-c3-smart scale, the printed circuit board in 3D

    Esp32-c3-smart scale

    xmyoot/esp32-c3-smart-scale

    A low-power Wi-Fi/BLE smart-scale main board, designed natively in KiCad 10. It has a 24-bit load-cell front end, USB-C Li-ion charging, an external antenna and a 35 µA standby budget.

    42 parts
  • 2 layers100 × 100 mmUsb2most, the printed circuit board in 3D

    Usb2most

    smartgauges/usb2most

    USB to MOST adapter

    139 parts26GPL-3.0

Questions

How big is the Caravansensor PCB?

It measures 112 × 57 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Caravansensor use?

226 parts, built around the ESP32-WROOM-32D, TJA1021T/10/C, HX711 and LMV321. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Caravansensor KiCad files?

From the MartinVerges/womolin-waterlevel repository on GitHub, at the commit this page was made from: the board is PCB/Caravansensor.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Caravansensor design in my own project?

Its repository states no licence, so its author keeps all rights: ask MartinVerges before reusing the design.