What is humidity sensor arduino

Funduino - Kits and Instructions for Arduino

Material: NodeMCU, humidity sensor, jumper cable (material procurement: www.funduinoshop.com)

A moisture sensor can be used to measure moisture. However, this refers to the moisture that is directly next to it, such as skin moisture or soil moisture, but not of air moisture. It can be used, for example, to measure the moisture in the soil of plants. In the event of drought, an alarm signal could then sound, or an electric water pump could automatically supply the plant with water. The sensor is also suitable for measuring the water level in the area of ​​the sensor. The way it works is simple. There is voltage at the two contacts of the sensor. The higher the humidity between the two contacts, the better the current can flow from one contact to the other. This value is processed electronically in the sensor and transmitted to an analog input on the board in the form of an analog signal. Since the board, as already described in the previous tutorials, cannot measure any electrical voltage as such, it converts the voltage applied to the analog pin into a numerical value. 0 to 5 volts corresponds to a numerical value from 0 to 1023 (that is 1024 numbers, since zero is counted as the first numerical value).

In the case of the humidity sensor, however, the upper limit is approximately the numerical value 800 when the sensor is completely immersed in the water. However, the exact calibration depends on the sensor and the type of liquid / moisture that is being measured (e.g. salt water has better conductivity and the value would be correspondingly higher).

Note on measurements:
Due to the electrolysis by the water or the humidity at the sensors, we recommend not to take the measurements every second. Based on experience with tests directly in the water, we recommend an interval of 15 minutes between each measurement. With measurements in the seconds range, with direct and continuous water contact, the electrolysis causes damage to the sensor after approx. 24 hours.

Programming is very simple and is very similar to reading out potentiometers, as only an analog value is read out.

intmesswert = 0; // The measured value of the sensor will later be saved under the variable "measured value". voidsetup () {//// Setup begins here.Serial.begin (9600); // Communication with the serial port is started. You need this to display the read value in the serial monitor.} Voidloop () {// The main part begins here measured value = analogRead (A0); // The voltage at the sensor is read out and under the variable "measured value" saved.Serial.print ("moisture measured value:"); // output on the serial monitor: the word "moisture measured value:" Serial.println (measured value); // and then the actual measured value.delay (500); // at the end a little pause so that too many numerical values ​​don't rush over the serial monitor.}