Flame Detection Sensor

Flame Detection Sensor

Introduction

This experiment demonstrates the use of a capacitive soil moisture sensor to measure the moisture content of soil. It is useful for gardening and agriculture projects.

Capacitive Soil Moisture Sensor

Components Needed

Circuit Setup

  1. Connect the VCC pin of the soil moisture sensor to the 5V pin on the Arduino.
  2. Connect the GND pin to the GND pin on the Arduino.
  3. Connect the analog output pin of the sensor to an analog input pin (e.g., A0) on the Arduino.

Make sure to place the sensor in the soil to measure its moisture level accurately.

Soil Moisture Sensor Circuit Setup

Code for Soil Moisture Sensing

Upload the following code to your Arduino to read the soil moisture levels:


const int soilPin = A0; // Pin connected to the soil moisture sensor
void setup() {
  Serial.begin(9600); // Start serial communication
}

void loop() {
  int moistureValue = analogRead(soilPin); // Read the moisture value
  Serial.println(moistureValue); // Print the moisture value
  delay(1000); // Wait for a second before next reading
}
            

Explanation

The capacitive soil moisture sensor works by measuring the change in capacitance in the soil. The Arduino reads the analog value and outputs it to the serial monitor, indicating the soil's moisture level.

Troubleshooting