How to Make Call, Send and Receive Message using GSM Module
AT Commands: Make a Voice call: ATD+91XXXXXXXXXX; Send Message: AT+CMGF=1 AT+CMGS=\"+91XXXXXXXXXX\"\r Message goes here (char)26 Receive Message: AT+CNMI=2,2,0,0,0 AT+CMGF=1 Redial call: ATDL ------------------------------------------------------------------------------------------------------ Arduino Code to make a Voice Call: void setup() { Serial.begin(9600); Serial.println("ATD+91XXXXXXXXXX;"); delay(1000); } void loop() { } ------------------------------------------------------------------------------------------------------ Arduino Code to send a Message: void setup() { Serial.begin(9600); Serial.println("AT+CMGF=1"); delay(1000); Serial.println("AT+CMGS=\"+91XXXXXXXXXX\"\r"); delay(1000); Serial.println("Hello"); delay(1000); Serial.println("Himanshu"); delay(1000); Serial.println((char)26); } void loop() { } -------------------
Count is fluctuating between 1 and 0 initially.
ReplyDeleteyes, i also faced the same pblm
Delete
Delete#include
LiquidCrystal lcd(12,11,5,4,3,2);
#define in 8
#define out 9
#define relay 10
int count=0;
void IN()
{
count++;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void OUT()
{
count--;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void setup()
{
lcd.begin(16,2);
lcd.print("Visitor Counter");
delay(2000);
pinMode(in, INPUT);
pinMode(out, INPUT);
pinMode(relay, OUTPUT);
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
}
void loop()
{
if(digitalRead(in)){
IN();}
if(digitalRead(out)){
OUT();}
if(count<=0)
{
lcd.clear();
digitalWrite(relay, LOW);
lcd.clear();
lcd.print("Nobody In Room");
lcd.setCursor(0,1);
lcd.print("Light Is Off");
delay(200);
}
else
digitalWrite(relay, HIGH);
}
Hey!
ReplyDeleteWhat is the total approximate cost of this project
I'm thinking of making it for my college
Maximum Rs. 1000 to Rs. 1500
DeleteWhich resistor is used
ReplyDeleteYes
Delete1k resistor
DeleteGood job bro
ReplyDeleteGood Job, thanks for sharing code
ReplyDeletethis is correct code
Delete#include
LiquidCrystal lcd(12,11,5,4,3,2);
#define in 8
#define out 9
#define relay 10
int count=0;
void IN()
{
count++;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void OUT()
{
count--;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void setup()
{
lcd.begin(16,2);
lcd.print("Visitor Counter");
delay(2000);
pinMode(in, INPUT);
pinMode(out, INPUT);
pinMode(relay, OUTPUT);
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
}
void loop()
{
if(digitalRead(in)){
IN();}
if(digitalRead(out)){
OUT();}
if(count<=0)
{
lcd.clear();
digitalWrite(relay, LOW);
lcd.clear();
lcd.print("Nobody In Room");
lcd.setCursor(0,1);
lcd.print("Light Is Off");
delay(200);
}
else
digitalWrite(relay, HIGH);
}
ReplyDelete#include
LiquidCrystal lcd(12,11,5,4,3,2);
#define in 8
#define out 9
#define relay 10
int count=0;
void IN()
{
count++;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void OUT()
{
count--;
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
delay(1000);
}
void setup()
{
lcd.begin(16,2);
lcd.print("Visitor Counter");
delay(2000);
pinMode(in, INPUT);
pinMode(out, INPUT);
pinMode(relay, OUTPUT);
lcd.clear();
lcd.print("Person In Room:");
lcd.setCursor(0,1);
lcd.print(count);
}
void loop()
{
if(digitalRead(in)){
IN();}
if(digitalRead(out)){
OUT();}
if(count<=0)
{
lcd.clear();
digitalWrite(relay, LOW);
lcd.clear();
lcd.print("Nobody In Room");
lcd.setCursor(0,1);
lcd.print("Light Is Off");
delay(200);
}
else
digitalWrite(relay, HIGH);
}
Bro here we are useing fan not light with relay and pin layout is also different
ReplyDeleteCode wrong hai ☺️ please help me
ReplyDelete