Embadded Project
Embadded Project
8051 MICROCONTROLLER
Abstract: In contemporary times, the issue of gas leakage poses a significant threat to both
industrial establishments and residential settings. This research aims to address this concern by
developing a system that promptly notifies gas plant supervisors or homeowners about detected gas
leaks. Simultaneously, the system sends an SMS notification to the designated individual. The
significance of this paper is heightened in the current pandemic scenario, wherein industries grapple
with a shortage of workers due to social distancing protocols. The proposed system serves as a
crucial tool to keep supervisors informed about potential hazards at industrial sites, mitigating risks
even in the absence of sufficient on-site personnel.
I.OBJECTIVE
The objective of the described experiment is to develop a Gas Leakage Detection System with a focus
on notifying supervisors in industrial plants or homeowners about gas leaks. The key goals and
objectives can be summarized as follows:
Early Detection of Gas Leakage: The primary aim is to design a system capable of promptly detecting
the presence of gas leaks in both industrial and household environments.
Notification Mechanism: Implement a notification mechanism that informs the supervisor of a gas
plant or the homeowner about the detected gas leakage. This may involve visual indicators, audible
alarms.
Simulation in Proteus Software: The outcomes of the experiment are simulated using Proteus
software. This allows for a virtual representation of the system's functionality, helping to validate its
performance and identify potential areas for improvement.
By achieving these objectives, the experiment seeks to develop a reliable and timely gas leakage
detection system that not only addresses immediate safety concerns but also considers the specific
challenges posed by the current pandemic situation.
Real-time monitoring and data display are facilitated by connecting a 16x2 LCD display to the
microcontroller. This allows users to observe the warning after gas leakage. The microcontroller
processes the sensor data, compares it with predefined values, and controls the activation of
both visual and auditory indicators accordingly. The 8051 microcontroller is programmed to
manage the entire operation. The program includes algorithms for gas concentration threshold
comparison, alarm triggering, and interfacing with the display units. A stable power supply, often
provided by a regulated DC power source or battery, ensures uninterrupted functioning of the
system
V. COMPONENTS DESCRIPTION
8051 TRAINER KIT
This 8051-trainer kit is proposed to smooth the progress of learning and developing designs of MCU
from Intel and NXP. This 8051 Trainer kit could act as a standalone unit, the kit can be programmed
and evaluated without using PC. This 8051 Trainer kit has an option to connect PC’s 101/104
Keyboard, to enter user programs in Assembly languages. Serial communication achieved using 8051.
It also supports C & assembly language using PC
ATMEL 8051 Quick Starter Development Board with AT89S52, MAX232, On-board Alphanumeric
16x2 LCD display, DS1307 RTC
On-board 5V Power supply voltage regulator. On-board 16x2 LCD display contrast adjustment On-
board alphanumeric 16x2 LCD display On-board DS1307 RTC|Port expander Reset button|8 LEDs to
indicate pins logic state|RS-232 communication connector.
Gas Sensor (MQ Series-6)
Gas Sensor: A sensor with high sensitivity to propane, iso-butane, and smoke. Examples include
MQ series gas sensors. We are using mq-6 which detect iso butane and LPG.
Light Emitting Diodes (LEDs) are semiconductor devices that emit light when an electric current is
applied to them. LEDs have become widely popular due to their energy efficiency, long lifespan,
and versatility. Here are some key features and information about LEDs
JUMPER WIRES
Jumper wires are short wires with connectors at each end, often used to create temporary
connections between various electronic components on a breadboard or in a circuit. They are an
essential tool for prototyping, testing, and building electronic projects. Jumper wires can have
various terminations, including male-to-male, male-to-female, and female-to-female connectors,
depending on the specific application.
BLOCK DIGRAM
In Figure 2, the process flow of the Gas Detection System is clearly Illustrated, Initially the Modules
(LCD, LED, MQ6 gas Sensor) will be initialized after Initialization of modules the output of Gas sensor
is taken as Input by 8051 (Digital input) and checked with the condition given in Table 1.
LCD
If sensor detect leakage LCD will display “WARNING”.
Led will glow if senor is
If sensor detect NO leakage LCD will display Nothing. 0(active low)
LED
8051 MC MQ-6
GAS SENSOR
Table 1
1
0
ALGORITHM USED
ORG 0000H
JMP START
ORG 0100H
START:
MOV P3, #0FFH ; Initialize Port 3 with 0xFF
MOV R3, #23 ; Initialize R3 with 23
Here1:
MOV R2, #255 ; Initialize R2 with 255
Here2:
MOV R1, #255 ; Initialize R1 with 255
Here:
DJNZ R1, Here ; Decrement R1 and jump if not zero
DJNZ R2, Here2 ; Decrement R2 and jump if not zero
DJNZ R3, Here1 ; Decrement R3 and jump if not zero
LOOP:
MOV A, P3 ; Move the value of Port 3 to accumulator A
CJNE A, #0FEH, LOOP ; Compare A with 0xFE and jump to LOOP if not equal
CJNE A, #0FFH, DETECT ; Compare A with 0xFF and jump to DETECT if not equal
DETECT:
CLR P3.1 ; Clear bit P3.1
SETB P0.0 ; Set bit P0.0
MOV DPTR, #STR ; Load DPTR with the address of the string STR
REV:
MOV A, #00H ; Load A with 00H
MOVC A, @A+DPTR ; Move code from the code memory to A using DPTR as a pointer
JZ FINISH ; Jump to FINISH if A is zero
ACALL L_D ; Call subroutine L_D
INC DPTR ; Increment DPTR
SJMP REV ; Jump to REV
FINISH:
SJMP FINISH ; Jump to FINISH
com:
ACALL DEL_ROUTINE ; Call subroutine DEL_ROUTINE
MOV P1, A ; Move the value of A to Port 1
CLR P2.1 ; Clear bit P2.1
SETB P2.2 ; Set bit P2.2
CLR P2.2 ; Clear bit P2.2
RET ; Return from subroutine
L_D:
ACALL DEL_ROUTINE ; Call subroutine DEL_ROUTINE
MOV P1, A ; Move the value of A to Port 1
SETB P2.1 ; Set bit P2.1
SETB P2.2 ; Set bit P2.2
CLR P2.2 ; Clear bit P2.2
RET ; Return from subroutine
DEL_ROUTINE:
MOV R0, #0FFH ; Initialize R0 with 0xFF
L1:
MOV R1, #0FFH ; Initialize R1 with 0xFF
L2:
DJNZ R1, L2 ; Decrement R1 and jump if not zero
DJNZ R0, L1 ; Decrement R0 and jump if not zero
RET ; Return from subroutine
STR:
DB 'Warning Warning', 0 ; Define a string "Warning Warning"
END
The program starts with the origin (ORG) set at 0000H. It then jumps to the START label.
Port 3 (P3) is initialized with 0xFF, and registers R3, R2, and R1 are initialized with values.
There are nested loops labelled Here1, Here2, and Here, utilizing DJNZ (Decrement and Jump if Not
Zero) instructions.
Loop and Detection:
The LOOP section reads the value of Port 3 (A), and if A is 0xFE or 0xFF, it jumps to the DETECT
section.
In DETECT, specific actions are taken, including clearing a bit in Port 3 (P3.1), setting P0.0, and
executing subroutines (com, L_D).
Subroutines:
The com subroutine handles some port manipulations and calls DEL_ROUTINE.
L_D subroutine is called with additional port manipulations.
DEL_ROUTINE:
DEL_ROUTINE initializes two registers (R0 and R1) and uses nested loops to create a delay. This is a
common method for introducing delays in microcontroller programming.
String Manipulation:
The program then loads a string "Warning Warning" from the code memory, character by character,
and performs actions based on the characters.
Subroutine Calls and Jumps:
ISSUES FACED
LCD Interfacing Challenges:
Interfacing an LCD display can indeed be challenging, especially when coordinating it with
LED indicators. Proper code placement and synchronization are key factors for a seamless
integration.
Buzzer Voltage Compatibility:
The challenge with the buzzer's operating voltage showcases the importance of verifying
component compatibility. Adapting your system to accommodate the 12V buzzer limitation
and recognizing the need for a relay demonstrates resourcefulness in overcoming hardware
constraints.
Understanding Sensor Specifications:
The importance of thoroughly reading and understanding the datasheet cannot be
overstated. In our case, the active-low signal from the MQ-6 sensor was a critical detail that
impacted our code.
PRACTICAL APPLICATIONS
Gas leakage detectors find critical applications across various industries and settings,
contributing significantly to safety protocols and accident prevention. In industrial
environments, such detectors are indispensable, especially in chemical plants and refineries
where the potential release of hazardous gases poses serious risks. In the mining industry,
gas detectors are crucial for monitoring the presence of gases like methane, mitigating the
danger of explosions in underground spaces.
Gas detectors can be installed in commercial buildings to monitor for leaks of natural gas,
propane, or other combustible gases, helping to prevent accidents and ensure the safety of
occupants. Gas detectors are commonly used in laboratories to monitor for leaks or the
presence of toxic gases, ensuring the safety of personnel and preventing accidents. In food
processing plants, gas detectors are used to monitor for the presence of gases released
during fermentation or other processes.
CONCLUSION
The theme of the project when merged with certain established embedded technologies can
be quite effective in several industries which possess a large working population in their
manufacturing industries. Finally, we conclude in recent households and industries the use
of LPG is taking a big troll. From the use of cylinders to the use of petroleum pipelines in
industries. The biggest threat in using this technology is security. And our prototype will
prove to be a blessing for numerous production sectors.
A wide variety of gas leakage detections are available in the real time for surety
implementation but all these methods come up with their own advantages and
disadvantages. A wide variety of gas leakage detections are available in the real time for
surety implementation but all this method comes up with their own advantages and
disadvantages. Most are system are operational in external implementation through visual
detection or portable based leakage detection but the detection time is very long. But the
design that we have proposed using 8051 proved reliable, accurate as well as delay efficient
in terms of detection, which will be a suitable choice for real time implementation.