Exp 5 IOT Merged
Exp 5 IOT Merged
1. Aim:
To Design a weather station by checking Air quality of an environment with the help of IoT.
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. Hardware Required:
1. Arduino Uno R3
2. MQ 135 Air Quality Sensor Module
3. Male to Female Jumper Wire
4. Software: Arduino IDE
4. Introduction:
The MQ-135 air quality sensor is a versatile device used for detecting a range of gases in the
environment, including ammonia (NH3), nitrogen oxides (NOx), alcohol, benzene, smoke, and carbon
dioxide (CO2). The sensor provides an analog output that corresponds to the concentration of these
gases in the air. This output can be read by a microcontroller, like an Arduino, to assess air quality.
If the sensor readings stay within the normal range, the air quality can be considered safe. However, if
the readings rise significantly, it suggests the presence of potentially harmful substances, and
appropriate actions should be taken to ensure safety. This makes the MQ-135 sensor a useful tool for
monitoring air quality in various settings.
5. Procedure:
o VCC to 5V: Connect the MQ-135 VCC pin to the Arduino 5V pin to power the sensor.
o GND to GND: Connect the MQ-135 GND pin to the Arduino GND pin for a common ground.
o AO to A0: Connect the MQ-135 AO (Analog Output) pin to the Arduino analog pin A0 to
read analog sensor values.
o DO to Pin 2: Connect the MQ-135 DO (Digital Output) pin to Arduino digital pin 2 to use
the digital output if needed.
o Common Ground: Ensure that both the MQ-135 sensor and Arduino share a common
ground connection.
o Follow the Diagram: Refer to the connection diagram for accurate wiring between the MQ-
135 module and Arduino.
6. Implementation:
int sensorValue;
int digitalValue;
void setup()
{
Serial.begin(9600); // sets the serial port to
9600 pinMode(13, OUTPUT);
pinMode(2, INPUT);
}
void loop()
{
sensorValue = analogRead(0); // read analog input pin
0 digitalValue = digitalRead(2);
if (sensorValue > 400)
{
digitalWrite(13, HIGH);
}
else
digitalWrite(13, LOW);
Serial.println(sensorValue, DEC); // prints the value
read Serial.println(digitalValue, DEC);
delay(1000); // wait 100ms for next reading
}
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
Circuit Diagram:
7. Learning Outcomes:
1. Aim:
To Design a weather station by checking Air quality of an environment with the help of IoT.
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. Hardware Required:
1. Arduino Uno R3
2. MQ 135 Air Quality Sensor Module
3. Male to Female Jumper Wire
4. Software: Arduino IDE
4. Introduction:
The MQ-135 air quality sensor is a versatile device used for detecting a range of gases in the
environment, including ammonia (NH3), nitrogen oxides (NOx), alcohol, benzene, smoke, and carbon
dioxide (CO2). The sensor provides an analog output that corresponds to the concentration of these
gases in the air. This output can be read by a microcontroller, like an Arduino, to assess air quality.
If the sensor readings stay within the normal range, the air quality can be considered safe. However, if
the readings rise significantly, it suggests the presence of potentially harmful substances, and
appropriate actions should be taken to ensure safety. This makes the MQ-135 sensor a useful tool for
monitoring air quality in various settings.
5. Procedure:
o VCC to 5V: Connect the MQ-135 VCC pin to the Arduino 5V pin to power the sensor.
o GND to GND: Connect the MQ-135 GND pin to the Arduino GND pin for a common ground.
o AO to A0: Connect the MQ-135 AO (Analog Output) pin to the Arduino analog pin A0 to
read analog sensor values.
o DO to Pin 2: Connect the MQ-135 DO (Digital Output) pin to Arduino digital pin 2 to use
the digital output if needed.
o Common Ground: Ensure that both the MQ-135 sensor and Arduino share a common
ground connection.
o Follow the Diagram: Refer to the connection diagram for accurate wiring between the MQ-
135 module and Arduino.
6. Implementation:
int sensorValue;
int digitalValue;
void setup()
{
Serial.begin(9600); // sets the serial port to
9600 pinMode(13, OUTPUT);
pinMode(2, INPUT);
}
void loop()
{
sensorValue = analogRead(0); // read analog input pin
0 digitalValue = digitalRead(2);
if (sensorValue > 400)
{
digitalWrite(13, HIGH);
}
else
digitalWrite(13, LOW);
Serial.println(sensorValue, DEC); // prints the value
read Serial.println(digitalValue, DEC);
delay(1000); // wait 100ms for next reading
}
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
Circuit Diagram:
7. Learning Outcomes:
1. Aim:
To Design a weather station by checking Air quality of an environment with the help of IoT.
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. Hardware Required:
1. Arduino Uno R3
2. MQ 135 Air Quality Sensor Module
3. Male to Female Jumper Wire
4. Software: Arduino IDE
4. Introduction:
The MQ-135 air quality sensor is a versatile device used for detecting a range of gases in the
environment, including ammonia (NH3), nitrogen oxides (NOx), alcohol, benzene, smoke, and carbon
dioxide (CO2). The sensor provides an analog output that corresponds to the concentration of these
gases in the air. This output can be read by a microcontroller, like an Arduino, to assess air quality.
If the sensor readings stay within the normal range, the air quality can be considered safe. However, if
the readings rise significantly, it suggests the presence of potentially harmful substances, and
appropriate actions should be taken to ensure safety. This makes the MQ-135 sensor a useful tool for
monitoring air quality in various settings.
5. Procedure:
o VCC to 5V: Connect the MQ-135 VCC pin to the Arduino 5V pin to power the sensor.
o GND to GND: Connect the MQ-135 GND pin to the Arduino GND pin for a common ground.
o AO to A0: Connect the MQ-135 AO (Analog Output) pin to the Arduino analog pin A0 to
read analog sensor values.
o DO to Pin 2: Connect the MQ-135 DO (Digital Output) pin to Arduino digital pin 2 to use
the digital output if needed.
o Common Ground: Ensure that both the MQ-135 sensor and Arduino share a common
ground connection.
o Follow the Diagram: Refer to the connection diagram for accurate wiring between the MQ-
135 module and Arduino.
6. Implementation:
int sensorValue;
int digitalValue;
void setup()
{
Serial.begin(9600); // sets the serial port to
9600 pinMode(13, OUTPUT);
pinMode(2, INPUT);
}
void loop()
{
sensorValue = analogRead(0); // read analog input pin
0 digitalValue = digitalRead(2);
if (sensorValue > 400)
{
digitalWrite(13, HIGH);
}
else
digitalWrite(13, LOW);
Serial.println(sensorValue, DEC); // prints the value
read Serial.println(digitalValue, DEC);
delay(1000); // wait 100ms for next reading
}
DEPARTMENT OF
COMPUTER SCIENCE &
ENGINEERING
Circuit Diagram:
7. Learning Outcomes: