int reading;
#include<LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7);
void setup()
{
lcd.begin(16,2);
}
void loop()
{
int reading=analogRead(A0);
lcd.setCursor(0,0);
lcd.print("Air Quality");
lcd.setCursor(0,1);
lcd.print(reading);
delay(500);
lcd.clear();
}
Explain: DB7- to Digital pin 7 DB6- to pin no. 6 DB5- to pin no. 5 DB4- to pin no. 4 E(Enable)- to pin no. 3 R/W (read/write)- ground connection RS - pin no. 2 V0 - ground with resistor 330 ohm VCC- power 5v Gnd- ground. For Gas sensor- 3 power point 5v and two ground (one resistor 1 kilo ohm.) and one analog pin.