Creating another TTN Mapper node with a Heltec LoRa32 v2

For my Gold DofE practice expedition I used the school’s Things Uno board to make a Things Network node that transmits its GPS coordinates. These GPS coordinates can then be received by gateways, and from there they are used to map the coverage of the Things Network, a free-to-use radio network designed for low power Internet of Things devices.

However, the Things Uno has a built-in antenna and no external antenna connector, so the signals it transmits are quite weak. Thus, for my qualifying expedition I wanted to build another node with an external antenna so that there was a better chance of the packets being received.

I had a Heltec Wifi LoRa32 board that was originally intended to be a single channel gateway. However, I’ve been borrowing one of the school’s proper gateways for my own purposes, so the board wasn’t being used. I decided to repurpose it as the new TTN Mapper node. It also has a display which is useful as it allows me to check whether it’s actually working or not.

I took the NEO-6M GPS module from the old node and wired it to the LoRa32 on some matrix board. I also added in a power switch and three switches to configure the device.

The first switch controls whether the node transmits its GPS coordinates or just an empty packet. The empty packet is useful when you’re using the TTN Mapper app to obtain GPS coordinates from a phone instead of from the device. The other two switches control how often it transmits. Starting with a base value of 10, the first switch multiplies it by 1 or 2, and the second by 1 or 4. Therefore, by toggling the switches it is possible to make it transmit every 10 (10*1*1), 20 (10*2*1), 40 (10*1*4) or 80 (10*2*4) seconds.

Although I was able to reuse the code for obtaining data from the GPS module, encoding it in a packet and decoding the packet on the receiving side, I had to redo the rest of it because the board uses a different radio chip to the Things Uno, which meant I had to use the LMIC library. I created the program in PlatformIO in a mad rush on the nights between the CanSat launches and the expedition.

Miraculously I managed to get it all working in time. However, I didn’t have time to make a proper box so it ended up in a Chinese takeaway box again.

The mapper out in the wild

On the first day of the expedition I was using a poor quality antenna that came with the LoRa32 module. I replaced the antenna in the evening but broke the power cable, which meant there was no mapping on the second day. However, after soldering the cable back on in the evening, the mapper’s transmissions were picked up on the third day:

The gateway that received signals was around 42km away
The points from which the GPS coordinate transmissions were received

Then on the fourth day it was very wet so I didn’t bring the mapper.

The OLED display of the device shows the current time according to GPS, the accuracy of the location fix and the satellite count. At some points the node was in range of 12 satellites!

After the expedition I wanted to upgrade the node’s box because apparently it looked a bit like a bomb and it wasn’t very compact. I designed an enclosure using TinkerCAD and 3D printed it.

The box
The lid

The 18650 battery goes in the curved area, the hole in the side is for the SMA connector and the big hole in the back is for access to the switches. I also added hexagonal holes in the bottom and the top lid to let heat out, and a hole in the lid so that you can see the display.

The finished product without the lid. The power switch is hidden under the overhang of the LoRa32.

To test it out I took it with me when we went to Aberystwyth.

TTN Mapper by the sea

Two of the packets were received by a gateway in Pwllheli, 56km away!

I’ve enjoyed upgrading my TTN Mapper node and I’m going to be using it in future when I travel around. It’s also been useful because it’s proved that LMIC can work with low power sleep, and that’s something I have to do to upgrade the air quality monitor.

Leave a comment

Design a site like this with WordPress.com
Get started