I generally use the Raspberry Pi to receive LoRa transmissions from balloons, and to upload the packets to the HabHub servers. However it sometimes might be more convenient to use a PC or Mac, or a phone or tablet, for internet connectivity, in which case we need some way of interfacing a LoRa module to those devices.
Here I have used an Arduino Mini Pro, connected to the LoRa module via SPI and 2 I/O pins, and using software derived from my Handheld LoRa Receiver to allow control of the module via the Arduino’s serial interface. I’ve built 2 such devices, the first of which connects to a PC via USB, using a Prolific PL2303 USB-serial adapter:
The second device uses the same firmware, but connects to the PC (or Mac, tablet, phone) via bluetooth using a HC-06 bluetooth serial adapter. Power comes from a small LiPo, using a USB charging module.
The firmware handles incoming packets directly, copying them to memory before sending to the host PC or mobile device. It also sends various status values – current RSSI every second, and packet RSSI, SNR and frequency error before each packet. It accepts simple commands to set the LoRa frequency, bandwidth, spreading factor, error coding, packet header type and low data-rate optimisation.
Currently I’ve produced Windows software that communicates with either device using a virtual serial port (USB or Bluetooth), and expect to make that cross-platform soon (OSX, Android, iOS). This program allows the LoRa parameters (frequency, bandwidth, spreading factor etc.) to be set, displays incoming telemetry packets, and optionally uploads those packets to Habitat (so the balloon position is displayed on the live map). SSDV isn’t supported yet.
To make your own device, you will need:
- Arduino Mini Pro
- Programmer for above
- LoRa Module (RFM96 for 868MHz or RFM98 for 434MHz)
- Wire and solder
- SMA Socket
- Suitable case
Plus for the USB version:
- FTDI or Prolific USB-serial adapter
or, for the Bluetooth version:
- HC-06 Bluetooth interface
- LiPo battery
- USB LiPo Charger
- On/Off Switch
Connections from the Arduino to LoRa are described in the firmware. Remember to connect GND on Arduino to GND on LoRa, and Vcc on Arduino to 3.3V on LoRa.
For the serial version, first check if your USB adapter supplies 5V or 3,3V or both; for 5V you need to connect the 5V line to the Arduino “Raw” supply input; for 3.3V connect to the Vcc pin instead. Also, connect 0V/GND from USB adapter to the Arduino GND pin. The USB Tx connects to Arduino Rx, and USB Rx to Arduino Tx.
For the Bluetooth version, the LiPo connects to the Arduino Raw pin via a switch. The Bluetooth device then takes power from the Arduino 3.3V line. Rx/Tx pins connect as above. All GNDs connect together of course, and to the battery -ve wire. The LiPi charger connects to the battery directly.
Download the firmware and program the Arduino with it.
To the USB version to a PC, just plug it in and hope that Windows installs the driver OK; if not then download and install the driver appropriate to your device. Check in Device Manager to see which serial port number it has installed.
For the Bluetooth version, connect and install a USB Bluetooth adapter if one is not already installed. Power on your LoRa/Bluetooth receiver and then search for the bluetooth device in Windows. You should see “HC-06” show up. If you are asked for a PIN number it is 1234. Check in Device Manager to see which serial port number it has installed; if it doesn’t show then be prepared to wait – for some reason it can take several minutes.
If you are using my Windows software, download that to a new folder and just run the .exe file. Choose the serial port that was installed earlier, and within a couple of seconds you should see the “Current RSSI” value start to update. Choose your LoRa settings and click the “Set” button. Once you’ve done that, you should start seeing packets arrive (assuming you have a tracker running using those LoRa settings, of course).