Project in progress
Arduino Carbon Monoxide detector Alarm with relay

Arduino Carbon Monoxide detector Alarm with relay © CC BY-SA

My device is just a prototype to show you how to the monoxide detector.

  • 5,392 views
  • 4 comments
  • 0 respects

Components and supplies

Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
Adafruit industries ada1536 image
Buzzer
×1
Keyes 3 color RGB Ky-016
×1
mq9 Carbon Monoxide Sensor
×1
1 Channel relay Ky-019
×1
11026 02
Jumper wires (generic)
×1

About this project

Hello world. This is my first project ever. Follow me, I will add more projects!

Step 1: What do you need?

NOTE: I tested this with a lighter as you can see in the video.

You should fully test your device before installing it in your home. You can add any sensor that you like and turn of any device you like. I advise using a quality sensor, that you know for sure will detect Carbon monoxide.

My device is just a prototype to show you how to build it. I used the MQ9 sensor ordered from China.

What do you need? Parts List.

  • Arduino UNO
  • Buzzer
  • Keyes 3 color RGB Ky-016
  • mq9 Carbon Monoxide Sensor or other.
  • 1 Channel relay Ky-019
  • Jumper Wires

Code

GasALARM_with_relay.inoArduino
My first arduino code.
//Author: Danny van den Brande
//ArduinoSensors.nl
int relay = 10; // relay turns trigger signal - active high;
int buzzer = 8 ;// pin for buzzer alarm
const int analogInPin = A0;  // Analoge Input 
const int ledPin = 13; // RED LED
const int ledPin2 = 12; // BLUE LED 
const int ledPin3 = 11; // GREEN LED

int sensorValue = 0;        

void setup() {
  
  Serial.begin(9600); 
  pinMode(ledPin, OUTPUT);      // zet de digitale pin als output
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode (buzzer, OUTPUT) ;    
  pinMode (relay, OUTPUT); 
}

void loop() {
  
  sensorValue = analogRead(analogInPin);            
  // bepaal wanneer alarm afgaat
  if (sensorValue >= 100)
  {
    digitalWrite(ledPin, HIGH);  
    digitalWrite(ledPin3, LOW);  
    digitalWrite (buzzer, HIGH) ;// buzz 
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;    
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;        
    delay(600);
    digitalWrite (buzzer, LOW) ;
    delay(600);
    digitalWrite (buzzer, HIGH) ;    
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;    
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;    
    delay(300);
    digitalWrite (buzzer, LOW) ;
    delay(300);
    digitalWrite (buzzer, HIGH) ;    
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;    
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    digitalWrite (buzzer, HIGH) ;
    delay(50);
    digitalWrite (buzzer, LOW) ;
    delay(50);
    

    digitalWrite (relay, LOW); 
  

  }
  else
  {
    digitalWrite(ledPin3, HIGH);    
    digitalWrite(ledPin, LOW);        
    digitalWrite (buzzer, LOW) ;
    digitalWrite (relay, HIGH); // relay conduction;
  }

 

  
  Serial.print("sensor = " );                       
  Serial.println(sensorValue);     

  
  
  delay(10);                     
}

Schematics

Schematic
This was my very first project en schematic. I will make a new schematic. this one is a bit messy
Gas%20sensor%20alarm bb

Comments

Similar projects you might like

Red Balloon Carbon Monoxide Detector

Project tutorial by circuito.io team

  • 9,660 views
  • 4 comments
  • 31 respects

Door Alarm With Ultrasonic Sensor

Project showcase by MattG

  • 34,322 views
  • 11 comments
  • 34 respects

Buzzer Alarm System With Help Of Arduino

by Team ONYX

  • 89,785 views
  • 12 comments
  • 50 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project showcase by LAGSILVA

  • 31,591 views
  • 37 comments
  • 97 respects

A Lightning Detector for Arduino

Project tutorial by runtimeprojects

  • 30,220 views
  • 10 comments
  • 24 respects

Laser Beam Alarm

Project in progress by Vrcg03 and mmgamitoc

  • 16,469 views
  • 8 comments
  • 24 respects
Add projectSign up / Login