กลับไปหน้ารวมไฟล์
how-to-create-your-very-own-soil-moisture-sensor-e218e8-en.md

Dying houseplants are a thing of the past with this soil moisture sensor hack.

In this guide, we’ll show you how to create a very simple moisture sensor for measuring soil moisture content. This can be used to monitor real-time volumetric water content in your houseplant soil so you know when to water it to keep it at the optimum moisture level.

This soil moisture sensor uses the Ynvisble Display Kit and Arduino Nano.

Read on to learn how to do it yourself.

CONNECTING THE COMPONENTS

Follow these simple steps to build your own soil moisture sensor:

1. Connect the Arduino to the breadboard

2. Connect the Ynvisible driver to the breadboard by using the 4 pin 90° IDC adapter

3. Connect the bar display to the driver (The leftmost display electrode must be connected to the leftmost electrode in the connector).

4. Connect the DFROBOT Capacitive Soil Moisture Sensor V1.0 to the breadboard by using the 3 pin 90° IDC adapter

5. Connections that need to be made using jumper wires:

  • 5V from Arduino to VCC on the driver and to + on the moisture sensor
  • GND from Arduino to GND on the driver and to – on the moisture sensor
  • SDA from the driver to pin A4 on the Arduino
  • SCL from the driver to pin A5 to the Arduino
  • Pin A from the sensor to pin A2 on the Arduino
  • Connect the Power supply + to the Arduino VI pin and the – to the GND

PROGRAMMING THE ARDUINO

Follow these steps to program the Arduino for your soil moisture sensor:

ADD THE LIBRARY TO THE ARDUINO IDE

  • Install and open ArduinoIDE
  • Download Arduino Library for the driver 4.2, Ynvisible_Driver_4.2-1.0.0 (download here)
  • Click "Sketch"/"Include Library"/"Add.ZIP Library..." in the main menu
  • Go to your downloads folder and choose Ynvisible_Driver_4.2-1.0.0.zip

UPLOAD THE CODE TO ARDUINO

  • Connect the Arduino to your computer with a USB cable
  • Create a new file in the Arduino IDE
  • Replace the code in the editor with the code below
  • Click "upload" (the right arrow on the upper left in the Arduino IDE)
  • Congratulations you now have a functional moisture sensor. You can now add your soil sensor to your plant to begin monitoring the water content of the soil - and how happy it is!

FEEL FREE TO CHANGE THINGS UP

Now you have your own soil moisture sensor, you have everything at your fingertips to start exploring the code and making changes to the hardware to turn your ideas into prototypes.

You could try switching up the display from the Ynvisible Display kit and change the moisture sensor to a light sensor, for example. The sky is your limit.

Check out Ynvisible University for more inspiration and how-tos.

EXPANDED TECHNICAL DETAILS

DIY Probe Fabrication

Instead of buying a pre-made module, this project teaches the basics of resistive sensing.

  • Probe Construction: Uses two corrosion-resistant metal rods (like galvanized nails) acting as electrodes. When soil is wet, the resistance between them drops.
  • Voltage Divider: A 10kΩ resistor is paired with the soil probes to form a voltage divider. The Arduino measures the center voltage.

Firmware Logic

  • Sensitivity Tuning: Soil type varies, so the code contains a "Sensitivity" variable that the user can tune based on their specific soil and plant.
  • Buzzer/LED Alerts: Provides immediate feedback: a Green LED for "Thirsty" and a Red LED + Beep for "Critically Dry," ensuring the project remains functional and user-friendly for beginners.

ข้อมูล Frontmatter ดั้งเดิม

title: "How To Create Your Very Own Soil Moisture Sensor"
description: "Dying houseplants are a thing of the past with this soil moisture sensor hack."
author: "miltonfernandes"
category: ""
tags:
  - "ynvisible"
  - "environmental sensing"
  - "energy efficiency"
  - "home automation"
  - "greener planet"
  - "plants"
  - "monitoring"
  - "garden"
views: 3505
likes: 0
price: 1120
difficulty: "Easy"
components:
  - "1x Ynvisible Segmented Display Kit"
  - "1x Gravity: Analog Capacitive Soil Moisture Sensor- Corrosion Resistant"
  - "1x Arduino Nano R3"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "e5b71d2a641a93c6a93ae3793a0bad43b450b2e06e68aa18b4ff09a3201ee16d"
encryptedPayload: "U2FsdGVkX19FcgwLGCLwS2cTEPia9N841mJRk/6CqdME6R3HAWGmRMV9q3yGxyYLmeLu8i89Yzz/Ek6HWVQLDE2dOHl1hTtIwb/N3A5ACgU="
seoDescription: "Build your own Soil Moisture Sensor for indoor plants. Prevent dying houseplants with this easy Arduino project hack."
videoLinks:
  - "https://www.youtube.com/embed/hxRV4p_sEpY"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/how-to-create-your-very-own-soil-moisture-sensor-e218e8_cover.jpg"
lang: "en"