All projects

Project 03 · Microcontrollers Course · Five-student Team · Spring 2025

Gas Detection System Using PIC16F877A

A Proteus simulation of a PIC16F877A safety-alert workflow using Embedded C, LCD interfacing and digital I/O.

Proteus simulation showing the PIC16F877A gas detection system in its no-gas state.
PIC16F877AEmbedded CMPLAB X IDEProteus Simulation
PIC16F877AMicrocontroller
16×2LCD display
1Digital input
2Alert outputs

Problem

The project modelled a simple safety-alert workflow: detect a simulated input condition, provide an audible alert and communicate the system state through an LCD display.

Constraints

Five-student Microcontrollers course project completed as a Proteus simulation. A push button represented the gas-input signal; the work did not use or validate a physical gas sensor.

My specific contribution

Within the five-student academic project, Rudaina personally designed, programmed, integrated and tested the simulation, including the PIC16F877A circuit, LCD interfacing, alert logic, results analysis and technical documentation.

Process

  1. Created the Proteus circuit around a PIC16F877A, a 16×2 LCD in 4-bit mode, a push-button input and alert outputs.
  2. Used Embedded C with MPLAB X IDE and the XC8 Compiler to read RB0, control a buzzer on RC0 and update the LCD with normal or alert messages.
  3. Validated the simulated behaviour by triggering the input condition and confirming expected LCD and alert-output responses.
  4. Documented the circuit, firmware and simulation results as a collaborative academic submission.

What went wrong and how it was fixed

Configuring the 16×2 LCD in 4-bit mode required the Proteus wiring and Embedded C pin definitions to match precisely. I aligned the circuit connections with the MPLAB X and XC8 firmware, then tested the LCD to confirm that normal and alert messages displayed correctly. I also programmed and tested the PIC16F877A digital I/O logic so that a simulated input could activate the buzzer and update the LCD from the normal state to the alert state.

Result

The simulation validated the intended digital input, audible alert and LCD feedback workflow. It provides course-level evidence of PIC microcontroller programming, digital I/O, LCD interfacing and simulation-based validation.

Reflection

The project reinforced the importance of validating hardware logic before physical implementation. A future version would replace the simulated button with a real gas sensor and include hardware testing.

Image gallery

Project repository

Explore the source files

The public repository includes the available project documentation, source material and supporting files.

View source code on GitHub
Contact Rudaina