Professional Documents
Culture Documents
Lab4 Labreport
Lab4 Labreport
LABORATORY ACTIVITY 4
OBJECTIVES
To simulate the system with a rain sensor, soil moisture sensor, gas sensor, and
LCD using Proteus, the process begins by adding the necessary components to the
Proteus workspace and interfacing them with a microcontroller. Code is then
developed to read sensor values and display information on the LCD using Arduino
IDE. After running the simulation to validate the system's behavior, the hardware
implementation follows. Gathering components like sensors, LCD, microcontroller,
and utilizing a breadboard, the circuit is set up to mirror the Proteus simulation.
EQUIPMENT/ APPARATUS
The equipment and apparatus utilized for this project include essential components
for environmental monitoring and data collection. The Proteus software serves as a
crucial tool for simulation and design and Arduino IDE for the programming. The
project incorporates specific sensors to measure key environmental parameters,
namely the FC-37 or YL-83 Rain Sensor for rainfall detection, the YL-69 or HL-69
Soil Moisture Sensor for monitoring soil moisture levels, and the MQ-2 Gas/Smoke
Sensor for detecting gas and smoke concentrations. These sensors are integrated
with an Arduino UNO microcontroller, facilitating data processing and
communication. The LCD display provides a user-friendly interface for real-time data
visualization. To establish the necessary connections, jumper wires and a
breadboard are employed, ensuring a reliable and organized setup for effective
environmental monitoring and sensor data analysis.
THEORY
electronic board and the collector board, which gathers water droplets.
This configuration is illustrated in figure below.
The MQ-2 smoke sensor exhibits sensitivity to both smoke and various
flammable gases, including LPG, butane, propane, methane, alcohol,
and hydrogen. The sensor's resistance varies based on the type of gas
present. Additionally, it is equipped with a built-in potentiometer,
enabling users to adjust the threshold of the sensor's digital output
(D0).
LABORATORY PROCEDURE
a. Schematic Diagram
Start
Initializing
Microcontroller
Yes
Yes
End
Figure 7: Flowchart
Caraga State University
College of Engineering and Geosciences
CEGS Building, CSU-Main Campus, Ampayon, Butuan City, Philippines Phone (+69 85) 341-3249
(+63 85) 342-3047
(+63 85) 341-2296
Competence Service Uprightness Email address: cegs@carsu.edu.ph
Nurturing Engineers of the Future URL: httpp://cegs.carsu.edu.ph/
Pin Connection
Arduino Pin Other Components
5V 5V
GND GND
A0 AO (Rain Sensor)
A1 AO (Soil Moisture Sensor)
A2 AO (Gas Sensor)
D2 D7 (LCD)
D3 D6 (LCD)
D4 D5 (LCD)
D5 D4 (LCD)
D6 Red LED1
D7 Speaker1
D9 Yellow LED
D10 Red LED2
D11 Speaker2
D12 E (LCD)
D13 RS (LED
lcd.setCursor(0, 0);
oid loop() { lcd.print("Moisture:");
int rainValue = lcd.print(Moisture);
analogRead(rainSensorPin); lcd.print("% ");
int soilMoistureValue = delay(1000);
analogRead(soilMoisturePin); lcd.clear();
int gasSensorValue =
analogRead(gasSensorPin); lcd.setCursor(0, 1);
lcd.print("Gas Value: ");
if (rainValue < 300) lcd.print(gasSensorValue);
{
lcd.clear(); if (gasSensorValue > 50) {
lcd.setCursor(0, 0);
lcd.print(" Rain Detected!"); lcd.clear();
delay(1000); lcd.setCursor(0, 0);
lcd.clear(); lcd.print("Gas Detected!");
delay(1000);
tone(buzzerPin1, 2000);
delay (100); tone(buzzerPin2, 2000);
digitalWrite(ledPin1, HIGH delay(100);
delay(100); digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin2, LOW); delay(100);
} digitalWrite(ledPin3, LOW);
else delay(50);
{ lcd.clear();
digitalWrite(ledPin1, LOW); lcd.setCursor(0, 1);
delay(100); lcd.print("Gas Value: ");
digitalWrite(ledPin2, HIGH); lcd.print(gasSensorValue);
noTone(buzzerPin1); } else {
delay(100); noTone(buzzerPin2); // Turn off
} buzzer
Moisture = map(soilMoistureValue, }
0, 1023, 100, 0); delay(1000);
lcd.clear();
Caraga State University
College of Engineering and Geosciences
CEGS Building, CSU-Main Campus, Ampayon, Butuan City, Philippines Phone (+69 85) 341-3249
(+63 85) 342-3047
(+63 85) 341-2296
Competence Service Uprightness Email address: cegs@carsu.edu.ph
Nurturing Engineers of the Future URL: httpp://cegs.carsu.edu.ph/
CONCLUSION
In summary, the multisensing circuit, incorporating Arduino and LCD, offers a versatile solution for
environmental monitoring. This project seamlessly integrates various sensors like rain, soil moisture,
and gas sensors with Arduino, showcased through simulation and hardware implementation. The LCD
interface facilitates real-time data visualization, enabling practical interpretation of environmental
conditions. This circuit not only enhances our understanding of sensor interfacing but also serves as a
foundation for automated systems in smart agriculture and safety monitoring. Bridging theoretical
concepts with real-world applications, it contributes to advancements in sensor-based technologies.
Combining soil, rain, and gas sensors creates a comprehensive environmental monitoring system,
offering valuable data for weather forecasting, pollution reduction, and agricultural optimization in a
concise and impactful manner.