Now there’s a larger coverage area of LoRaWAN in Liverpool that provides free access to the public The Things Network service, it’s the ideal time to start connecting more devices, more sensors, and taking advantage of this long range, low power, low cost way of connecting devices to the internet.
The great Arduino library from The Things Network means that getting started with using LoRaWAN is just a matter of finding coverage and a LoRaWAN modem. At the current time though, the TTN hardware has not started shipping, so we made some LoRaWAN shields, and ran a hackday at DoES Liverpool to get more people connected.
As is traditional in hackdays, progress on the day was captured in a shared document. While the main focus for many was on setting up their first LoRaWAN connection, and finding out how LoRaWAN might fit in with their project ideas, there were some great projects taking shape.
Links to the shared document:
One of my focuses of the day was to complete an initial hello world for those new to Arduino, or those looking for a base to start using LoRaWAN that goes from sensor to online recording.
Using a DS18B20 temperature sensor, take a reading, report it over LoRaWAN to The Things Network (TTN) using the
Cayenne payload structure, set the payload interpreter to
Cayenne, connect to myDevices Cayenne, and create a dashboard to show current temperature.
Device Info sketch for the Uno & shield:
- Make an account on The Things Network,
- go to the TTN console
+ add application
- Application ID (you’ll need to use when you use the application),
- Description (up to you)
- Handler registration to
- From your application page,
+ register device
- Device ID (something you can uniquely identify that radio with),
- Device EUI (reported from the sketch above),
- Then load a basic sketch onto your device to test the data transfer:
- Load the sketch and watch on the serial monitor
- Also watch on the
datatab to see the incoming data
- Add the OneWire and DallasTemperature libraries to the Arduino IDE,
- Connect the
DS18B20sensor to power, ground, and the signal wire to pin
D6on the arduino (or another of your choice),
- connect a
4.7kresistor between power and the signal line (this is requred for proper opperation of the sensor, but in a pinch you’ll probably get away with two 10k resistors in parallel),
- load the following sketch (after changing the
appKey) to match your application:
- New messages should appear in the application, data on the console with the a
"temperature_1: xx.x"visible in the processed payload,
- In the Things Network Console for your application set the
Payload Formatsto be
- Create an account at myDevices Cayenne
Devices & Wigets→
The Things Network→
- Enter the
Device EUIfrom the TTN console,
- Back on the TTN console for the application →
+ add integration→ choose
- Enter a
Process IDof your choice (anything),
- Select an
Access Key(one of the allowed MQTT passwords on the application to pass to Cayenne)
- Enter a
- New data from this device will automatically propogate to myDevices Cayenne, so entries for
SNRfor this device will appear when it next sends.
- Many attendees found that receiving mesages using node-red provided more flexibility in pricessing and using messages.