LoRa stands for Long-Range, and is a radio technology intended and optimized for low-power (often battery-powered) IoT devices. LoRaWAN uses LoRa to communicate small amounts of data in long intervals and in a secure way. LoRa Alliance promotes and specifies LoRa and LoraWAN.
A few LoRa/LoRaWAN characteristics:
- Topology: star
- Range (radius): urban 2-5 km, rural 15-20 km
- Speed: 0.3 kbps to 50 kbps
- Amount: pot. 1000s of nodes per gateway
- Frequency: 868 or 915 MHz
Abiro participated in the evaluation of sensor communication using LoRaWAN in Lund Open City Sensor Network during 2017. It was all about evaluating the possibilities of the technology and learning, but of course with potential commercialization in mind.
We used LoPy from Pycom, that supports LoRa, WiFi and Bluetooth, and has lots of I/O ports for different types of sensors, so they are also applicable for many other applications. We also evaluated Pysense and Pytrack. With a waterproof IP67 case and a LiPo battery, LoPy can be installed in the field with no other equipment needed. Adafruit and others have great boards with integrated LoRa as well.
Listed below is what was done during 2017.
In the simple examples below the RGB LED on LoPy was used to show real-time status, and in some cases data was sent via LoRa to Abiro IoT, a logger and visualizer for IoT data.
Note the 1200 mAh LiPo batteries in some of the examples, that are charged via USB. That said, LoPy currently draws too much current to run on such a battery for a longer time (even if entering deep sleep mode) due to a design flaw in the hardware.
- LoRa communication 1
- LoRa communication 2
- Measure distance and speed
- Measure moisture
- Detect beacons
LoRa communication 1
Here data is sent between two LoPy:s via LoRa (raw data). The data is changed continuously and checked, to see that what’s sent is actually received.
LoRa communication 2
Here two LoPys are individually communicating with a LoRa gateway almost a kilometer away (see the map below). They are joining via OTAA and sending a small packet of data every 10 minutes (the regulated limit is each 5 minutes). One of the LiPo batteries broke, hence the power pack. After the photo was taken the code was changed to go into “deep sleep” after sending each packet, to save on the battery. Data is collected by a system, and then interpreted and presented via Abiro IoT.
Measure distance and speed
This “space monster” measures distance and speed via ultrasound. Not 100% reliable, as timing in the LoPy (or rather Python) is a bit iffy, but with some averaging and filtering it’s rather accurate. Speed is calculated from two qualified distance measurements and some filtering, and number of passing objects is counted, to generate highest/lowest/average speed that could be remotely logged (remains to do). A Doppler radar would be much better for this purpose, but this is relatively speaking a power-efficient and low cost solution. As the LoPy needs to capture echoes continuously, it can never be put in deep sleep.
A simple resistive moisture sensor has been attached, to see that analog values can be read in via an analog-to-digital port and processed for a real-life scenario. This actually has an immediate practical use, as seen in the photo. The moisture level is sent via LoRa and tracked via Abiro IoT.
This example listens for BLE beacons (iBeacon) and determines the identity of respective beacon. This is done to investigate a real-life use case involving equipment with attached beacons, for tracking them indoors.
- Make LoPy act as configurable iBeacon and Eddystone beacons. Result: success for both.
- Use Pysense as a basic weather station. Result: had to rewrite the Pycom sensor classes (very buggy) and temperature measurement didn’t work due to being heated up by the LoPy. Humidity gave slightly wrong value. Pressure, acceleration and probably also light gave correct values when using fixed code.
- Use Pytrack for location. Result: acceleration worked (same chip as in Pysense), but GPS didn’t lock despite being outside.
Pysense and Pytrack will be further investigated, and Pycom will surely provide code fixes over time.