Devices & Components
Arduino Uno Rev3
Gravity: Analog Soil Moisture Sensor For Arduino
NodeMCU ESP8266 Breakout Board
Hardware & Tools
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Software & Tools
Arduino IDE
Project description
Code
Soil Moisture
arduino
1#define SensorPin A0 2int sensorValue = 0; 3void setup() { 4 Serial.begin(115200); 5} 6void loop() { 7 for (int i = 0; i <= 100; i++) 8 { 9 sensorValue = sensorValue + analogRead(SensorPin); 10 delay(1); 11 } 12 sensorValue = sensorValue/100.0; 13 Serial.println(sensorValue); 14 Serial.print("%"); 15 delay(1000); 16} 17 18
Serial Communication Between Arduino & Nodemcu
arduino
1void setup() { 2 Serial.begin(115200); 3 while (!Serial) { 4 ; 5 } 6} 7 8void loop() { 9 if (Serial.available()) { 10 Serial.write(Serial.read()); 11 } 12} 13
Serial Communication Between Arduino & Nodemcu
arduino
1void setup() { 2 Serial.begin(115200); 3 while (!Serial) { 4 ; 5 } 6} 7 8void loop() { 9 if (Serial.available()) { 10 Serial.write(Serial.read()); 11 } 12} 13
Soil Moisture
arduino
1#define SensorPin A0 2int sensorValue = 0; 3void setup() { 4 Serial.begin(115200); 5} 6void loop() { 7 for (int i = 0; i <= 100; i++) 8 { 9 sensorValue = sensorValue + analogRead(SensorPin); 10 delay(1); 11 } 12 sensorValue = sensorValue/100.0; 13 Serial.println(sensorValue); 14 Serial.print("%"); 15 delay(1000); 16} 17 18
Downloadable files
Serial Monitoring of Soil Moisture Data
Serial Monitoring of Soil Moisture Data
Connections
Between Arduino & LM393 : Arduino 5V- LM393 VCC Arduino GND - LM393 GND Arduino A0 - LM393 A0 ( analog pins) Between LM393 & Soil Moisture Sensor : LM393( +) - Soil Moisture Sensor( +) LM393 (-) - Soil Moisture (-) Betweeen NodeMcu & Arduino : NodeMcu Gnd - Arduino Gnd NodeMcu TX - Arduino Rx NodeMcu RX - Arduino TX
Connections

Serial Monitoring of Soil Moisture Data
Serial Monitoring of Soil Moisture Data
Documentation
Components Required
Components Required

Components Required
Components Required

Comments
Only logged in users can leave comments