Introduction: GPS and Vehicle Motion Tracker IoT Smart Logger for TTGO T-call (SIM800L, UBlox NEO-7M, ESP32)

One day you find that you have one of those TTGO t-call modules laying around. So like me, you wonder, Why not to make something cool, practical and useful? Joining these two bits together they can be used as a simple GPS tracker, or as a more complete IoT logger with GPS position as well as vehicle's accelerations and angular rates.

All the logged data can be either saved into a micro SD card that you can then read and post-process in your PC or it can be broadcast to a could server that you can access from any PC or mobile device like a smart phone or a tablet (or both things at the same time).

NOTE: The shared code is just a simple example, but it can be as complicated as you want to develop if you require certain functionality not covered by this example.

Step 1: Prerequisites

IoT Smart Logger module

  • Integrates Ublox NEO7M for GPS/GLONASS positioning and 6 DoF IMU sensor.
  • Includes external active GPS antenna and connector.
  • ebay example link:

IoT Smart Logger Module

TTGO t-call ESP module

  • Integrates ESP32 with SIM800L with GSM/GPRS capability.
  • Includes GSM antenna and battery power supply wiring, tipically
  • ebay example link:

TTGO t-call ESP32 Module

Nano SIM card

Micro SD card

Arduino IDE

Arduino IDE Download

Blynk App

BLYNK App

UBlox U-Center Software + USB to TTL adapter

  • This step is only needed in case you want to change the frames that the UBlox module transmits through the serial Tx/Rx. Also things like the transmitting rate can be changed, as I've observed during my experiments, to up to 200 ms

UBlox U-Center Software Download

Affordable USB to TTL Adapter

Step 2: IoT Concept With BLYNK

(image from: http://docs.blynk.cc/)

From blynk.io:

"Blynk is a hardware-agnostic IoT platform with white-label mobile apps, private clouds, device management, data analytics, and machine learning."

App for Android and iOS can be downloaded from blynk web:

https://blynk.io/

...or from the Google Play Store (Android devices) or the Apple Store (iOS devices).

This IoT platform is flexible and easy to use for beginners (also for companies) as there is loads of documentation, forums and support from the Blynk, Arduino and ESP8266/ESP32 communities.

Step 3: TTGO T-call Hardware

(image from: https://www.cnx-software.com/wp-content/uploads/20...)

The TTGO t-call is a low cost platform for enabling IoT on almost anything from sensors to actuators that can be connected via analog ports, digital ports, I2C bus, serial Tx/Rx, and SPI. It is widely used within the developers community to both prototype and implement small series of IoT devices.

Thanks to using the ESP32 in combination with the SIMCOM800L module, applications can be implemented and ran via wireless connectivity:

  • GSM/GPRS
  • Bluetooth
  • WiFi

Step 4: IoT Smart Logger

(image from: https://www.ebay.co.uk/itm/IoT-Smart-Logger-Shield...)

This shield looks like it has been specifically designed for the TTGO t-call module (although I imagine it can be used like any other shield with other modules) and enable GPS/GLONASS positioning as well as IMU accelerations and angular rates in three axis. With these two sensors it is easy to position a moving object (vehicle, bike or even a bicycle) in the map, as well as getting measurements of accelerations and angular rates that can be used for example, to evaluate driver's and vehicle's behaviour behind the wheel or the handlebars (in the case of a bicycle). With these two sensors it is possible to say whether a driver has an aggressive driving style by means of longitudinal and lateral acceleration measurements, for instance.

There is an a with additional 2 pin header for connecting an external magnetometer as slave through a private I2C bus for orientation calculation with sensor fusion algorithms.

There is also another two-pin header for connecting a backup battery to save the GPS settings, in case they have been changed using U-Center software from UBlox. It also allows for GPS hot start.

As per description, the pinout seems very simple and connection with TTGO t-call is straight forward (as per second picture).

It also includes a push-type micro SD slot so that data can be logged either to the SD card or sent to the cloud server (or both at the same time).

It is worth mentioning (it took me some time to find out) that when flashing the code to the ESP32 module through the USB serial, the IoT Smart Logger module has to remain disconnected. This is apparently because of the GPS/GLONASS module using the same serial Tx/Rx as the USB and can conflict between each other whilst flashing the software.

Step 5: UBlox U-Center Software + USB to TTL Adapter

This is the official UBlox software in case you want to test the UBlox NEO 7M standalone and/or change settings.

In reality you can change anything you can imagine. Things like customising the messages transmitted by the GPS module can be changed, or the rate at which it transmits messages. By default this module sends data through serial every second, but it can be updated to up to 200 ms.

In order for you to connect the Ublox module to your PC and with the U-Centre software, you will need one of those tiny and affordable USB to TTL converters.

Here a link of a Youtube video where some hints are given:

UBlox settings update via U-Center

Step 6: The Code

This is a simple example piece of code that you can download to your TTGO t-call (remember to disconnect the IoT Smart Logger module whilst flashing the software):
With this piece of code, the ESP32 module reads the frames from the UBlox module and from the IMU sensor and sends it over GSM/GPRS to BLYNK server to which your mobile phone app is linked to.

This first example does not send data to the SD card. Further releases will have this feature enabled:

Step 7: Setting Up the BLYNK App

This tutorial will not cover this step as there is already existing tutorials very well documented, so lets make others work visible!

For this there is a very good example in the following link:

Setting Up the BLYNK App

Step 8: Further Work

In order for this experiment to work completely autonomously and with a professional finish, there is an enclosure design project undergoing with an integrated battery, which not only allows the device not to depend on a USB charger but it also holds the UBlox GPS settings in case they have been changed using the U-Center software from UBlox. It also enables GPS hot start, so after start-up, the GPS positioning will be completed in a fraction of a second, whilst without the backup battery it can take up to 30 to 60 seconds, depending on GPS satellite visibility.