IOT-9 Kushu

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

Experiment 9
Student Name: Kushagra Bharti UID:22BCS10107
Branch: CSE Section/Group:605-A
Semester: 5th Date of Performance:22-10-24
Subject Name: IOT LAB Subject Code: 22CSP-329

1. Aim:
Case studies of IoT in Healthcare and propose any IoT model for the
healthcare sector
2. Objective:
The goal of this project is to assemble and control various actuators (LED,
motor, and buzzer) using an Arduino Uno. This project will involve
connecting the components to the Arduino and writing a program to control
their behavior, such as blinking the LED, turning the motor on and off, and
sounding the buzzer.
3. Input/Equipment Used:
1. Arduino Uno board
2. Soil moisture sensor
3. Breadboard
4. Jumper wires
5. USB cable for Arduino
6. Computer with Arduino IDE installed

4. Theory:
Soil moisture sensors measure the volumetric water content in soil. They
typically consist of two probes that allow the current to pass through the
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

soil. More water in the soil results in lower resistance and higher
conductivity between the probes.

5. Procedure:
• Setup the Arduino and Sensor
• Write the Arduino Code
• Upload the Code: Connect the Arduino to your computer using the USB
cable and upload the code to the Arduino board.
• Open Serial Monitor: After uploading the code, open the Serial Monitor
from the Arduino IDE (Tools > Serial Monitor) to see the sensor
readings.
• Take Readings: Observe the sensor values as you place the sensor in
different soil conditions: Dry Soil: Note the sensor value in dry soil.
• Wet Soil: Note the sensor value in wet soil. Record Data: Record the
sensor values for different soil moisture levels.
• Interpret Sensor Values: Higher sensor values typically indicate lower
moisture levels (dry soil), while lower sensor values indicate higher
moisture levels (wet soil).
Connections:
• Connect the VCC pin of the soil moisture sensor to the 5V pin on the
Arduino.
• Connect the GND pin of the soil moisture sensor to a GND pin on the
Arduino.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

• Connect the A0 pin of the soil moisture sensor to an analog input pin
(e.g., A0) on the Arduino.

6. Code:
// Define the pin connected to the soil moisture sensor
const int sensorPin = A0;
void setup()
{
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
}
void loop()
{
// Read the value from the soil moisture sensor
int sensorValue = analogRead(sensorPin);
// Print the sensor value to the serial monitor
Serial.print("Soil Moisture Value: ");
Serial.println(sensorValue);
// Wait for a second before taking another reading
delay(1000);
}
7. Result:

Output lga lena


DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

Figure 1: Output

8. Conclusions:

By completing this experiment, you have successfully interfaced a soil


moisture sensor with an Arduino board, measured soil moisture levels, and
interpreted the sensor readings. This knowledge can be applied to automate
irrigation systems in agriculture.

You might also like