0% found this document useful (0 votes)
10 views3 pages

Arduino Humidity Sensor Guide

This document describes a moisture sensor for Arduino. The sensor measures the soil moisture content and can be used to automatically control irrigation. It easily connects to Arduino and provides analog readings that indicate whether the soil is dry, moist, or wet. The example code shows how to use the sensor to control an irrigation pump.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Arduino Humidity Sensor Guide

This document describes a moisture sensor for Arduino. The sensor measures the soil moisture content and can be used to automatically control irrigation. It easily connects to Arduino and provides analog readings that indicate whether the soil is dry, moist, or wet. The example code shows how to use the sensor to control an irrigation pump.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HUMIDITY SENSOR FOR ARDUINO

Humidity is a physical variable present in our environment and the element of the
the earth that provides this phenomenon is water. This occurs because it
impregnates any body even the steam that is present in the
atmosphere in the form of condensation. It is generated in clouds that are not
formed by water vapor but by ice.

Based on this, a mathematical relationship is established that determines a value.


percentage of soil moisture. It is supported by the following expression.

Initial sample
m2 = final sample heated in an oven and obtained 24 hours later

HUMIDITY SENSOR FOR ARDUINO TYPE FUNDUINO.


value = 0
Sensor on dry ground: 0 <value <300
Sensor in wet ground: 300 <value <700
Sensor in water: value ~ 700
Working with this sensor has its advantages. One of them is that it will no longer be
necessary to depend on an external signal conditioning stage with another
type of probes used by the conventional humidity sensor of Arduino. This
the sensor, unlike others, has three connection ports. The first is S that
goes to the analog input or to the A0 port of the Arduino, +V powered with 5
volts and which is basically ground. That's all. In the market, it has a price.
approximately 2 dollars (generally on shopping sites like aliexpress or
lightinthebox) the prices of these sensors vary in the stores of each country.
However, it is very easy to acquire and at a very low cost.

Circuit assembly
the source code is as follows.
int reading = 0; // Analog pin to which the sensor is connected
int pump = 2; //Pin to which the relay for activating the pump is connected
int sensor = 3; //Sensor power pin

void setup()
{
[Link](9600);
pinMode(pump, OUTPUT); // Set pin 2 PUMP as output.
pinMode(sensor, OUTPUT); // Sets pin 2 SENSOR as output.
}

void loop()
{
digitalWrite(sensor, HIGH); // Turn on sensor
reading = analogRead(A0);
[Link]("Humidity value:");
[Link](reading);
if (reading < 200 ) //start the reading:
if the sensor value is less than '200', then...
{
digitalWrite(pump, LOW); //... activate the pump - INVERTED LOGIC
}
else
{
digitalWrite(pump, HIGH); //...deactivates the pump - INVERTED LOGIC
}
digitalWrite(sensor, LOW); // Turns off sensor
delay(1000);

You might also like