Objectives
- Interface soil moisture sensor with NodeMCU
- View the sensor readings of the soil moisture sensor
Things
- NodeMCU board (quantity: 1 no.)
- Micro USB cable A to B (quantity: 1 no.)
- Breadboard (quantity: 1 no.)
- Soil moisture sensor (quantity: 1 no.)
- Jumper wire – male to female (quantity: 3 no.)
- Arduino IDE on your computer
Let’s begin!
The soil moisture sensor consists of two parts.
- Probe
- Board
The probe consists of two long electrodes which will be dipped into the soil to check the moisture. The board takes readings from both electrodes and compares the voltages to check the amount of moisture present in the soil.
The analog output of the board gives a measure of the moisture level. The board also has a digital output which gives a HIGH signal if the moisture level is above a certain threshold and a LOW signal if the moisture is below the threshold. The threshold can be set by changing the value of the potentiometer present on the board.
Interfacing soil moisture sensor with NodeMCU
Interfacing soil moisture sensor with NodeMCU
Final Code
To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.
0 responses on "Interface soil moisture sensor with NodeMCU"