Sunteți pe pagina 1din 4

Working.

As we know Arduino UNO Bootloaded ATMEGA328P controls all


operations in our project. We can explain entire working as segmented individual
functional block diagrams and then as overall.

Let us begin with power supply section. Power supply section generates
three voltage supplies. The output from the 12V-0-12V/1A transformer is
converted to 12v DC and then the ripple is filtered out to get smooth 12V output.
5V power supply is derived using LM7805 regulator IC. The Switching regulator
IC LM2576 is used to produce the precise and stabilized 3.8/2A needed for the
SIM800 module. Also a Zener diode voltage regulated 2.7V/20mA power supply is
used for the TTL logic level conversion circuit.

Arduino Uno always works on 5V TTL logic level. While SIM800 module
works on 2.7V TTL logic level. So a 5V to 2.7V TTL logic level converter is
needed to interface the Arduino and the SIM800 GSM Module.

SIM800, GSM Module equipped with a fully operational SIM card is the
message hander in our project. SIM800 receives the SMS from other mobile
equipment or handsets and stores the message in SIM card memory. Arduino can
read the messages from SIM card memory locations whenever needed .All the
communication in between Arduino and the SIM800 module is done through AT
command sets. Also Arduino can send messages to SIM800 Module accordingly
via AT Commands. The important thing is to provide stabilized power supply to
SIM800 module in all time so that never drop the supply voltage to SIM800 below
3.4V at time. Other vice it may lead to erroneous operation of GSM Module.
When Arduino is booted it always checks for the serial data via FTTD pins
up to the RESET voltage rising up to the VCC. In order to load the user program
DTR pin of the serial communication must provide a high to low pulse to RESET
pin.

After the booting initially the arduino executes all the instructions in the
setup function then all the instructions in loop function. All the instructions in loop
function will be executed as in a loop, hence the name loop function. Arduino
initializes a serial communication with SIM800 module at 2400bps.Then arduino
will fetch the Relay status from EEPROM and then it will update the relay status.
Then initialize the LCD to 20x4 in 4bit mode operation. Then it will sound a
welcome tone pattern to identify the booting status.

As Arduino handles text messages only arduino configure the SIM800


modules to receive message in text mode. It will always take around 20 to 40
seconds for SIM800 module network registration and to become fully operational.
First arduino sends the AT commands to GSM Module and then waits for its
response within a time out delay period. If GSM Module acknowledges with OK
or ERROR messages Arduino will take care of further action like resending the
previous AT commands with modified Parameters even necessary.

In the loop function arduino reads the message index (total no messages)
from the SIM card inserted in the GSM Module using AT+CPMS= “SM”
command. Arduino formats the received response text and the extracts the exact
message index number.

If there is no message inside the SIM arduino it will display no message


dialogue in LCD module. If message index number is equal or less than the index
number of last read message, arduino will never read or process the message. If the
message index number is greater than the index number of last read message
(whenever a new message is arrived) Arduino will first read the message from SIM
module by sending the AT command AT+CMGR=message index and it reads the
entire response including the SMS content. Arduino will find the sender number by
searching the text “+91” and store as sender_no. Then Arduino will find the
password by finding “*#” and by extracting 4 consecutive characters from the
message after “*#”. The real interested message part in SMS, that to be displayed
in the LCD will sub stringed to string indata after trimming in between two “##”
patterns.

If the password string received is the exact password stored in Arduino Then
only indata will be displayed in the 20x4 LCD Module and further processing the
indata for the relay switching and DHT11 measurement.

After authentication if message is “SWITCH ON” arduino will switch on the


relay and update the current relay status in EEPROM. If message is “SWITCH
OFF” arduino will switch off the relay and update the current relay status in
EEPROM. If message is “DHT11_TEST” arduino will read the Temperature and
Humidity from DHT11 and send the results to the sender mobile number.

When the total number of messages in the SIM card exceeds 30 arduino will
automatically deletes last 20 read messages in order one by one from the SIM.
Also whenever the GSM Module receives a message without password/wrong
message format/Wrong password, will not be displayed or processed and will be
definitely deleted from the SIM Card.

User can read all messages in the SIM card by pressing the Next Button.
Interrupt 0 in the arduino is used for the message index selection. When interrupt 0
is happened it will increment the message index. In this way all the messages in the
SIM can be displayed in the LCD display. RESET button is also extended for
resetting the Arduino.

In the idle time whenever there is no message, LCD display will show the
last read message. Whenever a new message is arrives arduino will sound new
message sound, displays the new message, process the new message and update
relay or measure DHT11 is needed.

S-ar putea să vă placă și