Remote logging of data using Arduino

I have the following requirements for a project on remote logging of sensor data:

  • The sensor data is collected from sensors every n seconds/minutes (temperature and humidity for now)
  • The data is stored locally in a storage medium such as SD Card.
  • The data also needs to be sent to server through a GSM connection.
  • Any large deviation of data triggers an alert and sends an SMS.
  • Parameters like frequency of data logging, SMS alert number, alert criteria, etc. can be configured.
  • Configuration modification should be possible through SMS as well.
  • In case of any failures with sensor, send SMS alert and log data (locally and remote)
  • (Optional) Query the account balance/remaining data/SMS quota and validity dates along with space crunch in Micro SD card and send out alert SMS.
  • (Optional) Code should be easily extensible in case other sensors need to be added.
  • (Optional) Support for power profiles i.e. separate configuration if running on battery power

I have the following hardware in mind:

  1. Arduino Mega 2560
  2. GSM Shield
  3. Sensors
  4. Micro SD Card adapter for arduino
  5. Power supply + rechargeable battery (power connection may be unreliable)
  6. I/O devices i.e. LCD screen + keypad input

Note that there will be no provision of internet connectivity through LAN or WiFi. The only point of connection is cellular signal. It is assumed that SMS and GPRS connectivity is enabled for the SIM card used for connectivity. The remote data is sent to a server which accepts data via REST APIs (simple URL based GET requests).

How should I go about achieving it? From what I see, there will be quite a bit of code involved. If I cannot fit the code in onboard ROM, can I have the code in the Micro SD Card instead and execute on demand basis ? Also, how do you send a GET request to a URL through AT commands? (Is it possible at all?) Also it is possible to get carrier account specific information like SMS balance using AT commands?

This is a very large project, but most of it has been done before.
Examples are posted on the web, google "arduino sms data logger".

Here's the hardware (IoT PLC) that I'm using for a current project. I am no where near having the ability to program the remote logging yet, but it's something I hope to do in the future. I will be following your thread.