See the reading. Understand the response.
The Sensor
Lab.
Calibrate a probe, record a trace and experiment with automatic greenhouse controls. Then follow a small plant-monitor build from wiring to code.
Turn a number into useful information
Calibrate the sensor.
Trust the process.
A raw probe reading is not a universal moisture percentage. Choose two measured reference readings in the same growing medium, then explore a relative index between them. The example values below are illustrative; a real sensor needs your own calibration.
Calibration workbench
The reading and the decision
Index = 100 × (raw − dry) ÷ (wet − dry)
This example requests water below 35 and clears the request at 45. That gap is hysteresis: it prevents rapid switching near a single threshold. A fault or invalid calibration blocks the request. These are teaching settings, not crop prescriptions.
How to collect a useful real-world calibration
- Choose the actual substrate and an insertion depth you can repeat. Keep the probe's electronics dry.
- Record a dry reference and a watered, drained reference. Do not assume air and a cup of water represent the growing medium.
- Take repeated readings and check consistency. Test more than one location in a large bed.
- Compare probe readings with plant response and direct observation. A relative index is not a laboratory soil-water measurement.
- Recheck after changing substrate, sensor, depth or growing conditions. Investigate unexpected readings before acting.
Try it before you build it
You change the conditions.
The system responds.
Move the sliders or choose a scenario. Follow the connection between a sensor reading, a decision and a physical action. These are simulated indoor readings and teaching rules—not a prediction of greenhouse temperatures or a crop-growing prescription.
Create a scenario
Greenhouse control room
Simulation · no equipment connectedHumidity control depends on outdoor air and dew point. In this demo, high humidity during cold conditions requests a human check instead of simply opening the vents.
Read temperature, moisture, humidity and light. Check that the readings are trustworthy.
Compare readings with crop-specific limits. Consider competing needs before switching equipment.
Use timed actions, limits and feedback. A real irrigation system needs pump protection, a maximum run time and leak detection.
Show the exact teaching rules used in this simulation
- Soil index below 35: request irrigation. A sensor fault blocks this request and raises an alert.
- Air above 28 °C: ventilate. Above 30 °C with daylight above 60%: deploy shade.
- Air below 12 °C: request backup heat. Ventilation and heat are never commanded together in this simplified demo.
- Humidity above 80%: ventilate when air is at least 16 °C; otherwise request a human check.
- Air below 5 °C or above 38 °C: raise a critical-temperature alert.
The moisture index is a relative teaching scale, not volumetric water content. Real settings depend on crops, substrate, calibration, outside conditions and equipment. The browser does not model heat flow, plant growth or water movement.
Make your first useful device
Build a plant monitor.
Understand every connection.
Start with a small, tangible part of the larger greenhouse: an ESP32 reads a moisture probe and a temperature/humidity sensor. An indicator lights when a measured condition needs attention. Learn to measure reliably before controlling pumps or heaters.
- Gather the parts.Use an original ESP32-WROOM-32 development board with GPIO34, GPIO27 and GPIO25 exposed, a 3.3 V compatible capacitive moisture sensor, a DHT22, a 10 kΩ resistor, a 330 Ω resistor, an LED, breadboard, jumpers and USB cable.
- Wire with power disconnected.Follow the table. Confirm the pin labels on your particular sensor. Keep all GPIO signals at 3.3 V or below and keep the board dry.
- Read raw values first.Install the ESP32 Arduino board package, Adafruit DHT sensor library and Adafruit Unified Sensor library. Upload the starter sketch and open Serial Monitor at 115200 baud.
- Calibrate with your growing medium.Record the probe reading at your selected dry reference and at fully watered, drained medium. Keep its electronics above the soil. Enter both measured values in the sketch and re-upload.
- Test the indicator and failures.Move the probe between reference conditions. Check the LED and logs. Disconnect a sensor to examine the response; a plausible but wrong reading can still escape simple checks.
Wiring: a monitor, one LED, no mains power
| Connection | Original ESP32 board |
|---|---|
| Moisture sensor VCC / GND | 3V3 / GND |
| Moisture sensor analog output | GPIO34 · maximum 3.3 V |
| DHT22 VCC / GND | 3V3 / GND |
| DHT22 DATA | GPIO27; 10 kΩ pull-up to 3V3 unless the module already provides one |
| DHT22 unused pin | Leave unconnected; verify sensor pinout |
| Indicator LED | GPIO25 through 330 Ω to LED anode; LED cathode to GND |
| Board supply | USB via the board's USB connector |
Pin assignments differ on ESP32-C3, S2, S3 and other boards. This sketch targets the original ESP32. Do not connect 5 V sensor outputs to its GPIO pins.
Read the starter code and calibration instructions
Enter your two measured calibration readings where the constants are −1. Until then, the sketch prints raw readings and keeps the alert LED on. The 35/45 index thresholds and 12/28 °C limits are teaching examples. Select suitable limits for your own plants. Hardware operation has not been tested.
Estimated parts budget: roughly CAD $35–$90, excluding a computer and shipping. This is a planning allowance, not a current supplier quotation. Reuse parts where possible.