ESP32 Publish Data to Cloud without Wi-Fi (TTGO T-Call ESP32 SIM800L)
Connect the ESP32 with SIM800L TTGO T-Call board to the Internet using a SIM card data plan and publish data to the cloud without using Wi-Fi (Arduino IDE).
- Suitable forB.Tech/Diploma IoT/ESP32 students
- Build time1-2 weeks
- LevelIntermediate
- Available atAjvika Labs, Kakinada
About this project
This project shows how to connect the TTGO T-Call ESP32 SIM800L board to the Internet using a SIM card data plan and publish data to the cloud without using Wi-Fi. We’ll program this board with Arduino IDE.
Introducing the TTGO T-Call ESP32 SIM800L
The TTGO T-Call is a new ESP32 development board that combines a SIM800L GSM/GPRS module.
You can get if for approximately $11
Besides Wi-Fi and Bluetooth, you can communicate with this ESP32 board using SMS or phone calls and you can connect it to the internet using your SIM card data plan. This is great for IoT projects that don’t have access to a nearby router.
Important:
the SIM800L works on 2G networks, so it will only work in your country, if 2G networks are available. Check if you have 2G network in your country, otherwise it won’t work.
To use the capabilities of this board you need to have a nano SIM card with data plan and a
USB-C cable
to upload code to the board.
The package includes some header pins, a battery connector, and an external antenna that you should connect to your board.
However, we had some issues with that antenna, so we decided to switch to another type of antenna and all the problems were solved. The following figure shows the new antenna.
Project Overview
The idea of this project is to publish sensor data from anywhere to any cloud service that you want. The ESP32 doesn’t need to have access to a router via Wi-Fi, because we’ll connect to the internet using a SIM card data plan.
In a previous project
, we’ve created our own server domain with a database to plot sensor readings in charts that you can access from anywhere in the world.
In this project, we’ll publish sensor readings to that server. You can publish your sensor readings to any other service, like ThingSpeak, IFTTT, etc…
If you want to follow this exact project, you should
follow that previous tutorial first
to prepare your own server domain. Then, upload the code provided in this project to your ESP32 board.
In summary, here’s how the project works:
The T-Call ESP32 SIM800L board is in deep sleep mode.
It wakes up and connects to the internet using your SIM card data plan.
It publishes the sensor readings to the server and goes back to sleep.
In our example, the sleep time is 60 minutes, but you can easily change it in the code.
We’ll be using a
BME280 senso
r, but you should be able to use any other sensor that best suits your needs.
Hosting Provider
If you don’t have a hosting account, I recommend
Prerequisites
1. ESP32 add-on Arduino IDE
We’ll program the ESP32 using Arduino IDE. So, you need to have the ESP32 add-on installed in your Arduino IDE. Follow the next tutorial, if you haven’t already.
Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
2. Preparing your Server Domain
In this project we’ll show you how to publish data to any cloud service. We’ll be using our own server domain with a database to publish all the data, but you can use any other service like ThingSpeak, IFTTT, etc…
If you want to follow this exact project, you should follow the next tutorial to prepare your own server domain.
Visualize Your Sensor Readings from Anywhere in the World (ESP32 + MySQL + PHP)
3. SIM Card with data plan
To use the TTGO T-Call ESP32 SIM800L board, you need a nano SIM card with a data plan. We recommend using a SIM card with a prepaid or monthly plan, so that you know exactly how much you’ll spend.
4. APN Details
To connect your SIM card to the internet, you need to have your phone plan provider APN details. You need the domain name, username and a password.
In my case, I’m using vodafone Portugal. If you search for
GPRS APN settings
followed by your phone plan provider name, (in my case its: “
GPRS APN vodafone Portugal
”), you can usually find in a forum or in their website all the information that you need.
I’ve found
this website
that can be very useful to find all the information you need.
It might be a bit tricky to find the details if you don’t use a well known provider. So, you might need to contact them directly.
5. Libraries
You need to install these libraries to proceed with this project:
Adafruit_BME280
Adafruit_Sensor
and
TinyGSM
. Follow the next instructions to install these libraries.
Installing the Adafruit BME280 Library
Open your Arduino IDE and go to
Sketch
>
Include Library
>
Manage Libraries
. The Library Manager should open.
adafruit bme280
” on the Search box and install the library.
Installing the Adafruit Sensor Library
To use the BME280 library, you also need to install the
Adafruit_Sensor library
. Follow the next steps to install the library in your Arduino IDE:
Go to
Sketch
>
Include Library
>
Manage Libraries
and type “
Adafruit Unified Sensor
” in the search box. Scroll all the way down to find the library and install it.
Installing the TinyGSM Library
In the Arduino IDE Library Manager search for
TinyGSM
. Select the TinyGSM library by Volodymyr Shymanskyy.
After installing the libraries, restart your Arduino IDE.
Parts Required
To build this project, you need the following parts:
TTGO T-Call ESP32 SIM800L
USB-C cable
Antenna
(optional)
BME280 sensor module
(
Guide for BME280 with ESP32
)
Breadboard
Jumper wires
You can use the preceding links or go directly to
MakerAdvisor.com/tools
to find all the parts for your projects at the best price!
Schematic Diagram
Wire the BME280 to the T-Call ESP32 SIM800L board as shown in the following schematic diagram.
We’re connecting the SDA pin to
GPIO 18
and the SCL pin to
GPIO 19
. We’re not using the default I2C GPIOs because they are being used by the battery power management IC of the T-Call ESP32 SIM800L board.
Code
Copy the following code to your Arduino IDE but don’t upload it yet. First, you need to make some modifications to make it work.
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
// Your GPRS credentials (leave empty, if not needed)
const char apn[] = \"\"; // APN (example: internet.vodafone.pt) use https://wiki.apnchanger.org
const char gprsUser[] = \"\"; // GPRS User
const char gprsPass[] = \"\"; // GPRS Password
// SIM card PIN (leave empty, if not defined)
const char simPIN[] = \"\";
// Server details
// The server variable can be just a domain name or it can have a subdomain. It depends on the service you are using
const char server[] = \"example.com\"; // domain name: example.com, maker.ifttt.com, etc
const char resource[] = \"/post-data.php\"; // resource path, for example: /post-data.php
const int port = 80; // server port number
// Keep this API Key value to be compatible with the PHP code provided in the project page.
// If you change the apiKeyValue value, the PHP file /post-data.php also needs to have the same key
String apiKeyValue = \"tPmAT5Ab3j7F9\";
// TTGO T-Call pins
#define MODEM_RST 5
#define MODEM_PWKEY 4
#define MODEM_POWER_ON 23
#define MODEM_TX 27
#define MODEM_RX 26
#define I2C_SDA 21
#define I2C_SCL 22
// BME280 pins
#define I2C_SDA_2 18
#define I2C_SCL_2 19
// Set serial for debug console (to Serial Monitor, default speed 115200)
#
Introducing the TTGO T-Call ESP32 SIM800L
The TTGO T-Call is a new ESP32 development board that combines a SIM800L GSM/GPRS module.
You can get if for approximately $11
Besides Wi-Fi and Bluetooth, you can communicate with this ESP32 board using SMS or phone calls and you can connect it to the internet using your SIM card data plan. This is great for IoT projects that don’t have access to a nearby router.
Important:
the SIM800L works on 2G networks, so it will only work in your country, if 2G networks are available. Check if you have 2G network in your country, otherwise it won’t work.
To use the capabilities of this board you need to have a nano SIM card with data plan and a
USB-C cable
to upload code to the board.
The package includes some header pins, a battery connector, and an external antenna that you should connect to your board.
However, we had some issues with that antenna, so we decided to switch to another type of antenna and all the problems were solved. The following figure shows the new antenna.
Project Overview
The idea of this project is to publish sensor data from anywhere to any cloud service that you want. The ESP32 doesn’t need to have access to a router via Wi-Fi, because we’ll connect to the internet using a SIM card data plan.
In a previous project
, we’ve created our own server domain with a database to plot sensor readings in charts that you can access from anywhere in the world.
In this project, we’ll publish sensor readings to that server. You can publish your sensor readings to any other service, like ThingSpeak, IFTTT, etc…
If you want to follow this exact project, you should
follow that previous tutorial first
to prepare your own server domain. Then, upload the code provided in this project to your ESP32 board.
In summary, here’s how the project works:
The T-Call ESP32 SIM800L board is in deep sleep mode.
It wakes up and connects to the internet using your SIM card data plan.
It publishes the sensor readings to the server and goes back to sleep.
In our example, the sleep time is 60 minutes, but you can easily change it in the code.
We’ll be using a
BME280 senso
r, but you should be able to use any other sensor that best suits your needs.
Hosting Provider
If you don’t have a hosting account, I recommend
Prerequisites
1. ESP32 add-on Arduino IDE
We’ll program the ESP32 using Arduino IDE. So, you need to have the ESP32 add-on installed in your Arduino IDE. Follow the next tutorial, if you haven’t already.
Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
2. Preparing your Server Domain
In this project we’ll show you how to publish data to any cloud service. We’ll be using our own server domain with a database to publish all the data, but you can use any other service like ThingSpeak, IFTTT, etc…
If you want to follow this exact project, you should follow the next tutorial to prepare your own server domain.
Visualize Your Sensor Readings from Anywhere in the World (ESP32 + MySQL + PHP)
3. SIM Card with data plan
To use the TTGO T-Call ESP32 SIM800L board, you need a nano SIM card with a data plan. We recommend using a SIM card with a prepaid or monthly plan, so that you know exactly how much you’ll spend.
4. APN Details
To connect your SIM card to the internet, you need to have your phone plan provider APN details. You need the domain name, username and a password.
In my case, I’m using vodafone Portugal. If you search for
GPRS APN settings
followed by your phone plan provider name, (in my case its: “
GPRS APN vodafone Portugal
”), you can usually find in a forum or in their website all the information that you need.
I’ve found
this website
that can be very useful to find all the information you need.
It might be a bit tricky to find the details if you don’t use a well known provider. So, you might need to contact them directly.
5. Libraries
You need to install these libraries to proceed with this project:
Adafruit_BME280
Adafruit_Sensor
and
TinyGSM
. Follow the next instructions to install these libraries.
Installing the Adafruit BME280 Library
Open your Arduino IDE and go to
Sketch
>
Include Library
>
Manage Libraries
. The Library Manager should open.
adafruit bme280
” on the Search box and install the library.
Installing the Adafruit Sensor Library
To use the BME280 library, you also need to install the
Adafruit_Sensor library
. Follow the next steps to install the library in your Arduino IDE:
Go to
Sketch
>
Include Library
>
Manage Libraries
and type “
Adafruit Unified Sensor
” in the search box. Scroll all the way down to find the library and install it.
Installing the TinyGSM Library
In the Arduino IDE Library Manager search for
TinyGSM
. Select the TinyGSM library by Volodymyr Shymanskyy.
After installing the libraries, restart your Arduino IDE.
Parts Required
To build this project, you need the following parts:
TTGO T-Call ESP32 SIM800L
USB-C cable
Antenna
(optional)
BME280 sensor module
(
Guide for BME280 with ESP32
)
Breadboard
Jumper wires
You can use the preceding links or go directly to
MakerAdvisor.com/tools
to find all the parts for your projects at the best price!
Schematic Diagram
Wire the BME280 to the T-Call ESP32 SIM800L board as shown in the following schematic diagram.
We’re connecting the SDA pin to
GPIO 18
and the SCL pin to
GPIO 19
. We’re not using the default I2C GPIOs because they are being used by the battery power management IC of the T-Call ESP32 SIM800L board.
Code
Copy the following code to your Arduino IDE but don’t upload it yet. First, you need to make some modifications to make it work.
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
// Your GPRS credentials (leave empty, if not needed)
const char apn[] = \"\"; // APN (example: internet.vodafone.pt) use https://wiki.apnchanger.org
const char gprsUser[] = \"\"; // GPRS User
const char gprsPass[] = \"\"; // GPRS Password
// SIM card PIN (leave empty, if not defined)
const char simPIN[] = \"\";
// Server details
// The server variable can be just a domain name or it can have a subdomain. It depends on the service you are using
const char server[] = \"example.com\"; // domain name: example.com, maker.ifttt.com, etc
const char resource[] = \"/post-data.php\"; // resource path, for example: /post-data.php
const int port = 80; // server port number
// Keep this API Key value to be compatible with the PHP code provided in the project page.
// If you change the apiKeyValue value, the PHP file /post-data.php also needs to have the same key
String apiKeyValue = \"tPmAT5Ab3j7F9\";
// TTGO T-Call pins
#define MODEM_RST 5
#define MODEM_PWKEY 4
#define MODEM_POWER_ON 23
#define MODEM_TX 27
#define MODEM_RX 26
#define I2C_SDA 21
#define I2C_SCL 22
// BME280 pins
#define I2C_SDA_2 18
#define I2C_SCL_2 19
// Set serial for debug console (to Serial Monitor, default speed 115200)
#
Technologies used
Hardware components
- ESP32
- Arduino
- BME280
- SIM800
Software & tools
- Arduino IDE
- ThingSpeak
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.