logologo

HOMEABOUTSERVICESBLOGSBOOKSSHOPCONTACT

+977 9803661701support@nepatronix.orgLokanthali, Bhaktapur

© 2025 NepaTronix all rigths reserved

Carbon Monoxide Reader On Mobile App(IoT project)

  Back To Blogs

The Carbon Monoxide Reader project aims to develop a robot that monitors carbon monoxide (CO) levels and reports the data to a mobile application using the Blynk platform. This integration allows for real-time data visualization and alerts through a WiFi connection, enhancing safety by providing timely notifications of dangerous CO levels. The project leverages components such as the ESP32, a CO sensor, and an LCD for local display, combined with the Blynk app for remote monitoring. This project highlights the practical applications of IoT in environmental monitoring and mobile app interfacing with microcontrollers.

Project : 9


Introduction

The Carbon Monoxide Reader project aims to develop a robot that monitors carbon monoxide (CO) levels and reports the data to a mobile application using the Blynk platform. This integration allows for real-time data visualization and alerts through a WiFi connection, enhancing safety by providing timely notifications of dangerous CO levels. The project leverages components such as the ESP32, a CO sensor, and an LCD for local display, combined with the Blynk app for remote monitoring. This project highlights the practical applications of IoT in environmental monitoring and mobile app interfacing with microcontrollers.


Components Required

ESP32: A microcontroller with built-in WiFi and Bluetooth capabilities.

  1. CO Sensor: For detecting carbon monoxide levels in the environment.
  2. LiquidCrystal_I2C Display: To display sensor data and status messages locally.
  3. Power Supply: Typically a battery pack to power the ESP32 and sensor.
  4. Connecting Wires: For connecting all components.

Pin Configuration

  • Sensor Pin:
    • Sensor_PIN: 34
  • LCD Pins: Connected via I2C

Libraries Used

  • BlynkSimpleEsp32: For interfacing with the Blynk platform.
  • Wire: For I2C communication.
  • WiFi: For WiFi connectivity.
  • LiquidCrystal_I2C: For interfacing with the LCD display.

 

Circuit Diagram:


Code:

//Copy the blynk credential from your account device and paste it here

 

#define BLYNK_TEMPLATE_ID "TMPL670BbO1Nl"

#define BLYNK_TEMPLATE_NAME "Data Monitoring"

#define BLYNK_AUTH_TOKEN "4Q5w-qYfY3jO82qXBaL3O0E3irLFfDwb"

#define BLYNK_PRINT Serial

#include <BlynkSimpleEsp32.h>

#include <Wire.h>

#include <WiFi.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

#define Sensor_PIN 34

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = "nepatronix_2.4";  //Enter your WIFI SSID name

char pass[] = "CLB269DA03";      //Enter your WIFI password

BlynkTimer timer;

void notify() {

  int value = analogRead(Sensor_PIN);

  Serial.println(value);

  Blynk.virtualWrite(V1, value);

  display(1, 1, String(value));

 

  //  if (value == 800) { // If 1 receive then turn ON

  //    display(1, 1, "Toxic Air");

  //    Blynk.logEvent("intruder_alert", "Intruder Detected");

  //  } else {// Else turn OFF

  //    display(1, 1, "Noraml air");

  //  }

  delay(100);

}

void setup() {

  Serial.begin(9600);

  Wire.begin();

  lcd.init();

  lcd.clear();

  lcd.backlight();

  lcd.setCursor(1, 0);

  lcd.print("**NEPATRONIX**");

  delay(2000);

  lcd.clear();

  pinMode(Sensor_PIN, INPUT);

  display(1, 0, "Carbon MonoOxide: ");

  Blynk.begin(auth, ssid, pass); //Connecting to Blynk Server with ssid and password

  delay(500);

  Serial.println(WiFi.localIP());

 

  timer.setInterval(100L, notify);

 

}

void loop() {

  Blynk.run(); //run the blynk function in loop

  timer.run();

}

void display(int col, int row, String msg) {

  lcd.setCursor(col, row);

  lcd.print(msg);

}


Working


  1. Initialization:
  2. The ESP32 initializes serial communication at a baud rate of 9600.
    • The I2C LCD display is initialized, and a welcome message is displayed.
    • The ESP32 connects to the Blynk server using the provided credentials (auth token, WiFi SSID, and password).
    • The sensor pin is configured as an input.

  3. Main Loop:
  4. The program runs the Blynk and timer functions continuously.
    • The notify function is called at regular intervals to read the sensor value, display it on the LCD, and send it to the Blynk app.
    • The Blynk platform is used to monitor the sensor data and potentially trigger alerts.

  5. Sensor Data Monitoring:
  6. The notify function reads the CO sensor value using analogRead.
    • The value is printed to the serial monitor, displayed on the LCD, and sent to the Blynk virtual pin V1.
    • Additional logic can be added to trigger alerts based on the sensor readings.

Testing

Setup: Assemble the components and connect them as per the pin configuration.


  1. Power Up: Turn on the power supply and ensure the ESP32 and sensor are receiving power.

  2. WiFi Connection: Ensure the ESP32 is connected to the specified WiFi network.

  3. Blynk App: Configure the Blynk app with the provided template ID and auth token.

  4. Commands: Test the sensor data monitoring and ensure that the data is correctly displayed on the LCD and sent to the Blynk app.

  5. Display: Verify the LCD shows accurate CO levels and status messages.

  6. Alerts: Test the alert functionality by simulating high CO levels if applicable.

Conclusion

The Carbon Monoxide Reader project successfully demonstrates the integration of WiFi communication, sensor data monitoring, and remote control using the Blynk platform. By leveraging the ESP32 microcontroller and various components, the project provides a practical application in environmental monitoring. Users gain hands-on experience in IoT, mobile app interfacing, and sensor data visualization, laying a foundation for more advanced projects in the future. This project enhances safety by providing timely notifications of dangerous CO levels, showcasing the importance of IoT in modern environmental monitoring systems.




Total likes : 3

Comments







Read More Blogs!

Automatic Street Light Control(STEAM Education)

Understanding the operation and application of an automatic street light system using an LDR.


1.6k04

Smart Parking Using IR,Servo motor and Arduino Uno(Automation Project)

The Automated Parking System using Arduino is a project designed to efficiently manage parking spaces. It uses IR sensors to detect the presence of vehicles, a servo motor to control the parking barrier, and an LCD display to provide real-time updates on the availability of parking slots. This system aims to optimize the parking process, ensuring that users are informed about slot availability and the barrier operates automatically based on the sensor inputs.


1.6k04

LED with Touch(STEAM Education)

To understand the fundamental concept of sensors and their application in converting physical inputs into electrical signals.


1.7k05

Solar LED with Button(STEAM Education)

To understand the conversion of solar light energy into electrical energy and its application in powering a LED light with the control of a push button.


1.4k04