Skip to the content
2 layers80 × 60 mmEsphome brunnen, the printed circuit board in 3D

esphome project to monitor waterlevel and temperature of a well or cistern

Size
80 × 60 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
47
Pads
87
Tracks, vias
110, 10
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
1 Oct 2024
Updated
1 Apr 2025

Overview

Esphome brunnen is an open-source printed circuit board by deveth0, from the deveth0/esphome-brunnen repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 80 × 60 mm with 25 parts on 47 nets, routed with 110 tracks and 10 vias.

It is built around the DS18B20, BC547 and BC557. Its parts include 10 resistors, 4 connectors, 2 ICs, 2 transistors and 1 capacitor. It belongs with the home automation and IoT and sensors and measurement boards and the ESP32 boards of this library.

Main components

3

README

README.md

esphome-brunnen

Repository with all required stuff to build an esphome node that monitors the waterlevel and temperature of a well or cistern. It does not require any power connection as it's using a solar panel and some batteries.

PCB

PCB

You can find a KiCad Model in this repository. The PCB can be mounted (aka glued) to the battery case of the Waveshare Solar Power Manager D. Using the spacers that come with the Solar board, you can mount it to the PCB.

Parts

NumberComponentPosition on PCB
1Solar Panel, 6-24V, see below
1Waveshare Solar Power Manager D
318650 Li-ion batteries
1MT3608 step up module
1D1 Mini ESP32 with headers
1TL-136 Sensor, 4-20mA, 24V
1DS18B20 Sensor, waterproof
1JST-XH 2 Pin cable
2JST-XH 3 Pin cable
1JST-XH 4 Pin cable
1BC547Q1
1BC557Q2
1tantalum capacitor 35V 1uFC1
1JST-XH 2 Pin HeaderJ3
2JST-XH 3 Pin HeaderJ1, J4
1JST-XH 4 Pin HeaderJ2
1DS18B20 Sensor, TO-92 packageU2
1Resistor, 4.7kR1
1Resistor, 33kR2
1Resistor, 100kR3
2Resistor, 150kR4, R5 (see note below)
2Resistor, 1kR6, R9
1Resistor, 150R7
1Resistor, 27kR8
1Resistor, 10kR10

D1 Mini ESP32

Before adding the D1 Mini to your PCB (i highly recommend using headers), you need to install the software to the board. All subsequent updates can be done using OTA but the first installation requires an USB connection.

[!CAUTION] DO NEVER CONNECT YOUR D1 BOARD VIA USB WHEN IT'S MOUNTED ON THE PCB

Solar Panel

You can use any solar panel that provides between 6-24V. Choose wattage according to the placement of your panel.

The resistors R4 and R5 are used to split the voltage of the solar panel into a range, that can be measured with an ESP32 gpio pin (max 3.3V). By using equally sized resistors, the voltage is cut by half, so this is fine for 6V panels. Change the resistors to the following values, when using other panels, also change the multiply factor of the solar_voltage sensor in brunnen.yaml.

[!WARNING] Some solar panels provide a slightly higher voltage than specified (e.g. 14V instead of 12V). To prevent any damage on the GPIO pin, use the resistor and multiply value of the next higher rated panel if you are not sure. This reduces the accuracy of the measured voltage a bit, but might save your D1.

PanelR4R5max V @ GPIOmultiply
6V150k150k3Vmultiply: 2
12V150k47k2.86multiply: 4.2
18V150k33k3.25Vmultiply: 5.5
24V150k22k3.07Vmultiply: 7.8

MT3608 Step up Module

The pressure sensor requires 24V which are generated by a step up module. The module is disabled when the ESP32 is in deepsleep using a BC547 transistor to reduce the power consumption.

Before adding the MT3608 to your circuit, you need to measure and change the output voltage to 24V, use a multimeter for that task.

Assembly

  • Solder the 2 Pin JST-XH cable to your pressure sensor
  • Solder one 3 Pin JST-XH cable to your waterproof DS18B20 sensor
  • Solder one 1 Pin JST-XH cable to your MT3608 step-up
    • VIN
    • GND
    • VOUT
  • Attach one 4 Pin JST-XH cable to your Waveshare Board:
    • GND
    • 5V
    • BAT+ (use the free terminal)
    • SOL+ (add cable together with solar panel to terminal)
  • Add solar panel to Waveshare Board
  • Attach batteries
  • Solder all remaining parts to the PCB
  • Check parts once again
  • Connect J2 to JST-XH cable coming from Waveshare Board, your ESP32 should power up now
  • Connect all remaining JST-XH cables
    • J1 - waterproof DS18B20
    • J3 - Pressure sensor
    • J4 - MT3608 Module

You should now see some sensor readings and can head over to the calibration of your pressure sensor.

Note: to make the connections a bit more sturdy, you can also remove the terminals and solder all cables to the Waveshare Board

Installation

secrets.yaml

Create a secrets.yaml file which contains your WiFi-credentials:

text
wifi_ssid: "YOUR_SSID"
wifi_password: "YOUR_PASSWORD"

Initial upload to ESP32

Attach your D1 Mini using USB to your computer, find out the correct COM port and run:

text
esphome run --device COM4 .\brunnen.yaml

The ESP32 should then reboot and connect to your wifi, note down it's IP.

[!CAUTION] DO NEVER CONNECT YOUR D1 BOARD VIA USB WHEN IT'S MOUNTED TO THE PCB

OTA Updates

When the initial upload is done, you can update your ESP32 using OTA updates. This does not require you to remove the board from the PCB.

text
esphome run --device 10.0.50.132 .\brunnen.yaml

D18B20 Sensors

Each of the D18B20 temperature sensors has a unique address that needs to be configured. Esphome logs all available devices when starting, you just need to figure out, which sensor is for the case and which one for water.

text
[20:37:31][C][gpio.one_wire:020]: GPIO 1-wire bus:
[20:37:31][C][gpio.one_wire:021]:   Pin: GPIO5
[20:37:31][C][gpio.one_wire:080]:   Found devices:
[20:37:31][C][gpio.one_wire:082]:     0x5d4a131c35646128 (DS18B20)
[20:37:31][C][gpio.one_wire:082]:     0x8f00000e7dbdd128 (DS18B20)

Pressure Sensor calibration

The pressure sensor gives around 4-20mA when submerged into water. Although this gives us a rough estimation, I recommend to calibrate the sensor with some known values.

Use the log output to determine the values read by your ESP32, this is what we are looking for:

text
'Wasserstand Voltage': Sending state 0.27872 V with 2 decimals of accuracy

First note down the voltage when the sensor is not in water (basically 0cm). Then add as many data points as seem reasonable (e.g. one per meter).

When submerging the sensor, give it a minute or two so the value stabilizes.

Now update the mapping table to reflect your measurements

text
      - calibrate_linear:
            - 0.28 -> 0.0 # 0cm
            - 0.60 -> 1.2 # 120cm
            - 0.75 -> 2.2 # 220cm
            - 0.91 -> 3.2 # 320cm
            - 1.32 -> 4.2 # 420cm

Home Assistant Integration

Finally you can add the Board to your Home Assistant setup and configure a switch that enables/disables deep-sleep.

Settings > Devices & Services > Add integration > esphome > Enter IP of your node

Deep Sleep Helper

By default the ESP32 board does not go to deep sleep. To allow OTA updates, a toggle in Home Assistant is used, that enables / disables sleep. As soon as the board wakes up, it checks if the toggle is enabled and only if so will sleep again.

If you ever want to do an OTA update and your ESP32 is sleeping, disable the toggle, wait until it wakes up for the next time and you can proceed.

Create the toggle in Home Assistant:

Settings > Devices & Services > Helpers > Create Helper > Toggle

Name the Helper Enable ESPHome Deepsleep (it's important that the id of the new helper matches the one configured in brunnen.yaml).

Acknowledgement

Parts

25
QtyValueFootprintReferences
2150kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR4, R5
21kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6, R9
2LOGOLOGOG***, G***
1100kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR3
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR10
1150Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7
127kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR8
133kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2
14.7kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1
1BC547Package_TO_SOT_THT:TO-92_InlineQ1
1BC557Package_TO_SOT_THT:TO-92_InlineQ2
1C_PolarizedCapacitor_THT:CP_Radial_Tantal_D4.5mm_P2.50mmC1
1DS18B20Package_TO_SOT_THT:TO-92_InlineU2
1DS18B20 ConnConnector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ1
1MT3608 ConnConnector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ4
1Power ConnConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ2
1Pressure ConnConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ3
1mini_esp32ESP32_mini:ESP32_miniU1

The 21 most common of 25 parts.

Similar boards

  • 2 layers100 × 100 mmWhiteBoy, the printed circuit board in 3D

    WhiteBoy

    nodep/NovaBox

    Circuit and PCB design of simple Bluetooth stereo receiver and amplifier

    111 parts11GPL-3.0
  • 2 layers205.7 × 137.2 mmArdipool, the printed circuit board in 3D

    Ardipool

    golgoth31/domopool

    Swimming pool management with an esp32

    21 parts3GPL-3.0
  • 2 layers56 × 65 mmSeaTalk1, the printed circuit board in 3D

    SeaTalk1

    dotnet/iot

    This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.

    24 parts2.4kMIT
  • 2 layers148.8 × 132.2 mmUsbflashprog, the printed circuit board in 3D

    Usbflashprog

    robsonsmartins/usbflashprog

    A memory device programmer (Flash/EPROM/E2PROM) board and software, connected to PC by USB port.

    125 parts36
  • 2 layers83.8 × 72.4 mmVoice board, the printed circuit board in 3D

    Voice board

    Windfisch/analog-synth

    A low-cost semimodular analog synthesizer

    131 parts31GPL-3.0
  • 2 layers13 × 0.5 mmKamstrup, the printed circuit board in 3D

    Kamstrup

    Hal9k-dk/kamstrup

    Kamstrup IR-øje

    11 parts19
  • 2 layers167.8 × 200.6 mmRandom Jazz Generator, the printed circuit board in 3D

    Random Jazz Generator

    telec16/modular-synth

    Little side project, don't expect much updates.

    132 parts16
  • 2 layers53 × 55.1 mmLedclock sensor, the printed circuit board in 3D

    Ledclock sensor

    luk6xff/led-clock

    LED clock with some fancy features

    35 parts9MIT

Questions

How big is the Esphome brunnen PCB?

It measures 80 × 60 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Esphome brunnen use?

25 parts, built around the DS18B20, BC547 and BC557. 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 Esphome brunnen KiCad files?

From the deveth0/esphome-brunnen repository on GitHub, at the commit this page was made from: the board is pcb/esphome-brunnen.kicad_pcb and its schematic pcb/esphome-brunnen.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Esphome brunnen design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).