Iot 9
Iot 9
Experiment - 9
Student Name: Devesh UID: 22BCS16690
Branch: BE CSE Section/Group: 625-B
Semester: 5 Date of Performance:14/10/24
Subject Name: IOT LAB Subject Code: 22CSP-314
1. Aim: Case study of Agriculture 4.0 using IoT and to develop an IoT model for the
agriculture sector.
2. Objective:
1. To learn about the use of IoT in farming sector.
2. Learn about IoT programming
3. Input/Equipment Used:
• Arduino Uno
• Soil Moisture Sensor
• Jumper Wires
• Breadboard
• USB Cable
4. Theory:
Soil Moisture Sensor: A soil moisture sensor measures the volumetric water content in
soil. It’s commonly used in agriculture, gardening, and environmental monitoring to
ensure optimal soil conditions for plant growth. Soil moisture sensors typically measure
the soil’s electrical resistance, dielectric constant, or interaction with neutrons to
estimate moisture content. The sensor has two probes that are inserted into the soil. The
moisture level is determined based on the resistance between these probes, which
changes with the amount of water in the soil.
5. Procedure:
• Connect the Soil Moisture Sensor:
Soil moisture sensors measure the volumetric water content in soil. They typically consist of two
probes that allow the current to pass through the soil. More water in the soil results in lower resistance
and higher conductivity between the probes.
Troubleshooting:
No Sensor Readings: Check all connections and ensure the sensor is properly connected to the
Arduino. Inconsistent Readings: Ensure the sensor probes are clean and fully inserted into the soil.
Extensions: Integrate an LCD to display moisture levels.
Connect a relay module to automate an irrigation system based on moisture levels.
Use data logging to record moisture levels over time for analysis.
6. Code:
int sensorPin = A0; // Soil moisture sensor connected to A0
int ledPin = 13; // LED connected to digital pin 13
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
void loop() {
int sensorValue = analogRead(sensorPin); // Read the sensor value
Serial.print("Soil Moisture: ");
Serial.println(sensorValue);
if (sensorValue < 300) { // Threshold value for dry soil
digitalWrite(ledPin, HIGH); // Turn on LED
7. Output:
8. Learning Outcomes:
• Learnt about the iot in farming sector.
• Learnt how to connect equipment to Iot to make smart device for
agriculture.
• Understand how it can be applied to automate irrigation systems in
agriculture.
• Learn about soil moisture sensor with an Arduino board, measured soil
moisture levels, and interpreted the sensor readings.