Skip to the content
2 layers30.5 × 119.1 mmPlantWatering, the printed circuit board in 3D

Soil moisture sensor and plant watering with an ESP8266

Size
30.5 × 119.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
22
Pads
69
Tracks, vias
166, 34
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
5 Aug 2019
Updated
28 Dec 2020

Overview

PlantWatering is an open-source printed circuit board by MadsBornebusch, from the MadsBornebusch/PlantFriends repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 30.5 × 119.1 mm with 19 parts on 22 nets, routed with 166 tracks and 34 vias.

It is built around the ESP-12E, LT1763CDE and 1N4148W, with the IRLML2502 among its other parts. Its parts include 6 resistors, 4 connectors, 3 capacitors, 2 ICs and 1 diode. It belongs with the ESP8266 boards of this library.

Main components

4

README

README.md

The code is licensed under the GNU General Public License Version 3.

The PCB is licensed under the Creative Commons Attribution-ShareAlike 4.0 license due to using an ESP8266 kicad library and a particular soil moisture probe design.


This is a plant watering ESP8266.

Features

  • Fully open source (software and hardware)
  • Automatic OTA update via Github release - enable/disable using checkbox
  • OTA updates via a web interface
  • Works with any MQTT server
  • Works with Home Assistant discovery
  • Set the sleep time, watering delay, water threshold, water time etc via MQTT
  • Works with ThingSpeak
  • Temperature, pressure and humidity using BME280

PCB

Pinout when seen from component side:

Left side from top:

  • FTDI_RX
  • FTDI_TX
  • SDA
  • SCL
  • GND
  • Battery VCC

Right side from top:

  • Battery VCC IN
  • GND
  • VCC (3.3 V)
  • Watering OUT

Enclosure

A enclosure meant for 3D printing can be found in the enclosure directory. Two variant are available. One with a closed top and one with a cutout for mounting a breakout board.

TODO: Add pictures

Settings

The WiFi, ThingSpeak and MQTT settings can be configured via a web interface:

If you do not want to use ThingSpeak simply leave the ThingSpeak API key field empty. Similarly the MQTT can be disabled by leaving the MQTT base topic empty.

At first boot the module will turn on a hotspot with the SSID: PlantFriends and password: plantsarecool.

After logging on to the WiFI simply navigate to http://plantfriends.local or http://192.168.4.1 to configure the module.

The device can be put back into hotspot mode by shorting the TX and RX pins and restarting the module.

A new firmware and file system image can be uploaded by navigation to http://plantfriends.local/update or http://192.168.4.1/update.

Calibrating the soil moisture sensor

Click "Calibrate Soil moisture sensor". Follow the instructions. Some handy tips:

  • Don't get the electronics wet, only the sensor part
  • When doing the wet calibration, use a half full glass of water (or half empty if you are that tye of person). Half of the sensor should be in water. Otherwise the readings when the sensor is put in soil will be very low.
  • If you need to redo a step in the calibration, just refresh the page.

Images of the wet and dry calibration are shown below:

Home Assistant

Simply activate MQTT discovery by adding the following to your configuration.yaml file:

yaml
mqtt:
  discovery: true

Assuming your plant is named office it will now show up as a sensor like so:

TODO: Upate this image!

The name of the plant is taken from the MQTT base topic and get be chaned via the HTTP settings page.

Advanced Home Assistant configuration

This section will guide you through on how to set the sleep time, watering delay, watering threshold and watering time directly via the Home Assitant overview page.

First add the following to your configuration.yaml file:

yaml
input_number:
  office_sleep_time:
    name: Sleep Time
    min: 10
    max: 60
    step: 5
    icon: mdi:sleep
    unit_of_measurement: min
  office_watering_delay:
    name: Watering Delay
    min: 0
    max: 360
    step: 10
    icon: mdi:timer-sand
    unit_of_measurement: min
  office_watering_threshold_pct:
    name: Watering Threshold Pct
    min: 0
    max: 100
    step: 0.1
    icon: mdi:target
    unit_of_measurement: pct
  office_watering_time:
    name: Watering Time

This will create four sliders, one for each parameter. Remember to replace office with the MQTT base topic you have set via the web interface.

Now add the following to your automations.yaml file:

yaml
- alias: Plant set slider
  trigger:
  - platform: mqtt
    topic: 'plant/+/config'
  action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.{{ trigger.topic.split('/')[1] }}_sleep_time
      value: "{{ trigger.payload_json.sleep_time | float }}"
  - service: input_number.set_value
    data_template:
      entity_id: input_number.{{ trigger.topic.split('/')[1] }}_watering_delay
      value: "{{ trigger.payload_json.watering_delay | float }}"
  - service: input_number.set_value
    data_template:
      entity_id: input_number.{{ trigger.topic.split('/')[1] }}_watering_threshold_pct
      value: "{{ trigger.payload_json.watering_threshold_pct | float }}"
  - service: input_number.set_value
    data_template:
      entity_id: input_number.{{ trigger.topic.split('/')[1] }}_watering_time
      value: "{{ trigger.payload_json.watering_time | float }}"
  - service: input_number.set_value
    data_template:
      entity_id: input_number.{{ trigger.topic.split('/')[1] }}_automatic_ota

This makes sure that the MQTT config topic is updated when the slider is moved and that the slider is always set to the MQTT config topic when it changes.

Finally you can add the sensors and the inputs slider into on group by adding the following to groups.yaml:

yaml
office_plant:
    name: "Office Plant"
    icon: mdi:sprout
    entities:
    - sensor.office_soil_moisture_pct
    - sensor.office_voltage
    - sensor.office_battery
    - sensor.office_temperature
    - sensor.office_pressure
    - sensor.office_humidity
    - input_number.office_sleep_time
    - input_number.office_watering_delay
    - input_number.office_watering_threshold_pct
    - input_number.office_watering_time
    - input_number.office_automatic_ota

Note that the temperature, pressure and humidity sensors are only available if a BME280 is connected.

The plant will now show up in the Home Assistant overview like so:

TODO: Update this image

ThingSpeak

TODO: Add guide

Parts

19
QtyValueFootprintReferences
21KResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR2, R6
1100KResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR4
110KResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR1
110nFCapacitor_SMD:C_1206_3216Metric_Pad1.42x1.75mm_HandSolderC2
11N4148WDiode_SMD:D_SOD-123D1
11uFCapacitor_SMD:C_1206_3216Metric_Pad1.42x1.75mm_HandSolderC1
1220KResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR5
13.3-10uFCapacitor_SMD:C_1206_3216Metric_Pad1.42x1.75mm_HandSolderC3
1330KResistor_SMD:R_1206_3216Metric_Pad1.42x1.75mm_HandSolderR3
1BATTConnector_JST:JST_PH_B2B-PH-SM4-TB_1x02-1MP_P2.00mm_VerticalJ3
1ESP-12EESP8266:ESP-12E_SMDU2
1FTDIConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ2
1I2C_sensorConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1IRLML2502Package_TO_SOT_SMD:SOT-23_HandsolderingQ1
1LT1763Package_SO:SOP-8_3.76x4.96mm_P1.27mmU1
1ProgramButton_Switch_SMD:SW_SPST_EVQP7ASW1
1PumpConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1
1sfc*sqcap-flatSFC

Similar boards

  • 2 layers95.1 × 72.1 mm4004MainBoard, the printed circuit board in 3D

    4004MainBoard

    novi/4004MainBoard

    Intel 4004 Single Board Computer (KiCad project)

    162 parts4CC-BY-4.0
  • 2 layers20.3 × 38.7 mmSupply, the printed circuit board in 3D

    Supply

    cellularmitosis/lt1763

    A low-noise supply based on the LT1763.

    14 parts1MIT
  • 4 layers159.5 × 120 mmMStereo2, the printed circuit board in 3D

    MStereo2

    mgosselin/mStereo2

    a two-channel fully-differential digital-to-analog converter

    125 parts1
  • 4 layers160 × 100 mmLNA v1, the printed circuit board in 3D

    LNA v1

    Verdefluox/Eurocard_LNA

    A general purpose AC/DC low noise preamplifier on Eurocard format PCB

    178 partsMIT
  • 2 layers75 × 50 mmAFSK Prototype, the printed circuit board in 3D

    AFSK Prototype

    dolson14/k7arx

    Circuit and PCB Designs, anything else related to radio and electronics

    64 parts
  • 4 layers122.2 × 115.1 mmScan controller kicad, the printed circuit board in 3D

    Scan controller kicad

    fwachsmuth/Filmkorn-Raw-Scanner

    The Filmkorn Raw Scanner, turning 8mm and 16mm films into lossless 12-bit CinemaDNG

    170 parts13MIT
  • 4 layers67.5 × 96.5 mmNew Flight Controller, the printed circuit board in 3D

    New Flight Controller

    chanmeletio/Astro_Avionics

    Astro at Baylor HPR Avionics Software

    139 partsMIT
  • 4 layers63.2 × 183.1 mmNeflow, the printed circuit board in 3D

    Neflow

    DrNotThatEvil/neflow

    Not Evils Reflow Oven (neflow

    63 parts

Questions

How big is the PlantWatering PCB?

It measures 30.5 × 119.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PlantWatering use?

19 parts, built around the ESP-12E, LT1763CDE, 1N4148W and IRLML2502. 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 PlantWatering KiCad files?

From the MadsBornebusch/PlantFriends repository on GitHub, at the commit this page was made from: the board is pcb/PlantWatering.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the PlantWatering design in my own project?

Its repository publishes it under the GPL-3.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).