element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Just Encase
  • Challenges & Projects
  • Design Challenges
  • Just Encase
  • More
  • Cancel
Just Encase
Blog Monitoring and Protection an Ecological Area #11 - Connecting LoRaWAN to an IoT Provider through the Arduino NANO 33 IoT
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Just Encase requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: guillengap
Date Created: 21 Jan 2022 6:41 PM
Views: 304
Likes: 2
Comments: 0
  • Arduino MKR WAN 1300
  • lora
  • Monitoring and Protection an Ecological Area
  • arduino nano 33 iot
  • just_encase
Related
Recommended

Monitoring and Protection an Ecological Area #11 - Connecting LoRaWAN to an IoT Provider through the Arduino NANO 33 IoT

guillengap
guillengap
21 Jan 2022

Table of Contents

  1. Project Introduction
  2. Getting Started
  3. Communication Between Two MKR WAN 1300
  4. LoRaWAN System Range Testing
  5. Assembling and Adding LCD Display to the Transmitter
  6. Assembling and Adding LCD Display to the Receiver
  7. LoRaWAN´s Field Test with a DS18B20 Sensor
  8. Adding Multiple Sensors: DS18B20, DHT22 and MQ-135
  9. Modifying Receiver Code for Multiple Sensors
  10. LoRaWAN´s Field Test with Multiple Sensors
  11. Connecting LoRaWAN to an IoT Provider through the Arduino NANO 33 IoT
  12. LoRaWAN and IoT Connection with a DS18B20 Sensor
  13. Testing LoRaWAN and IoT Connection with a DS18B20 Sensor
  14. LoRaWAN and IoT Connection with Multiple Sensors
  15. Testing LoRaWAN and IoT Connection with Multiple Sensors
  16. Project Report Updated

**********************************************************************************************************************

Connecting LoRaWAN to an IoT Provider through the Arduino NANO 33 IoT

In this part of my project, the challenge is to connect my LoRa network to an IoT provider, but one with cost-effective. Below is the schematic diagram.

In this project I am going to connect my LoRa network with an IoT provider through the Arduino NANO 33 IoT board. Reason:

Its an economic solution, since the Arduino NANO 33 IoT board has an average cost of $20.70 USD.

On the other hand, the Gateway Lora RAK2245 board has a price of: $ 154.55 USD.

Creating a New Serial Port to the Arduino MKR WAN 1300 Board

When I checked out the ATSAMD21 chip (the processor used in the Arduino MKR WAN 1300 board), I was very happy to see that the chip has 6 "SERCOM"s, a.k.a SERial COMmunication modules. Each one of these modules can be used for I2C, SPI or Serial. That means you can have 3 UART's & 3 SPI's, or maybe 2 SPI's and 4 I2C's. Basically, you have a ton of options for adding more hardware support for the most common 3 chip-to-chip protocols.

UART has only 2 pins, RX & TX. UARTs are a real pain to emulate or bitbang due to their very precise timing and their asynchronous RX lines are very difficult to do if you dont have hardware interrupt pins available. For that reason, being able to create new Serial's is awesome.

Now, what I need is to create a new serial port on the Arduino MKR WAN 1300 board to connect it with the Arduino NANO 33 IoT board via serial port. In this way the Arduino NANO board will receive the data from the sensors and can send them to any IoT provider.

How Serial is Created Now

You can find the actual code that is used to create the "Serial" SERCOM in variant.cpp

You will see the serial objects on:

The actual definitions of those macros is available in variant.h

OK so let's make a new Serial SERCOM already

I want to make a Serial! Lets try creating a new SERCOM and testing it out. Let's make a Serial device on SERCOM #1, lets look at what pin muxing options we've got:

PIN number PIN arduino SESRCOM
PA16 D8 (MOSI) SERCOM1.0
PA17 D9 (SCK) SERCOM1.1
PA19 D10 (MISO) SERCOM1.3
PA18 D24 (USB) SERCOM1.2

Rules:

  • Tx only works on PAD 0 and PAD 2
  • RX works in any PAD

I have selected next pins:

  • D8 FOR TX
  • D9 FOR RX

In the next chapter I will show you how to program this data into the Arduino MKR WAN 1300 receiver board.

Reference:

  • Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports
Anonymous
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube