Tell the Arduino to send you a specified sensor data to your phone all via SMS. Used DHT11+MLX90614 for example
- Smart Machine Smart Decision SIM800 SeriesAT Command ManualV1.10 2016-02-01.
- Thanks for the reply. The part of the main loop that must read the SMS, is as below. WAIT2: mov a,p3;read P3 inputs - CHECK RI anl a,#010h;mask all but RI P3.4 JNZ WAIT4;RI GOES LOW ON RING OR SMS;check digital inputs meantime CALL DELAY3;WAIT 1 SECOND FOR SMS TO FINISH;THEN READ SMS CALL READSMS JMP DECODE;DECODE THE SMS The read routine always reads SMS #1, as I delete all SMS's after.
- To delete the SMS text message, specify 1 to the index parameter of the +CMGD AT command, like this: (Important note: Make sure you are writing text messages to and deleting text messages from the same message storage area. If not, you may delete the wrong text message.
The +CMGL AT command also allows you to retrieve all SMS messages stored in the message storage area. Following is an example for illustrating the difference between +CMGR and +CMGL. Suppose you want to use your computer / PC to read a text message from the message storage area and you know the index at which the SMS text message is located. It is very easy to build an “SMS-controlled relay” with the help of a cheap GSM modem module and a small microcontroller board. Here, I’m using the SIM800L and Arduino Nano V3 to develop a nifty one-channel SMS relay. The device is, in fact, an “isolated electric switch” that can be controlled through the messaging app on your mobile.
- 3,240 views
- 3 comments
- 3 respects
Components and supplies
| × | 1 | |
| × | 1 | |
| × | 1 | |
| × | 1 |
Apps and online services
About this project
Sponsored by: DigitSpace
Product used: SIM800L Module Replace SIM900A GSM GPRS 5V Serial with Antenna
Product used: SIM800L Module Replace SIM900A GSM GPRS 5V Serial with Antenna
Hello there, this is my third tutorial concerning SIM800L EVB version, make sure to take a look at previous ones, to not make this one long:
So here in this tutorial, I'm going to use the same module 'SIM800L EVB version' with Arduino Uno board, and I took for example 'DHT11' and 'MLX90614 contactless thermal sensor'.
And the idea is that I'm going to ask the Arduino via SMS to send me either the DHT values or the MLX values via SMS too, the project is relatively easy, the tricky part was to detect a substring withing the SMS content to be able to decide wheter the user asks for DHT values or MLX values.
HALT !!!
The Sim card used shouldn't be locked with a pin code otherwise use the AT commands to do it, and make sure you have enough credit to be able to send SMS... depends on your network provider.
This is the module I'm using:
And as said before the module works with AT commands, we saw some of them on the previous tutorials.
And for the power I'm using A Lithium Battery with A Buck converter:
Test 1
So the test #1 consist of just reading a SMS sent from the phone, and display it on the serial monitor.
Wiring
The wiring 1 can be found below, it's the basic wiring of the module, it's practical for all kind of tests.
Libraries
No special libraries are required here just the default SoftwareSerial.
Code
Code 1 can be found below.
The code is really easy first in the 'Setup()' we just send some 'AT commands' to make the module on the receiving text mode and set the way those SMS received should be handled.
And on the loop there is a classic communication function that permits the communication between the Arduino IDE Serial Monitor and Sim800L 'send/receive' between them
The functions used can be found in the code, but if you want to check them closely here's the document:
Result
Test 2
On the test#2 we will add DHT11 sensor and MLX90614 contactless thermal sensor... I used these two just as an example you can use whatever you want.
And in the code I integrated a part where I read the SMS received and check for the keywords 'DHT' or 'MLX'... and here of course you can replace it by your own or make a whole command i.e:'Send DHT data'.... to sum up with just look for a substring within a string :D
Wiring
The wiring 2 can be found below, we have just add the DHT11 and MLX90614
Libraries
Two libraries should be add (Because of the modules) depending on what you are using.
Code
Code 2 can be found below.
So in this code we:
- Set the module to receiving SMS mode
- Set the way to handle the SMS
- If something is received -> Transmit to Arduino
- Arduino will check for the 'Keywords' (DHT or MLX)
- If one of them is found -> check which one
- Make the reading
- Send the Data to the programmed phone number
Result
The use of the serial monitor is optional, the device can work without it, here used just to troubleshoot in case of a problem or to check the state.
The method we used is just to look for a specified keyword within the message, doesn't care what's being sent with it
Go further
You can improve the way to detect the keywords in the SMS sent, it will be useful to do other projects that will be more interesting.
You can do multiple readings before sending the SMS to be more precise.
Send error SMS in case the sensor is not working properly.
Check the code and if you have a better method for this share it with us, Thanks.
That's all folks.
Code
With comments to help you.
With comments to help you
Schematics
Author
SurtrTech
- 20 projects
- 103 followers
Published on
January 18, 2020Write a comment
Members who respect this project
and 2 others
See similar projectsSim800l Delete All Sms In Hindi
you might likeTable of contents
Write a comment
The AT+CMGL command lists messages received on the GSM modem. It can be used to get all received messages, all unread messages or all read messages.
Sim800l Delete All Sms Contacts
![Outlook Outlook](https://ae01.alicdn.com/kf/He45869c6eb5b4511a52cda27cb508768z.jpg)
Command | Positive Response |
---|---|
AT+CMGL=<stat><CR> | +CMGL: <index>,<stat>,<oa>,[<alpha>],[<scts>]<CR><LF><data><CR><LF> ... OK |
Sim800l Delete All Sms Message
Parameters
<stat>: Status = 'ALL', 'REC UNREAD' or 'REC READ'
<index>: Index number of the message
<oa>: Originator address
<alpha>: Originator name (if available in the phonebook)
<scts>: Service Center Time Stamp
<data>: The content of the text message
<CR>: ASCII character 13
<LF>: ASCII character 10
<stat>: Status = 'ALL', 'REC UNREAD' or 'REC READ'
<index>: Index number of the message
<oa>: Originator address
<alpha>: Originator name (if available in the phonebook)
<scts>: Service Center Time Stamp
<data>: The content of the text message
<CR>: ASCII character 13
<LF>: ASCII character 10
Example
![App App](/uploads/1/2/6/6/126670488/910389512.jpg)
Set the GSM modem to Text Mode SMS, list all received messages and remove the messages from the GSM modem.
See also
AT+CMGF - Set SMS Text Mode or SMS PDU Mode
AT+CMGD - Delete a Received Message
AT+CMGF - Set SMS Text Mode or SMS PDU Mode
AT+CMGD - Delete a Received Message