Surilli
Published © GPL3+

Integration of Surilli GSM with MQ2 Sensor and 16x2 LCD

Visualize the changing analog values of the MQ2 Smoke Sensor on 16x2 LCD using your Surilli GSM.

BeginnerFull instructions provided15 minutes108
Integration of Surilli GSM with MQ2 Sensor and 16x2 LCD

Things used in this project

Hardware components

Surilli GSM
Surilli GSM
×1
Jumper wires (generic)
Jumper wires (generic)
×1
MQ2 Sensor
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Surilli GSM with MQ2 Smoke Sensor and 16x2 LCD

Code

SurilliGSM_MQ2_16x2

C/C++
#include <LiquidCrystal.h>

int gasPin; // GAS sensor output pin to Surilli GSM.

const int rs = A1, en = A2, d4 = 9, d5 = 10, d6 = 11, d7 = 6;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup()

{
    
    lcd.begin(16, 2);
    Serial.begin(115200); // Initialize serial port - 115200 bps
    
}

void loop()

{
    
    gasPin = analogRead(0);                      // Read analog input pin A0
    Serial.print("Analog Value=");
    Serial.println(gasPin, DEC);              // Prints the value read
    lcd.setCursor(0,0);
    lcd.print("  Analog Value ");
    lcd.setCursor(0,1);
    lcd.print("   ");
    lcd.print(gasPin,DEC);
    lcd.print("   ");
    delay(1000);                                 // Wait 1000ms for next reading
    
}

Credits

Surilli

Surilli

196 projects • 43 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments