Arun IoT 9
Arun IoT 9
1. Aim: Case studies of IoT in Healthcare and propose any IoT model for the healthcare
sector.
2. Objective: The objective of this experiment is to use the MQ-135 sensor to detect and
monitor the concentration of harmful gases in the air. By analyzing the sensor's analog
output, the experiment aims to assess air quality and identify potential contamination.
This helps in determining environmental safety and necessary precautions.
3. Input/Equipment Used: Arduino Uno board, Soil moisture sensor, Breadboard, Jumper
wires, USB cable for Arduino, Computer with Arduino IDE installed
4. Procedure:
Step 1: Setup the Arduino and Sensor
• Gather Components: Ensure you have all the necessary components.
• Connect the Soil Moisture Sensor to the Arduino:
• VCC (Power): Connect the VCC pin of the soil moisture sensor to the 5V pin on the
Arduino.
• GND (Ground): Connect the GND pin of the soil moisture sensor to a GND pin on
the Arduino.
• Analog Output (A0): Connect the A0 pin of the soil moisture sensor to an analog input
pin (e.g., A0) on the Arduino.
Step 2: Write the Arduino Code
• Open the Arduino IDE: Launch the Arduino IDE on your computer.
• Write the Code: Enter the following code into the Arduino IDE:
Step 3: Testing and Observation
• 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.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
• Wet Soil: Note the sensor value in wet soil.
• Record Data: Record the sensor values for different soil moisture levels.
Step 4: Analyzing the Data
• Interpret Sensor Values: Higher sensor values typically indicate lower moisture levels
(dry soil), while
• lower sensor values indicate higher moisture levels (wet soil).
• Calibrate if Necessary: Based on your observations, you might need to calibrate the
sensor readings for accurate moisture level interpretation.
5. 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);
}
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
6. Result