#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"
//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;
//To change pins for Software Serial, use the two lines in GSM.cpp.
//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.
//Simple sketch to send and receive SMS.
int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];
void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(2400)) {
Serial.println("\nstatus=READY");
started=true;
} else Serial.println("\nstatus=IDLE");
if(started) {
//Enable this two lines if you want to send an SMS.
if (sms.SendSMS("5311234567", "Arduino SMS"))
Serial.println("\nSMS sent OK");
if (sms.SendSMS("05311234567", "Arduino SMS"))
Serial.println("\nSMS sent OK");
if (sms.SendSMS("905311234567", "Arduino SMS"))
Serial.println("\nSMS sent OK");
if (sms.SendSMS("+905311234567", "Arduino SMS"))
Serial.println("\nSMS sent OK");
}
};
void loop()
{
if(started) {
//Read if there are messages on SIM card and print them.
if(gsm.readSMS(smsbuffer, 160, n, 20)) {
Serial.println(n);
Serial.println(smsbuffer);
}
delay(1000);
}
};
Here it is some results i got from serial monitor after couple tests:
1# (the input was 3.3V (from Arduino) without any external power supply)
GSM Shield testing.
DB:NO RESP
DB:NO RESP
DB:NO RESP
Trying to force the baud-rate to 9600
1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp
status=IDLE
2# (the input was 3.3V-4.7V with an external power supply up to 1.8A)
GSM Shield testing.
ATT: OK
RIC:
ATT: OK
RIC:
ATT: OK
RIC:
ATT: OK
RIC:
ATT: OK
RIC:
By the way, the area that is shown below the picture was getting hotter for the second case. (Especially when the input was 4.7V)
Note:
1- I haven't got any pin code and plugged the sim in proper way.
2- Connections between the pins were just like this
As for arduino side: TXD -> 2 & RXD -> 3
3- Also the version of the arduino software that i currently have is 1.0.5 at the moment.
4- Red blink on the SIM800L stopped working for some reason.
I'm using this module and you need to keep in mind two things:
1/
the powersupply for the SIM800L can NOT be from the Arduino. The Arduino simply can not provide sufficient power to the module during startup.
It needs 3.6V (min) to 4.2v (MAX) to be able to work properly, and needs peak currents up to 2A. I use a 3A Dc-DC converter to power this module. These are cheap and available on Aliexpress:
Hi, I bought this module, but I do not get it up and running. I use the Adafruit FONATest. No connection. Can you please provide a photo of the wiring? Does anyone have working code for calling a URL, I want to use it to write data in a MySQL database. http://abc.myfritz.net:8080/abc.php?s=001&c=5&temp=22&hum=44&press=1013&key=12321
You can use AT commands to test the module. You just need to insert the SIM card (the right way :-)), put 4V on the VCC and use the Arduino as a serial retranslator. RXD and TXD of the (red) module are 5V tolerant but you must use 3.7-4.2V power supply (better to have separate DC/DC converter as advised by GertSanders). Connect GND, RXD and TXD to the UNO (see comments in the code below), run the sketch, open serial console and type
AT
in there. The SIM800L should response "OK" to the UNO and you should be able to see it in the console.
You can try to make a voice call using (note the semicolon)
But be careful, VIO is not VCC!! You don't have/need VIO.
// Connect VCC to +4V
// Connect GND to Ground
// Connect RX (data into SIM800L) to Digital 11
// Connect TX (data out from SIM800L) to Digital 10
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
{
while(Serial.available())
{
mySerial.write(Serial.read());
}
mySerial.println();
}
}
vlada0:
You can use AT commands to test the module. You just need to insert the SIM card (the right way :-)), put 4V on the VCC and use the Arduino as a serial retranslator. RXD and TXD of the (red) module are 5V tolerant but you must use 3.7-4.2V power supply (better to have separate DC/DC converter as advised by GertSanders). Connect GND, RXD and TXD to the UNO (see comments in the code below), run the sketch, open serial console and type in there. The SIM800L should response "OK" to the UNO and you should be able to see it in the console.
You can try to make a voice call using (note the semicolon)or hang up an incoming call using
You may want to check More commands here: https://www.adafruit.com/datasheets/sim800_series_at_command_manual_v1.01.pdf
You can follow this tutorial (look for "The command sequence"). You have to know the APN, username and password (it should be given by your mobile operator).
Have in mind that the module is not a 5V device. Even 3.3 V are for the pins too much. It may working but it is out of spec. You have to use voltage divider to get the fitting voltage.
For me it is working with this lib
with gprsbee.initAutonomoSIM800 as initialization method
Before complete LCP protocol data to be encoded ACCM 0xFFFFFFFF, that's all.
Now another problem.
In response to the command AT+CBST? reply ERROR, on M2M - data calls responds NO CARRIER.
Module not support Data mode (CSD).
Who can help, thank you for earlier.
How did you wire the LM2596S to the DC-DC Convertor, also what are you using as a power supply?
Power bank, LiPo, etc. Is it possible to run it off a Powerbank?
hellow dear firends
who work with sim800l in nod mcu whit arduino IDE?
can you help me?
i want connect sim800l to node mcu and use library sim800l for arduino in sim800l but all of theme use soft ware serial in this program and when i upload that program in node mcu didnt work
please giude me for send & resive sms with sim800l in nodemcu with arduino
thanks alot
Hi, i am using this module and everything works fine. Only problem is that while receiving sms somehow arduino blinks all outputs to HIGH few times. is it possible that frequency from antenna does something to arduino?
#include <Sim800l.h>
#include <SoftwareSerial.h> //is necesary for the library!!
Sim800l Sim800l; //to declare the library
char* text;
char* number;
bool error; //to catch the response of sendSms
void setup(){
Sim800l.begin(); // initializate the library.
text="Testing Sms"; //text for the message.
number="2926451386"; //change to a valid number.
error=Sim800l.sendSms(number,text);
// OR
//Sim800l.sendSms("+540111111111","the text go here")
}
void loop(){
//do nothing
}
The module is SIM800L V2.0 - 5V
I have also tested the type mentioned in this issue.