Close
0%
0%

Remote data collection using free GPRS

Hologram offers 1M bytes of free GPRS data per month. This project shows how this can be used to remotely collect data.

Similar projects worth following
A friend told me that his boat's solar panels failed to charge the batteries, resulting in 3 badly damaged batteries. I had been looking for an excuse to try out Hologram's offer of 1M byte of free data per month over 2G/3G/4G. I also had a SIM800L GSM/GPRS module lying around. So I offered to build a remote monitoring system to report the battery voltage very hour.
This project describes how to collect the battery voltage, but any other data could be collected with very little modification.
An overview of the solution is...
- An Arduino measures the battery voltage and uses the SIM800L to send the data to the internet.
- The SIM800L provides the GPRS data connection to the internet.
- A free web hosting solution is used as the reporting and storage location.
- A PHP program receives the data from the Arduino and stores it in a database.
- A MySQL database is used to store the uploaded data.
- Another PHP program is used to display the data as a simple web page.

This project has been completed and is working perfectly. However, it is taking me some time to upload all of the files, because it is important to remove any personal information. Please be patient...

newdata.php

PHP program to add new data to the database.

application/x-php - 1.09 kB - 10/11/2017 at 12:51

Download

index.html

HTML file to read data from the database.

text/html - 938.00 bytes - 10/11/2017 at 12:51

Download

wiring.png

Wiring diagram.

image/png - 341.38 kB - 10/10/2017 at 15:27

Preview
Download

gprs_data_collector.ino

Arduino code to collect hourly measurements and send them to the internet.

x-arduino - 4.00 kB - 10/10/2017 at 12:46

Download

  • 1 × Arduino I used an Arduino Pro Mini because of its small size, but any Arduino such as a Uno or Mega would be acceptable.
  • 1 × SIM800L Cheap GSM/GPRS module.
  • 1 × Power supply (4 volts) The SIM800L needs 4 volts at 2 amps. Luckily the Arduino will also work on 4 volts.
  • 4 × Resistor (10K) Only needed if you are measuring a voltage. Any resistors in the range 10K to 100K should be acceptable, but all of the resistors should be the same value.

  • System components

    bredman10/16/2017 at 16:08 0 comments

  • System requirements

    bredman10/16/2017 at 16:04 0 comments

    This project has been designed according to the following requirements.

    • The system must remotely collect measurements without any need for a person to visit a location. Therefore, the system must recover from any fault without human interaction. The user interface is very simple, plug it in and walk away.
    • The cost of manufacture should be very low. Therefore, the system is built from cheap components that can be bought from multiple online stores.
    • The cost of operation should be zero. Therefore, this system uses a free cellular data service from Hologram that is available worldwide. Also, the web site is designed to be hosted by a free web hosting provider.
    • Because the free Hologram service is limited to 1M bytes per month, this means that the data usage is limited to 1300 bytes per hour. Therefore, only one effort is made each hour to report a measurement. There is no attempt to retry in case of failure, because this could accidentally exceed the hourly limit.
    • It should be possible to read the measurements without any special effort or training. Therefore, the measurements are presented in a web page which is accessed through any web browser.
    • The system should operate for many years without intervention. Therefore, old data is automatically removed from the database to prevent overflow.

View all 2 project logs

  • 1
    Register for a free web hosting service

    You don't actually need a free web hosting service if you are willing to pay for one. I personally used 000webhost.com, but you can use any web hosting service that provides PHP and MySQL.

  • 2
    Set up a database on your web site

    This example is valid for 000webhost.com, but the procedure should be very similar for any free webhost.

    • Login to the web host admin page.
    • Click on the icon "Manage database".
    • Click on the button "New database".
    • Enter a database name, for example "data" with a username and password for management of this database.
    • You will be shown a list of your databases with the full name, for example id1234567_data. Remember this name, it will be needed later.
    • Beside id1234567_data, click on Manage->PhpMyAdmin to manage the database.
    • Click on the tab "SQL". Paste in the following text (after changing id1234567 to the correct user id) and click "Go".
    -- Create a table "Info" which contains columns "Time" and "Voltage" in database "data"
    -- Remember to change id1234567 to the correct user id
    SET time_zone = "+00:00";
    CREATE TABLE id1234567_data.Info (
      Time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
      Voltage text COLLATE utf8_unicode_ci NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    ALTER TABLE id1234567_data.Info ADD PRIMARY KEY (Time), ADD KEY Time (Time);
    

    If you have any problems, click on the tab "Structure" and enter the above options using the graphical interface.

  • 3
    Upload files to your website

    This example is valid for 000webhost.com, but the procedure should be very similar for any free webhost.

    • Login to the web host admin page.
    • Click on the icon "File Manager".
    • Click on the button "Upload files now".
    • Click on the upload button (up arrow) to upload index.html and newdata.php
    • Right-click on the file .htaccess, select "Edit" and add the following text to the end of the .htaccess file (it allows the PHP in index.html to be executed automatically)
    <Files index.html>
    AddType application/x-httpd-php .html
    Files>

View all 6 instructions

Enjoy this project?

Share

Discussions

aiannar974 wrote 08/02/2019 at 18:45 point

Really nice work.  My projects are always not as neat.  I am going to try this with a project that needs to log texts.

  Are you sure? yes | no

russ wrote 05/28/2019 at 19:32 point

Thank you for sharing this project!   I Currently have a network of 3 cabins, each with their own off-grid solar systems.  I've linked them together via radio with XBEE chips and am logging (5min interval) to an SD card for all the varying statistics.   I have been struggling to move forward with using a cellular modem to push that data to the web - this is the EXACT example I needed to help get me rolling.  I was just going to push the csv file to the web, but I think I'll got the MySQL route now and learn some PHP.

 Thank you!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates