Surilli
Published © GPL3+

Integration of Surilli Basic M0 with MQ7 and 16x2 LCD

Visualize the changing values of CO in air on 16x2 LCD using MQ7 Gas Sensor and Surilli Basic M0.

BeginnerFull instructions provided15 minutes845
Integration of Surilli Basic M0 with MQ7 and 16x2 LCD

Things used in this project

Hardware components

Surilli Basic
Surilli Basic
×1
MQ7 Gas Sensor
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Surilli Basic M0 with MQ7 Gas Sensor and 16x2 LCD

Code

SurilliBasicM0_MQ7_16x2_LCD

C/C++
#include <LiquidCrystal.h>
const int AOUTpin = 0; // The AOUT pin of the CO sensor goes into analog pin A0 of Surilli Basic M0
const int DOUTpin = 12; // The DOUT pin of the CO sensor goes into digital pin 12 of Surilli Basic M0

const int rs = A1, en = A2, d4 = 9, d5 = 10, d6 = 11, d7 = 6;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int limit;
int value;

void setup() 
{
   lcd.begin(16, 2);
   SerialUSB.begin(115200); // Sets the baud rate
   pinMode(DOUTpin, INPUT); // Sets the pin as an input to the Surilli Basic M0
   
}

void loop()
{
    
    value= analogRead(AOUTpin); // Reads the analaog value from the CO sensor's AOUT pin
    limit= digitalRead(DOUTpin); // Reads the digital value from the CO sensor's DOUT pin
    SerialUSB.print("CO value: ");
    SerialUSB.println(value); // Prints the CO value
    SerialUSB.print("Limit: ");
    SerialUSB.println(limit); // Prints the limit reached as either LOW or HIGH (above or underneath)
    lcd.setCursor(0,0);
    lcd.print("   CO Value   ");
    lcd.setCursor(0,1);
    lcd.print("   ");
    lcd.print(value,DEC);
    lcd.print(" PPM");
    lcd.print("   ");
    delay(1000);
    
}

Credits

Surilli

Surilli

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

Comments