Guys i am making a gas detector alarm with arduino, i have interfaced a 16X2 lcd module and a gas sensor to the arduino. On connecting the components according to circuit diagram, the lcd just shows some random special symbols like “%@??&**” , later on opening serial monitor it then shows proper characters as given in code and functions normally.Why is this happening is it possible to correct this error, is it because coding error or any settings which has to be modified. I want a solution to this problem urgently any valuable suggestions would help guys… I have uploaded my code below…
.I have to shrinkify this project to an atmega328p and power it separately via 9v battery, i am worried that even on powering arduino separately it might not display… PlZZ help guys…
Thank you,
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 5, 4, 3, 2);
int potPin = A4;
int ledred= 9;
int ledgreen= 10;
int potValue = 0;
int buzzer = 6;
void setup() {
lcd.begin(16, 2); // lcd rows and columns
lcd.print(“GAS_SENSOR”);
pinMode(6, OUTPUT);
}
void loop() {
potValue = analogRead(potPin);
digitalWrite(10, HIGH);
lcd.setCursor(0, 1);
lcd.print("Value = ");
lcd.print(potValue);
delay(1000);
lcd.print(" ");
delay(1);
if (potValue>15)
{
digitalWrite(6,HIGH);
delay(1000);
digitalWrite(10,LOW);
digitalWrite(9,HIGH);
}
}
atmega328pgas.ino (620 Bytes)