CHAPTER IV
METHODOLOGY
This chapter explains the intended research strategy that the researchers planned in order
to achieve the research objectives.
Research Design
AGILE Methodology
Agile methodology is an interactive and flexible approach to software development that
emphasizes collaboration, customer satisfaction, and continuous improvement. It is a set of
principles and values for software development that prioritize delivering working software
frequently, responding to change quickly, and focusing on the needs of the customer. Agile
methodology has become widely adopted in various industries, not just limited to software
development. Its iterative and customer-centric approach enables organization to deliver valuable
products or solutions in a more efficient and adaptive manner.
Agile Methodology
Figure 4. Agile Methodology Diagram
Phase 1: Planning
In the planning phase of the Agile methodology for the SMART AMMONIA MONITORING
AND ODOR CONTROL SYSTEM FOR PIGGERIES USING IoT, several important steps were
identified to establish the project scope and objectives:
Identify stakeholders, including piggery owners, farm workers, researchers, and future
system users. Gather their requirements through interviews and consultations.
Identify the hardware and software requirements, including ammonia sensors, ESP32
microcontroller, exhaust fans, misting/deodorizing system, Wi-Fi module, and IoT
dashboard.
Assess project constraints such as budget, internet connectivity, power availability, and
environmental conditions inside piggery facilities.
Prepare the project timeline, sprint schedules, and task allocation for the development
team.
Phase 2: Design
In the design phase, the researchers created the system architecture and blueprint of the proposed
project:
Design the wiring and circuit layout for ammonia sensors, ESP32 controller, relays, fans,
pumps, and odor control devices.
Develop the user interface for monitoring ammonia concentration, temperature, humidity,
and device status through mobile or web dashboard.
Plan the communication flow between sensors, controller, cloud database, and user
notifications.
Design enclosure and placement of sensors for accurate gas detection inside piggery
areas.
Phase 3: Build
During the build phase, the researchers converted the design into a functional prototype system:
Assemble all hardware components including MQ ammonia sensor, ESP32, relays,
exhaust fan, water pump, and alarm system.
Develop the program code for sensor reading, threshold detection, and IoT data
transmission.
Build the dashboard for real-time monitoring and remote access.
Integrate Wi-Fi communication for sending notifications and storing sensor data online.
Conduct initial hardware installation and verify circuit connections.
Phase 4: Test
In the testing phase, the developed system was evaluated to ensure functionality and reliability:
Test the accuracy of ammonia sensor readings in detecting harmful gas concentration.
Verify automatic activation of alarms, and odor control system when ammonia levels
exceed safe limits.
Check response time of IoT notifications and dashboard updates.
Evaluate stability of wireless connectivity and sensor performance in actual piggery
conditions.
Phase 5: Review
In the review phase, the sprint outputs were presented for feedback and refinement:
Demonstrate the working prototype to advisers, evaluators, and piggery owners.
Gather feedback regarding usability, monitoring accuracy, and effectiveness of odor
reduction.
Review whether project objectives were achieved based on testing results.
Identify recommended improvements for the next sprint cycle.
Finalize system features before deployment.
Locale of the Study
The Project was conducted at Jhon Rey’s Farm, which was located at Purok 6, Dipangit
Jones, Isabela
Population of the Study
The main respondent of the project was Sir. Jhon Rey Nicolas, The owner of Jhon Rey’s
Farm.
Organizational Chart
Sir. Jhon Rey Nicolas
Farm Owner
Grace Nicolas
Farm Manager
Farm Staff 1 Farm Staff 2
Figure 5. The Organizational Chart of Jhon Rey’s Farm
Requirement Specification
Fishbone Diagram
A fishbone diagram is a visualization tool for categorizing the potential cause of the
problem. This tool is used in order to identify a problem’s root cause. Typically for root cause
analysis, a fish bone diagram combines the practice of brainstorming with a type of mind map
template.
Figure 6. The Fishbone diagram to show cause and effect in order to solve problems of the
project.
Compatibility Checking (hardware / software and other technologies)
The Researcher conducted compatibility checking for hardware and software from the
respondents to make sure that the recommended devices are suitable to be used for the
development of the project.
Existing Need Gap
Hardware
ESP32 -do-
MQ135 -do-
Jump wire -do-
Selector switch -do-
Solid State Relay -do-
Magnetic Contactor -do-
Laptop -do-
No Existing Hardware GL Pipe -do-
Elbow Connector -do-
Tee connector -do-
End Connector -do-
Relay Module -do-
Water Pump -do-
2hp Induction Motor -do-
Industrial wire -do-
Mobile Phone -do-
Software
Firebase -do-
Mobile Application -do-
Arduino IDE -do-
Network
Connectivity Mobile Network -do-
Table 1. The existing specification of the ESP32, the need and gap in for the development of the
project.
Schedule Feasibility
Gantt Chart
Figure 7. The project development timeline
Economic Feasibility
Cost and Benefits Analysis
Cost
Hardware Cost Specification Amount in Php
ESP32 Wi-Fi + Bluetooth, 38 Pins ₱750. 00
MQ135 Ammonia / Air Quality ₱200. 00
Sensor
Jump wire Assorted Set ₱250. 00
Selector switch 3 Position (Manual-OFF- ₱550. 00
Auto)
Solid State Relay 25A, 3–32VDC to 24– ₱450. 00
380VAC
Magnetic Contactor 220VAC Coil, 18A–25A ₱1, 400. 00
Laptop Intel i3/i5 Minimum ₱20, 000. 00
GL Pipe 1/2-inch x 3 meters ₱700. 00
Elbow Connector 1/2 inch ₱140. 00
Tee connector 1/2 inch ₱180. 00
End Connector 1/2 inch ₱80. 00
Relay Module 1 Channel 5V ₱150. 00
Water Pump 100 PSI Three cylinder ₱7 ,500. 00
2hp Induction Motor Single Phase 220VAC ₱8,500. 00
Industrial wire THHN 5.5mm² (20m) ₱1,200. 00
Mobile Phone HONOR X9A ₱16,000. 00
Table 2. The cost of each hardware needed in the development of the system
Software Cost Specification Amount in Php
Arduino Code Compiler Arduino IDE Freeware
Database System Firebase RTDB Freeware
Operating System Windows 11 ₱9, 050. 00
Table 3. The cost of each software needed in the development of the system
Development Cost Salary/month
Computer Programmer (Sch. 1) ₱15, 000. 00 ₱15, 000. 00
Electrician (Sch. 2) ₱10, 500. 00 ₱10, 500. 00
Software Depreciation (Sch. 3) ₱1, 500. 00 ₱1, 500. 00
Hardware Depreciation (Sch. 4) ₱2, 500. 00 ₱2, 500. 00
Electricity (Sch. 5) ₱2, 000. 00 ₱2, 000. 00
Total Hardware Cost ₱58, 050.00
Total Software Cost ₱9,050.00
Total Development Cost ₱31,500.00
TOTAL PROJECT COST ₱98,600.00
Table 4. The Cost of the development of the system
(Schedule 1)
Programmer’s Salary
(15,000.00/month) * 5months = Php 75, 000.00
(Schedule 2)
Electrician
(10,500.00/month) * 5months = Php 2,100.00
(Schedule 3)
Hardware Description
(Total Hardware Depreciation Cost/ estimated useful life) / 12 months * number of months
developed)
(58,050.00/5) / 12 *5= Php 4,837.5
(Schedule 4)
Software Depreciation
(Total Software Cost / estimated useful life)/ 12months * number of months developed)
(9,050.00/ 5) / 12 * 5 = Php 754.166
(Schedule 5)
Electricity
Prescribe cost/kwh under ISELCO 1 = 10.40 per kilowatt
1 unit
(90 watts/100watts) * 10.40 * 1 unit * 5hrs/day * 4days/weeks*4weeks/months * 5months
Php 374.40
Project Benefits
Tangible Benefits
Improved productivity
Reduced labor cost
Improved animal welfare
Intangible Benefits
Improved data collection
Enhanced decision making
Improved traceability
Increased sustainability
Functional Decomposition Diagram (FDD)
Figure 8. The functional decomposition of the developed project.
DATA AND PROCESS MODELING
Context Diagram
Context Diagram of the Proposed System
Figure 9. The context diagram of the system and its environment showing entities and
interactions
DATE FLOW DIAGRAM(DFD)
Data Flow Diagram (DFD) it will use by the researchers to graphically show the flow of the
data which was based on the conducted project. It is composed of the four basic symbols shown
below with their respective description.
NAME SYMBOLS DESCRIPTION
EXTERNAL They determine the system boundary that is
ENTITIES external to the developed system. They are
often beyond the are of influence of the
developer.
DATA They are genetic fir physical files, they can
STORE show two or more systems that share data.
PROCESS They show data transformation or change.
They have physical location shown only for
existing physical systems or presented by
physical design.
FLOW They are referenced by a combination id the
LINES identifiers of the developed system where the
data flow connects.
Table 5. The data flow diagram.
Level 1.0 User
Figure 10. The different process that the User an perform in the system.
Level 1.0 Explosion of process 1.1 – Manage Water Spray
Figure 11. Processes the User use to manage water spray.
Level 1.0 Explosion of process 1.2 – Manage Sensor Readings
Figure 12. Processes the User use to manage sensor readings and where it stores
Data Output and User Interface
Figure 13. The Sign Up page of the Mobile app.
Figure 14. The Log In page of the Mobile app.
Figure 15. The Main page of the Mobile app.
Data Design.
Entity-Relationship Diagram (ERD) is the graphical representation of the entities and
their relationship to each other, typically used in computing with regard to the organization of
data within the database or information system.
Figure 16. The entity-relationship of the tables to be used in the system.
Data Dictionary
Data dictionary was used to determine which data type will be best suited for the field.
Every field was checked to determine the length of the field to save some computer memory.
Name Length Data Type Description
Login_Form 10 int Primary key
Username 10 varchar Account name
Password 8 varchar Account password
Table 6. User
Name Length Data Type Description
Ammonia_Level 10 float Measured ammonia
concentration
Air_Quality 20 varchar Air quality status
Sensor_Status 15 varchar Sensor operational
status
Date_Time 30 datetime Date and time of
reading
Table 7. Sensor
System Architecture
Network Model
Figure 17. The Network Model Diagram
This above is a Three-tier network architecture with the presentation layer or interface that run
on a client, and a data layer or a data structure that gets stored on a server.
Star Topology
In a star network topology, devices like mobile phones and computers connect to a
central router, acting as a hub for communication. Data from these devices first goes to the
router, then to the Internet Service Provider (ISP) for internet access. The ISP directs the data to
the internet, enabling access to resources like databases. This setup ensures efficient
communication by linking all devices to a central point, enhancing data transfer within the
network.
Figure 18. The Star Topology diagram.
Development
Software Specification
Software Version
Arduino Programming Language Arduino IDE
Database System Google Firebase
Table 8. Software specification of the project.
Hardware Specification
ESP32 Dual-core 32-bit microcontroller, 240 MHz,
built-in Wi-Fi and Bluetooth, 3.3V operating
voltage
MQ135 Gas detection range: 10–1000 ppm, operating
voltage: 5V DC, detects ammonia and air
quality
Jump wire Male-to-male / male-to-female jumper wires,
20–30 cm length
Selector switch 3-position selector switch (Manual–Off–
Auto), rated 220V AC
Solid State Relay Input: 3–32V DC, Output: 24–380V AC, 25A
capacity
Magnetic Contactor 220V AC coil voltage, 10–18A rated current
Laptop Intel Core i3/i5 processor, 4GB RAM
minimum, Windows 10 or higher
GL Pipe 1/2 inch galvanized iron pipe for water
distribution
Elbow Connector 1/2 inch PVC/GI elbow fitting
Tee connector 1/2 inch PVC/GI tee fitting
End Connector 1/2 inch pipe end cap connector
Relay Module 5V relay module, single-channel, 10A rated
output
Water Pump High-pressure water pump, 220V AC
operation
2hp Induction Motor Single-phase induction motor, 220V AC, 2
horsepower
Industrial wire Copper wire, 2.0–3.5 mm² thickness,
insulated for 220V AC
Table 9. Hardware specification of the project.