I'm planning to build a device that would read some sensor data and send it via GPRS, eg. once per day. (Not that original, yeah.) But my problem is choosing a GSM/GPRS shield.
The official shield has a nice interface for doing an HTTP POST/GET. OTOH, the shield seems to be sold out (and would be quite expensive anyway).
There seem to be other shields available, but their code examples tend to look quite hacky: the device waits for an arbitrary moment and then hopes that the server is done. That's IMO both inefficient or unreliable.
My question: which GSM/GPRS shield would you recommend, with these features:
- a sane library w/ examples, such as the official one
- an external antenna
- bonus: a competitive price
- another bonus: hopefully a "real" shield, so no soldering required and a few pins still easily usable for the sensors.
4 Answers 4
That library should work with pretty much anything that has the M10 module on it.
I only have experience with the SIM900 modules. Found the cheapest one on EBay.
While interfacing with these things can be a challenge at first, you really just need to read the manual for all the AT commands and execute them. I've written a couple of functions that may help:
Note: you may safely replace all instances of DEBUG_PRINT
and DEBUG_PRINTLN
with Serial.print
and Serial.println
.
SoftwareSerial SIM900(7, 8);
/*
Sends AT commands to SIM900 module.
Parameter Description
command String containing the AT command to send to the module
timeout A timeout, in milliseconds, to wait for the response
Returns a string containing the response. Returns NULL on timeout.
*/
String SIMCommunication::sendCommand(String command, int timeout) {
SIM900.listen();
// Clear read buffer before sending new command
while(SIM900.available()) { SIM900.read(); }
SIM900.println(command);
if (responseTimedOut(timeout)) {
DEBUG_PRINT(F("sendCommand Timed Out: "));DEBUG_PRINTLN(command);
return NULL;
}
String response = "";
while(SIM900.available()) {
response.concat((char)SIM900.read());
delayMicroseconds(500);
}
return response;
}
/*
Waits for a response from SIM900 for <ms> milliseconds
Returns true if timed out without response. False otherwise.
*/
bool SIMCommunication::responseTimedOut(int ms) {
SIM900.listen();
int counter = 0;
while(!SIM900.available() && counter < ms) {
counter++;
delay(1);
}
// Timed out, return null
if (counter >= ms) {
return true;
}
counter = 0;
return false;
}
I would recommend the official Arduino GSM shield.
-
Which one do you recommend? Care to elaborate?Ricardo– Ricardo2014年05月06日 12:58:51 +00:00Commented May 6, 2014 at 12:58
-
1Arduino GSM shield. I am using this, Its working fine and its a official Arduino shield.Manihatty– Manihatty2014年05月06日 14:58:28 +00:00Commented May 6, 2014 at 14:58
-
Sadly the official Arduino GSM shield is now discontinued.Hamish_Fernsby– Hamish_Fernsby2018年05月09日 10:05:43 +00:00Commented May 9, 2018 at 10:05
I ended up ordering an Elechouse board which uses the M10 chip. Found one on eBay for 59 USD. It appears to work fine with the official library.
As the manual says, it must be given external power - the USB cable isn't enough!
-
did you find the elechouse board reliable, does it send/receive gprs ok?Hamish_Fernsby– Hamish_Fernsby2018年05月09日 10:22:54 +00:00Commented May 9, 2018 at 10:22
-
Is 2G supported in your country? At least in europe there are plans to switch off the 2G network and the module you chosen does not support 3Ggabonator– gabonator2018年05月09日 15:53:25 +00:00Commented May 9, 2018 at 15:53
LinkitOne - ok not a shield but rather a compatible Arduino controller board with built-in GSM/GPRS/GPS/Wifi. comms library doesn't have as many diagnostic methods as e.g. the Adafruit one, but it was easy to setup and reliable. Main downside of the LinkitOne was that it uses a different processor from Arduinos so many of the Arduino libraries aren't compatible e.g. for I2C devices.
Adafruit Fona SIM808 2G Shield version. shield layout but stackable headers have to be bought and soldered seperately. Default pinouts work with Uno, but mods required for Mega. Library has lots of handy diagnostic methods (battery voltage, signal strength, etc). worked with giffgaff prepaid SIM but not vodafone for some reason. SMS worked ok. I could connect to GPRS but getting html from a website didnt' work.
DFRobot SIM808 GPS/GPRS/GSM Shield - Pre wired wirth stackable shield connectors, instructions to upload code and run the device are convoluted and vague. I Wasn't even able to get a basic connection to the Arduino to work. Either the library is very buggy or my device was faulty.
SEEEDStudio 113030009 GPRS Shield with Antenna and External SIM Holder V3.0 I'll probably tets this next..
Official Arduino GSM board DISCONTINUED
Sparkfun GSM/GPRS Module - SM5100B DISCONTINUED