Internet of things Micro:bit MQ-4 sensor

Intelligent gas leak detection system with Micro:bit

Detecting gas leaks at industrial sites can not only be dangerous and time-consuming, but also subject to human misinterpretation.

In order to remedy the risks associated with gas leaks, we install gas leak detection systems which, thanks to detection heads, will give an alarm.

Purpose of this project:

In this project we will realize a gas leak detection system controlled by the Micro:bit card connected to the Internet.

It mainly uses MQ-4 gas sensor. When the sensor detects gas leak, Micro:bit card will send email alert by WIFI.

Note: To connect the Micro: bit card to the Internet you can see this article:


Necessary components

  • Micro:bit
  • MQ-4 gaz sensor
  • ESP8266 wifi
  • Connecting wires

  • Test plate

  • Wifi network


To perform the assembly, you can connect:

For MQ-4 sensor :

  • the DO pin to the P2 pin of the Micro:bit card

  • the VCC pin to the 5V pin of the GPIO card

  • the GND pin to the GND pin of the Micro:bit card

For ESP8266 module:

  • the RX pin to Pin P0 of the Micro:bit card

  • the TX pin to Pin P1 of the Micro:bit card

  • the GND pin to the GND of the Micro:bit card

  • the two pins 3V3 and EN to the 5V pin of the power supply module

Makecode program:

Here is the program of the intelligent gas leak detection system connected to the Internet:

0 commentaire

Leave a comment

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

Scroll to Top