Tag Archives: teensy

GPS-enabled LoRaWAN temperature sensor

Together with the TTN Nijmegen community we are discussing possible applications of remote sensing nodes in Nijmegen. To get a better view on the TTN coverage in Nijmegen and to get a feel for what works (and what not), we are working on the implementation of some nodes.

The PoC2 TTN gateway will soon be installed by Michiel Nijssen at Maptools in Molenhoek. To help Michiel get started, we agreed that I would give him a fully functional node to play with. Michiel came up with a very concrete idea: it consists of a GPS-enabled temperature sensor that sends the data over LoRaWAN/TTN. Below you can find some details of a very fist implementation.

The node consists of

  • Teensy 3.2 MCU board
  • Dorji LoRa module
  • DS18b20 temperature sensor
  • Ublox NEO-M8N GPS module
  • 4k7 ohm resistor
  • small LED and 200 ohm resistor (not on photo)

I estimate that the material costs amount to 50 euro. It still needs to be soldered in a more sturdy form-factor and a battery and enclosure need to be added.

I created a corresponding application on console.thethingsnetwork.org where I configured the node with APB.

The node is running a sketch (i.e. firmware) that I developed in the Arduino IDE. On the receiving side side I am using a node.js application, which uses MQTT to connect with TTN and to receive the messages. The receiving application also implements a simple web interface that displays the most recently received data. The receiving application is running on a Raspberry Pi in my basement.

The Arduino code for the teensy can be found in my arduino repository on github in the teensy_gps_temp_ttn directory.

The node.js code for the receiving application can be found in its own repository on github.

The web interface can be found on gpstemp.robertoostenveld.nl. Note that I might not keep this particular web application running for very long, so don’t be surprised if the URL stops working. To check that it is displaying live data, you can reload ever 10 seconds or so. The counter should increase, and the numbers might be a bit different.

Bidirectional communication over The Things Network

I have been experimenting today with an RFM95W hooked up to a Teensy and managed to implement full bidirectional communication to/from The Things Network.

The Teensy by default sends the temperature (from a ds18b20) with every transmit. If you press the button, it sends the button press event instead. Furthermore, on every transmit it listens for a message (which can be scheduled downlong through the TTN dashboard), and blinks the led if a message is received.

The Arduino code running on the Teensy can be found here and the server application code running on the Raspberry Pi here.

Still to be done is to extend the server application code with the button (to circumvent the TTN dashboard alltogether) and to come up with an actual application that is smarter than a button and a LED. I am thinking to link both up and downlink to an IFTTT maker channel.

teensy_app2