Building a GPS tracking beacon

Building a GPS tracking beacon

Some time ago, we did an experiment that might interest you. Its goal was to check the behavior of the YoctoHub-GSM-3G-EU when it switches from one provider to another one in roaming. We therefore needed a moving YoctoHub-GSM, so we created an autonomous GPS tracking beacon that communicates by GSM.

The idea was to put the beacon in a car and see what happens when the car moves. To limit the GSM costs, we obviously didn't want the beacon to send data too often when the car was parked. We solved this issue thanks to the wake up functions of the YoctoHub-GSM-3G-EU.

The principle

We used a Yocto-GPS and a Yocto-Knob connected to a YoctoHub-GSM-3G-EU.

  • We used the Yocto-GPS to know the position and the speed of the car.
  • We used the YoctoHub-GSM-3G-EU for communication purposes. It is powered by a USB battery. It is always powered when the car is running, but is sleeping most of the time when the car is parked.
  • We used the Yocto-Knob to know if the car was running or not.

The system is powered through a cigar lighter socket in the car. This socket is powered only when the car is running. The 12V from the car is converted into 5V thanks to a DC/DC converter and is used to :

  • Recharge the USB battery when the car is running.
  • Switch a DPST relay of which the outputs are connected to the Yocto-Knob and to "wake-up" input of the YoctoHub-GSM-3G-EU.

We also configured the hub so that, whatever happens, it automatically wakes up every four hours.

The beacon diagram
The beacon diagram

This architecture enables two working modes:

  • When the car is parked, the hub is powered by the USB battery. It automatically wakes up every 4 hours, sends its data on the server. The later records the GPS data, and knowing that the car is parked thanks to the Yocto-Knob, tells the hub to go back to sleep.
  • When the car is started, the relay switches and the YoctoHub-GSM-3G-EU has to wake up because its wake-up input is connected to the relay. The hub then starts posting its data on the server. Still thanks to the Yocto-Knob, the server knows that the car is running and keeps the hub on. This allows the later to go on posting its data at a regular interval. When the car is parked again, the server notices it and tells the hub to go back to sleep.

To avoid uselessly emptying the battery when there is no GSM network available, the hub is configured to go to sleep on its own after a few minutes when the car is parked.


We could have interconnected everything and dumped it as-is in the car, but we preferred to make something clean and easy to handle.

The standard Yoctopuce modules used at the heart of this experiment
The standard Yoctopuce modules used at the heart of this experiment

We gathered the converter, the relay, a fuse, and a large diode on a small PCB created for this purpose. The fuse and the diode are used as a protection against handling errors: no one wants a short-circuit in a car. We also created a small PCB to move the hub USB port to the front panel. We didn't want to have to disassemble the system each time there was a configuration modification.

The power board, the remote USB port, and the USB battery
The power board, the remote USB port, and the USB battery

We mounted everything on two acrylic glass panels. One for the power supply part, the other for the true electronics part. And we made everything fit into a nice 14x11x6cm enclosure.

The complete electronics   The enclosure, power supply side
The complete beacon
The enclosure, antennas and USB port side

For the antenna, we used a combined GSM/GPS antenna with a very long wire allowing us to put it either under the windshield or under the rear window. It is indeed essential that the antenna "see" the sky for a good GPS reception.

A combined GSM + GPS antenna
A combined GSM + GPS antenna

Does it work?

It even works amazingly well. We based the visualization on Google Maps, which enabled us to easily obtain a map with a red dot marking each location from where the YoctoHub sent its position.

We based the visualization on Google Maps
We based the visualization on Google Maps

We even filmed a short video to show it to you:


To be completely frank, we had to do a little staging to make this video more interesting than a single red dot moving on a map. Views from the car cameras and the red dot on the map correspond to a single run, but the aerial views were taken during a second run.

You can download here the PHP script managing the system, the detailed instructions to install it on a PHP server are in the code header. We tried to make it as simple as possible to use. In a few words, copy the script in a directory of the PHP server, point the hub callback on this script, and open the URL of this same script with a browser.

Possible improvements

The script simply records the car GPS data as well as numerous parameters linked to the GSM connection. But we could improve it so that it would do more, such as send an alert when the car that you thought you had parked in the street moves out of a specified perimeter.
Note that we used only two ports of the YoctoHub-GSM-3G-EU. One remains free. We could very well connect a Yocto-Temperature to know the temperature in the enclosure. We could also use a Yocto-3D to know the lateral acceleration during turns... and send an alert when the car is upside-down :-)

Add a comment No comment yet Back to blog

Yoctopuce, get your stuff connected.