Arduino is used for controlling whole the process. Here we have used GSM wireless communication for controlling appliances. We send some commands like “#A.light on*”, “#A.light off*” and so on for controlling AC appliances. After receiving given commands by Arduino through GSM, Arduino send signal to relays, to switch ON or OFF the appliances using a relay driver.
This are the command used
#A.fan on*
#A.fan off*
#A.light on*
#A.light on*
#A.tv on*
#A.tv on*
#A.allon*
#A.all on*
GSM module only understands AT commands, and can respond accordingly. The most basic command is “AT”, if GSM respond OK then it is working good otherwise it respond with “ERROR”. There are various AT commands like ATA for answer a call, ATD to dial a call, AT+CMGR to read the message, AT+CMGS to send the sms etc.
AT+CNMI=2, 2, 0, 0, 0 <ENTER> - Auto opened message Receiving. (No need to open message)
(This AT comments have been used in void setup of the Code)
OPERATION :
After uploading the code open serial monitor (write like that in void loop ), AT comments will be displayed, then send SMS to the SIM which is inserted (#A.fan on* like that ).
when the sms is received by the inserted SIM beep sound will be heard and the corresponding relay will be triggered.
CODE EXPLANATION :
Above VOID SETUP pin declaration and variable initialization has been done.
For receiving data serially we have used two functions one is Serial.available which checks whether any serial data is coming and other one is Serial.read which reads the data that comes serially.
Receiving data serially we have stored it in a string
When Enter comes program start to compare received string with already defined string and if string matched then a relative operation is performed.
NOTE :
Before sending SMS, open serial monitor as we get data through it and we return the code like that.
SIM card has very less memory, so it won't be able to store more sms (If you are not receiving any changes mean put the sim on your and free up the space) I faced this kind of problems
SCHEMATIC :
TX and RX of GSM to RX and TX of arduino.
GND of gsm to GND of arduino
Normal relay connection.
If any queries comment it out.




_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)







Comments