Hey gang! Tim here at Core Electronics. Today, we are liberating ourselves from Wi-Fi and cellular internet without losing connectivity. I introduce you to the Things Network and how to send packets of data up to 10 kilometers away with low run long-range radio.
In this guide, we're going to use a Raspberry Pi Pico with a LoRa E5 module to send a hello world. If you stick around long enough, I'm going to demonstrate what kind of data is best sent over LoRa and a plug and play weather station.
This will make it easy for the everyday person to set up and truly flex their connectivity. Mic rugged, responsive, reliable and remarkable low-right is no longer a pipe dream of the future. There is no better time than the present to take the plunge.
This will demonstrate how to connect up a lower E5 module to a Raspberry Pi Pico, then we will set up phony IDE. Following on, we're going to create an account with Things Network. The Things Network is an open source infrastructure that provides a free long-range wide area network.
Next, we're going to register our Edge device with the Things Network. As soon as we do that, we're going to be free to send hello world messages to a LoRaWAN Gateway like the one we have installed at the very top of our building. This will then allow us to display our data on the Things Network dashboard. That data is going to be accessible from any internet connected device anywhere in the globe.
Use the chapters in the description to jump to where you need to be. The where to now is going to be a weather and air quality IoT station set up in a 3D printed and laser-cut case that sends out human readable weather data to the Things Network that runs automatically on boot performing is everything you need to follow along with this electronic recipe. A Raspberry Pi picker here.
I have a Pico W but this can be done with a standard Pico. You're going to need a LoRa E5 module and a PiicoDev LiPo expansion board, as well as some Dupont jumper cables, a data capable micro USB to USB cable, and a desktop computer to program the Raspberry Pi Pico.
Start by setting the Raspberry Pi Pico onto the LiPo expansion board, oriented this way. Then connect the external antenna to the low run module. Be careful as it can break easily, use a flat table to press it in. It will be seated parallel with the PCB board and make it click when connected right.
Finally, we're going to connect wires to the low right E5 module and the PiicoDev expansion board. I'm going to use a breadboard here to make it easier for you to see the pin outs. Plug a red wire into the 5 volt Power Pin and the v-bus PIN. Use a black wire to connect the two ground pins together. Plug a blue wire to the RX pin of the low Ram module to GPIO pin 4 on the Pico. Connect a purple wire to the TX pin on the module to gpio5.
With that complete, all electrical connectors are sorted. Note here if you plan on using this as a portable device powered by a 3.3 volt LiPo battery, connect the red wire instead to the 3v3 pin on the expansion board and a 3v3 pin on the low run module.
With that done, feel free to plug in the Raspberry Pi Pico to a USB port of your computer using a data capable USB micro to USB connector. When you plug in a fresh Raspberry Pi Pico into your computer it will open up a file explorer window as though you are plugging in a USB stick. Holding the button and plug it in to force open this window if that has not happened. If that doesn't work, double check that you are in fact using a data enabled USB cord.
This window informs us that we need to update the firmware of the Raspberry Pi Pico. We will use Micro Python for this. information from our device
We are going to use a Pico W to get the MicroPython firmware file from the website I've linked in the description. To get the scripts running on our Pico, we're going to need to use a python interpreter software. Today, we're going to utilize Thonny IDE. Links to install it can be found down below. Once you've downloaded it, open it up as you would any normal application. With Thonny IDE open, we now want to directly communicate with it through Thony. To do so, focus attention to the top toolbar, then click on 'Run' underneath. Here, click on 'Select Interpreter'. We now have the Thonny Option window open and focused in the Interpreter tab. Choose 'Micropython Raspberry Pi Pico' in the first drop down menu, then in the next drop down window select the USB serial device port that you have connected your Raspberry Pi Pico to.
At this point, it's time to set up our LoRa device and the Things Network. Keep in mind your system needs to be within range of a low ride Gateway device for this to work correctly. Check the coverage map provided by the Things Network to confirm this. As you can see, we have a Gateway on the roof right here at Core Electronics. Anyone in the general public can use this to transmit data completely free of charge.
Now it's time to create an account with the Things Network. This is going to facilitate gathering information from our device. To continue forwards, download from the download section at the bottom of my full written up article the zip file which contains all the scripts that we're going to need. Unzip the file in an appropriate location - the desktop is perfectly fine. Using the left section of Thonny IDE, navigate it to focus on the location where you unzipped those files.
Our data is now in the IoT space. It's a very standard account making procedure, so follow through with me now and fill it with your details. To do so, with your account sorted and signed in, we can now access the console of the Things Network. From here, click on 'Go to Applications' and then click on 'Create an Application'. Fill out a unique application ID for your LoRaWAN system, an easy to understand application name and fill out an appropriate description. Then click 'Create Application'.
When your screen looks like mine, we're going to click the 'Register a Device' button. Now we've reached this point, we're going to click on 'Enter End Device Specifications Manually' and for Australia, we're going to fill it out like so: FSB2 used by TTN, Specifications 1.02 and Regional Parameters 1.02 Revision B. Then we're going to see this Join EUI number. What we're going to do now is we're going to jump into the Arduino IDE, select the script named 'LoRa Transmit Data.py' and run it by pressing the green button just like before.
This script has provided us with two special numbers. These numbers we're going to use to fill out the following The Things Network form. I have it set up now so you can see both windows simultaneously. We need to enter the Join EUI number and here is the Join EUI number. We're going to copy that over. Now we see that it needs a Dev EUI number. Here is the Dev EUI number. I'm going to copy that and we're going to paste it over here. Now you can see we're going to need an App Key. What I want you to do right now is press 'Generate'. Having done that, copy it and keep it in your clipboard. It produces an End Device ID automatically for us. Be aware that you should keep all of these numbers private, but for today's tutorial use, I have decided to show you exactly all the values so you can follow along. These are required so.
We can get information from our specific device in a safe and scalable manner with that complete click the register end device button. Now switch into funny IDE, ate that unique app key and paste it into the LoRa transmit data.poi script. Also uncomment this line, save it and run this exact same updated script again by pressing the green run button.
As soon as you run the code, you're going to see the shell is spitting out more information than last time. In fact, you're going to be receiving two data packets to your application dashboard in the things network. If you made it this far, know that this is huge. You have just transmitted data from an edge device through the lower spectrum as a chirp radio wave signal that has then been received by a low rug gateway which was then pumped and decoded into the internet facilitated by the things network. All that results in us now seeing this data displayed into our things network dashboard all within seconds. It's extraordinary and even better yet, it's free.
If you click on live data, you can see it in all its glory. That is the two data packets right there. So let's now see what those two data payloads set. Analyzing them, we can see that the second payload sent is the value 0 to 9 followed by the letters A through to F. Ellowed 1 on the other hand is an interesting one. It is a hidden message that has been encoded with a hexadecimal value. Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits. So let us jump into an online hexadecimal to string converter to decode it for us.
There's our string. I click convert and here's the reveal: a beautiful hello world message. If you see this message, know that all systems are a go. You now have an IoT LoRa Pico. Now if you actually wanted to send a different message.
I'll show you exactly how to do so. Come into the script in funny IDE, scroll all the way down to the bottom and then you're going to see these send example data. We wanted to change that hello well to something else, simply do so, save your script and run it just like before.
To push this Hardware to the next level, I present to you the following: a Raspberry Pi Pico low Varan capable weather and air quality iot station situated inside a 3D printed and laser cut case. So let me be clear, as soon as this system is powered, it's going to accurately measure temperature, humidity and air pressure, provide an air quality index number and measure the volatile organic compounds and carbon dioxide amounts in its direct environment. It does this thanks to the bme-280 and ens 160 sensors of the picodep module. Then, in a blink of an eye, it's going to transmit that data to a low RAR Gateway.
This data gets intercepted by the mighty things Network and uploaded to the internet to be easily observed by any internet connected device. And best of all, thanks to the uploaded payload formatter written in JavaScript, the data is human readable. I've zoomed in a little bit so you can see better. Right here is our payload and you can see we have an air quality index of one, the environmental CO2 in parts per billion is 400, the pressure in hectopaxicals is 1008.59, the relative humidity percentage was about 56 percent, the temperature in celsius inside this room is 22.22 degrees, the temperature sign is one that means it's positive degrees, volatile organic compounds parts per billion was only 24. And that's all in human readable data.
So know that this script is going to work even if you're experiencing negative temperatures, very low pressures or very high vocs or CO2 levels. It's really bulletproof, all wrapped up in a package that.
This system can fit in the palm of your hands and is fully ready to be battery or wall powered. For the amount of remarkable redness on offer, this system runs on a remarkably low amount of power. Check the full written up guide if you want an intricate step-by-step process on how to build this. All the CAD stuff is free and the scripts are open source, so now you know how to liberate your Edge collected data and beam it right into the internet at will, even if there is no Wi-Fi or cellular connectivity near you.
It is proper liberating to have this much connectivity power. Small packets of data are best. What I demonstrated here is a perfect application. Regarding the amount of data set, soil sensor measurements, GPS location and power meter data are all excellent things to transmit using Laura. So go ahead and install this system into your sailboat, your summer retreat, your secret campsite, inside your car, or just anywhere that you want to have accurate weather data.
The world is your oyster and Lower Our systems is the Pearl. That is all for today. We are full-time makers and always happy to help if you ever need a hand. Reach out and we'll grab it and pull you out with your Dolphins. So until next time, stay cozy!
Makers love reviews as much as you do, please follow this link to review the products you have purchased.