in this video you can get an idea on how to make an model of alcohol detection using arduino uno board and gsm module
COMPONENTS THAT WE USED
1. Arduino uno
2. MQ3 sensor
3. Gsm module (800A)
4. Bread board
5. 9V batterys
NOTE:
the 9v batterys might not get more standy by time
CODE:
int led=13;
int mq3=0;
int a;
int b=1;
#include'SoftwareSerial.h'
SoftwareSerial mySerial(9,10);
void setup()
{
pinMode(mq3,INPUT);
pinMode(led,OUTPUT);
digitalWrite(led,LOW);
Serial.begin(115200);
mySerial.begin(115200);
delay(200);
while(b==1)
{
a=analogRead(mq3);
Serial.println(a);
if(a'450) //alcohol consumed condition
{
digitalWrite(led,HIGH);
Serial.println("STARTING TO SEND SMS");
delay(1000);
Serial.println("SMS MODE");
delay(1000);
mySerial.println("AT+CMGF=1"); //starting to send sms
delay(1000);
Serial.println("PHONE NO.: 7010968280");
mySerial.println("AT+CMGS=\"+917010968280\"\r");
delay(1000);
mySerial.println("THE PERSON HAS CONSUMED ALCOHOL");
delay(100);
Serial.println("SENT");
mySerial.println((char)26);
delay(200);
b=2;
}
else
{
digitalWrite(led,LOW);
}
delay(500);
}
}
void loop()
{
if (Serial.available())
Serial.println(mySerial.read());
}
NOTE:
use angle bracket where ' this symbol is given