Gas alarm system controlled by Micro:bit board

Micro:bit 08-04-24
104 0

Tutorial plan

Introduction

1- How the gas alarm system works ?

2- Gas alarm system components

3- Mounting Micro:bit board with MQ-4 sensor and LED

4- Program Micro:bit board with Makecode to control the system

 

 

Introduction

A gas alarm system is a safety device designed to detect the presence of potentially harmful gases in an environment, such as carbon monoxide (CO), natural gas, propane, methane, or other combustible gases. These systems are commonly used in homes, commercial buildings, industrial facilities, and other locations where gas leaks could pose a threat to health and safety.

Here’s how a typical gas alarm system works:

1- Gas Sensors: Gas alarm systems contain sensors that are capable of detecting specific types of gases. These sensors continuously monitor the air for the presence of gases, and when they detect a gas at a certain concentration level, they trigger an alarm.

2- Alarm Devices: When a gas is detected, the system activates alarm devices such as sirens, strobe lights, or audible alerts to warn occupants of the building about the potential danger. These alarms are usually loud and conspicuous to ensure they can be easily heard or seen.

3- Monitoring and Notification: In some cases, gas alarm systems are connected to monitoring services that can provide remote monitoring and notifications. This allows for immediate response in case of a gas leak, even if no one is present at the location where the alarm is installed.

4- Integration with Building Systems: Advanced gas alarm systems may be integrated with other building systems, such as ventilation systems or shut-off valves for gas lines. This integration allows for automated responses to gas leaks, such as activating ventilation to remove the gas from the building or shutting off the gas supply to prevent further leaks.

5- Maintenance and Testing: Regular maintenance and testing of gas alarm systems are essential to ensure their proper functioning. This includes periodic calibration of sensors, testing of alarm devices, and replacing batteries or other components as needed.

Overall, gas alarm systems play a crucial role in preventing accidents and protecting occupants from the dangers associated with gas leaks. They provide early warning of potential hazards, allowing people to take appropriate actions to mitigate the risks and ensure their safety.

How the gas alarm system works ?

The gas alarm system based on Micro:bit board, Buzzer, MQ-4 sensor, and LED is designed to detect the presence of gas in the environment and alert users if the gas concentration exceeds a certain threshold. Here’s a description of each component and its role in the system:

1- Micro:bit board: The Micro:bit board serves as the central control unit of the gas alarm system. It is a compact microcontroller board equipped with various sensors, input/output pins, and wireless communication capabilities. The Micro:bit runs the program responsible for reading data from the MQ-4 sensor, processing it, and controlling the Buzzer and LED accordingly.

2- MQ-4 sensor: The MQ-4 sensor is a gas sensor capable of detecting various gases such as methane, natural gas, propane, and butane. It operates based on the principle of gas conductivity, where the presence of gas changes the conductivity of its sensing element. The MQ-4 sensor provides an analog voltage output proportional to the gas concentration in the environment.

3- Buzzer: The Buzzer is an audible alarm device that produces sound when activated. In the gas alarm system, the Buzzer is used to generate an audible warning signal when the gas concentration exceeds the predefined threshold. It alerts users in the vicinity about the potential presence of gas and prompts them to take necessary actions.

4- LED: The LED (Light Emitting Diode) is a visual indicator used in the gas alarm system to provide a visual alert. When the gas concentration surpasses the threshold, the LED is typically illuminated to indicate the presence of gas. It offers a visual cue alongside the audible alarm from the Buzzer, enhancing the effectiveness of the warning system.

Gas alarm system components

Micro:bit board:

Micro:bit board

The Micro:bit board is a small, programmable microcontroller board designed for education and beginner-friendly coding projects. It was developed by the BBC, in collaboration with various partners, as a tool to introduce young people to programming and electronics.

The GPIO expansion card for the Micro:bit card

The GPIO expansion card for the Micro:bit card

The GPIO expansion board for the Micro:bit board expands the capabilities of the Micro:bit board by adding more input/output (GPIO) pins and additional functionality.

MQ-4 gas sensor:

The MQ-4 gas sensor is a type of semiconductor gas sensor commonly used to detect the presence of methane (CH4) gas in the atmosphere. It belongs to a family of gas sensors known as the “MQ series,” which are widely used in various applications, including industrial safety, gas leakage detection, and environmental monitoring.

LED 

LED

In an obstacle detection system, an LED (Light Emitting Diode) can be used as a visual indicator to provide feedback about the detection status. The LED can be programmed to turn on or off based on whether an obstacle is detected within a certain range.

Jumper Wires:

Jumper wires

For making temporary connections and wiring between components.

Breadboard:

Test plate

A breadboard is a useful tool for creating temporary electronic circuits. It allows you to connect components without soldering.

Mounting Micro:bit board with MQ-4 sensor and LED

Mounting Micro:bit board with MQ-4 sensor and LED

Attaching the MQ-4 sensor : 

– Connect the VCC pin of the MQ-4 sensor to the 5V pin of the GPIO board

– Connect the GND pin of the MQ-4 sensor to the GND pin of the Micro:bit board

– Connect the DO pin of the MQ-4 sensor to P0 pin of the Micro:bit board

Attaching the red LED :

– Connect the negative terminal (cathode) of LED to the ground (GND) of the Micro:bit board.

– Connect the positive terminal (cathode) of LED to P1 pin of the Micro:bit board.

Program Micro:bit board with Makecode to control the system

Below is a simple program for the gas alarm system based on the Micro:bit board :

Download program

 

This program uses a continuous loop (forever) to monitor the gas concentration. Within the loop, it reads the analog value from the MQ-4 sensor connected to pin P0 using analog read pin P0

If the gas concentration id less than the predefined threshold (200), it triggers an alarm: the buzzer sounds, and the LED connected to pin P1 is turned on. Otherwise, if the gas concentration is is greater than the threshold, the Micro:bit screen is cleared, and the LED is turned off.

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info