LoRa - Long-Range R...
 
Notifications
Clear all

LoRa - Long-Range Radio for IoT | Arduino, ESP32, RPI Pico

82 Posts
5 Users
34 Reactions
5,234 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1104
Topic starter  

LoRa is a low-cost, license-free method of sending short data bursts over long distances. It’s perfect for IoT sensors and remote control projects. Today, we’ll see how easy it is to use LoRa in our projects.

If you need to send small amounts of data, such as sensor readings, over long distances, then LoRa (Long Range) radio is the technology for you. You can achieve incredible distances using low-cost modules and basic antennas. You can measure these distances in miles or kilometers with the right equipment.

Today, we will experiment with two readily available, low-cost LoRa modules: the HopeRF RFM95W and the Adafruit RFM9x. They are essentially the same module, with the Adafruit device having onboard voltage regulation and logic-level conversion, making it compatible with both 5-volt and 3.3-volt microcontrollers. The Adafruit offering is also easier to handle, as the HopeRF module is not breadboard-friendly.

We will use these modules with an Arduino Uno, a Raspberry Pi Pico, and an ESP32. We’ll program with both C++ in the Arduino IDE and MicroPython using the Thonny IDE.

Here is the Table of Contents for today's video:

00:00 - Introduction
01:30 - LoRa Primer
07:38 - HopeRF RFM95W & Adafruit RFM9x
11:08 - LoRa Antennas
13:06 - Seeedstudio LoRa-E5
14:35 - Heltec ESP32-LoRa
16:09 - Installing & Using the LoRa Library
18:32 - Adafruit RFM9x Hookup
21:24 - Demo 1 - Simple data transmission
25:43 - Demo 2 - One-way remote control
30:34 - Demo 3 - Callback & Two-way remote control
36:43 - Raspberry Pi Pico MicroPython & Hookup
39:13 - LoRa with MicroPython Code & Demo
45:39 - Data Gathering Project Intro
46:35 - Data Gathering Hookup & Operation
53:11 - Data Gathering Code
1:02:45 - Data Gathering Demos
1:05:07 - Conclusion

While this is a long video, it barely scratches the surface of what you can accomplish using LoRa. You’ll be seeing more LoRa-related projects and tutorials here soon, including one on LoRaWAN.

Hope you enjoy the video!

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Inq, bugsy123, rommudoh and 1 people reacted
Quote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

Pardon the post.  I wanted to subscribe.  BUT, didn't we used to have a way to subscribe without having to do a post?  I thought we had a link just below the topic title.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

Timely. Where I live has vegetable garden plots and I hope to get one next spring. There are two apartments between me and the gardens so I was worried about WiFi plus it's energy demands. This sounds like a great solution for a little garden monitoring and weather station as well.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

Record Breaking Transmission for LoRaWAN

https://www.hackster.io/news/another-record-breaking-transmission-for-lorawan-0cca5f6cd032

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1104
Topic starter  

@inq LOL, yes, I saw this about a day after I published the video! Absolutely amazing, and they did it without a balloon.

That's actually much further than the International Space Station orbits, so I expect an interplanetary record will be set soon.  First LoRa transmission from Mars any day now!

Gives me hope for connecting to my nearest Things Network station. It's only 15km away, but it's blocked by several tall buildings, three large highways, a river and an airport!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@dronebot-workshop @Inq This gives me hope I can make contact from maybe 1/4 mile away but through 2 apartment buildings. I am ready to install a repeater if necessary, but it will be nice if I don't need it. I plan to test it in the next few weeks when I have some spare time. I got the PtSolns LoraKey for quick assembly and test.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

@dronebot-workshop, @zander,

I knew when this YT came out, I'd eventually need this technology in a project.  That day has come.  I've just finished watching your excellent video Bill.  Thank you again for all that you do.  I can't even imagine how much work it takes to put these together.  Would you mind sharing any software programs you use to edit these and add all the effects?

For the project/scenario I want to do, I need to do some things differently than you showed in the video.  I've... well... I should say we've (wife decided) we are going to try taking a hand at bee-keeping.  In my general, make things more complicated than they really need to be way, I'd like to instrument the hives.  However, my case would be the same situation for the large group of people here doing projects with green-houses and other yard type, battery powered IoT projects.  In that vein, your video triggered some questions.  I hope someone has experience with these:

  1. Range - I see from your blue-steel plate and freezer experiments that it is quite robust. I only need say 200 yards range at the moment with direct line of site.  However, in the future, we have some property about 10 miles away.  That too sounds like it would be completely doable if it was a relatively direct line of site.  However, there are some significant "hills" (say about 500 feet taller) between us.  Have you seen any studies that would indicate this might be possible in a more mountainous area?
  2. Connection - I don't see any connection hand-shaking going on.  Is it built into the libraries or something.  It doesn't seem to be there as there is no "server id" used from the clients.  It sounds like it is purely a radio broadcast.  The receiver is either there or not.  If so, then I'd have to implement a reply protocol ACK/NAK from the receiver and a re-broadcast or give-up mentality on the sender.
  3. Security - Also related to the connection, I saw where you mention that it was secure, but I didn't see anything in your video that would keep anyone using one in receive mode and simply receiving everything in the clear.  It's not that I'm all that worried about someone getting my bee-hive temperature.  It was just more of I heard a statement, but didn't see how?  If it has not hand-shake, how can it be secured?
  4. Compatibility Across Brands - Is the LoRa a strict standard where devices have to be compatible?  I'm sure they have to be in the same frequency, but you also mentioned something about the Chirp Pattern.  I'm wondering... are different vendors required to handle all the Chirp Patterns or could there be some proprietaries associated with them?  Could my ignorance intentionally lock me into their brand from my first purchase?  For instance, these  https://amz.run/7Hm0 are about half the price of the HopeRF RFM95W.

The main thing I see I have to do differently is I can't use a polling technique.  I need the remote sensor modules to be battery operated and use deep sleep for minutes, wake-up, get the sensor readings and send them to the controller / server.  If it is not connection based, then they need to wait for a reply from the controller and either retry or give up... and then go back to sleep again.  I'd set up the controller on a RasPi Zero W and connect LoRa module to handle the reception and replies and store them in a MySQL database on the RasPi and also expose a webserver using say NGInx or Apache so I can look at data from any device in the house.  

In that project, I haven't decided on a sensor MPU.  I've never needed to use deep sleep before and never really investigated it.  I've seen some "year life on a AA battery" type articles which seem to require butchering the MPU.  Does anyone have any advice on the various MPU's that might be best at implementing the most efficient use of a battery?  Say... ESP8266, ESP32, RP2040, Arduino, etc...

Thanks!

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@inq A few of us beat deep sleep to death a while ago and the end result is if you want the most battery saving and the solution fits the use case, the deepest sleep is to turn off the power entirely. I am tagging @davee so he can send you the schematics. It does involve the butchering of the most popular RTC or get the more expensive <forgot name, will update later> or get the raw DS3231 chip. This solution will yield an RTC that will run for a couple years but the battery life of the MPU/MCU and LORA boards is a different matter. I would consider RC size batteries as a possibility.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@inq As far as the hills, think either mounting on a tall pole, or use a repeater or even several.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

Posted by: @zander

@inq As far as the hills, think either mounting on a tall pole, or use a repeater or even several.

 🤣  I don't own the property between in those 10 miles for repeaters and a tall pole isn't going to gain that much height compared to the hills in-between.  

Posted by: @zander

@inq A few of us beat deep sleep to death a while ago

Would you have a link to the thread?  I'm sure it will get me started just fine.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

@zander,

Just for S&G's... I got on Google Earth and drew a direct line from the house to the "Apothecary".  Via direct line of sight it is 7.72 miles and as it drills through some higher hills.  They're not as bad as I thought.  Maybe if I can get some advice on a stronger LoRa model, or if antennas make any significant difference... a better one of those.  At the very least, it'll be worth an experiment!  😎 

image

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@inq The name I forgot is ChronoDot V2.x.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@inq Sorry, IIRC, the entire discussion was spread over several topics and had more to do with an RTC. Long story short, see @davee's solution at https://forum.dronebotworkshop.com/postid/39164/

I have all 3 devices: the flawed board in the link requiring board-level surgery, the much better ChronoDot V2.x and the raw DS3231 chips. I did assemble a working solution using the ChronoDot, but I need to remember the details now. With the move plus my health issues, I can't find parts and do not remember what I was doing (yes, I don't write much down). I hope to return to that experiment and then go one step further with the raw DS3231 chip plus supporting components, including a CR2032 battery to keep the RTC running for months to years depending on alarm frequency.

There was a circuit in Electronoobs that inspired @will and me, but Dave had the solid state knowledge I didn't have and saw that the circuit could be made to work just off the low state of one pin in the RTC.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7439
 

@inq Forget stronger; there are laws about that, and these are max power for the freq. A better antenna will go a long way, but I would put together a simple receiver and transmitter and see if it reaches; you may be surprised.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1903
 

@zander 

Hope you get to feeling better enough to get back in project mode!  It seems like I recall that you're wanting to monitor your garden with LoRa???  Surely... by now, the ground up there is frozen solid and you have many months before any project could be used. 😋 

Only good wishes!

Inq  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Page 1 / 6