Toll-Free Customer Support 24/7

Carbon Monoxide Sensor

/*
* Project name:
CARBON MONOXIDE SENSOR
* Copyright
(c) Researchdesignlab.com
* Description:

* Test configuration:
MCU: ATMEGA328
Dev.Board: Arduino uno
Oscillator: 16 MHz
Software: Arduino

*/

/*


The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

*/

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int GASPin = 2;
void setup() {
// initialize the GAS sensor pin as an input:
pinMode(GASPin, INPUT);
// set up the LCD's number of columns and rows:

lcd.begin(16, 2);
// Print a message to the LCD.

}

void loop() {
// if it is, the GAS sensor is HIGH:
if (IR == HIGH) {
lcd.print("CARBON ACTIVATED");
delay(1000);
}
// if it is, the GAS sensor is low:
else
{
lcd.print("CARBON DEACTIVATED");
delay(1000);
}
}

Back to top