Getting Started with the Arduino MKR WAN 1310
The Arduino MKR WAN 1310 is a board that combines the power of an ATMEL SAMD21 microcontroller and the communications capabilities of the Murata LoRa® module. It is designed to integrate the core's low power-consumption and high performance with the ease-of-use of Arduino's environment, making this board a practical and cost effective solution for makers seeking to add LoRa® connectivity to their projects, with minimal previous experience in networking. This upgraded version of our MKRWAN board offers better power management and a 2MB Flash memory, accessible through a SPI interface, to store data.
The Arduino MKR WAN 1310 is programmed using the Arduino Software (IDE), our Integrated Development Environment common to all our boards and running both online and offline. For more information on how to get started with the Arduino Software visit the Getting Started page.
Please remove the black conductive foam from the MKR board pins before usage. If you don't remove it, the board may behave erratically.
Use your Arduino MKR WAN 1310 with the Arduino IoT Cloud
This board is compatible with the Arduino IoT Cloud, where you can create IoT applications in a few simple steps. The cloud includes powerful features, such as building dashboards to monitor and control sensor networks, while making sure your data is secure.
Getting started is quick and easy, and requires just three simple steps:
Use your Arduino MKR WAN 1310 on the Arduino Web IDE
All Arduino boards, including this one, work out-of-the-box on the Arduino Web Editor.
The Arduino Web Editor is hosted online, therefore it will always be up-to-date with the latest features and support for all boards. Follow this simple guide to start coding on the browser and upload your sketches onto your board.
Use your Arduino MKR WAN 1310 on the Arduino Desktop IDE
If you want to program your MKR WAN 1310 while offline you need to install the Arduino Desktop IDE and add the Atmel SAMD Core to it. This simple procedure is done selecting Tools menu, then Boards and last Boards Manager, as documented in the Arduino Boards Manager page.
Here you can search SAMD to find the core. Click on its box and click on the install button. On the bottom bar of the window you can follow the download and install procedure, including the installation of the proper driver, needed by the operating system to use the board. For more information about cores, see the guide on installing additional Arduino cores. Please note that if you already installed the SAMD core, to get the support for this board, the core revision should be at least 1.8.4. The MKRWAN Firmware version that you should have on your board is at least 1.2.0. and we strongly recommend to avoid downgrades lower than 1.2.0.
Now that the SAMD Core is installed, you can connect the board to the computer using a standard USB cable. The very first time your computer may go through the new hardware installation process.
Select your board type and port
From Tools select the Board Arduino MKR WAN 1310
and then the Port that is labeled with the same name.
Open your first sketch
Go to File on the Arduino Software (IDE) and open the Examples tree; select 01. Basic and then Blink
This sketch just flashes the built in LED connected to Digital pin LED_BUILTIN at one second pace for on and off, but it is very useful to practice the loading of a sketch into the Arduino Software (IDE) and the Upload to the connected board.
Upload the program
Press the second round icon from left on the top bar of the Arduino Software (IDE) or press Ctrl+U or select the menu Sketch and then Upload.
The sketch will be compiled and then uploaded. After a few seconds the bottom bar should show Done Uploading.
You have successfully set up your MKR WAN 1310 board and uploaded your first sketch. You are ready to move on with our tutorials and projects: choose your next destination below.
Now that you have set up and programmed your MKR WAN 1310 board, you may find inspiration in our Project Hub tutorial platform.
Here a list of tutorials that will help you in making very cool things!
More examples on the following library pages:
MKRWAN - Your MKRWAN LoRaWAN™ library reference
Scheduler - Manage multiple non-blocking tasks.
AudioFrequencyMeter - Sample an audio signal and get its frequency back
AudioZero - Play audio files from a SD card.
RTC - Real Time Clock to schedule events.
I2S - To connect digital audio devices together
In this section we have collected some information that is worth reading to use your MKR WAN 1310 board properly. Some behaviours differ from the Uno board and if you come from a former experience with that board, it is worth spending a few minutes reading through these notes. If this is your first board, we suggest you have a look at them anyway.
Operating Voltage and power management
The microcontroller on the MKR WAN 1310 runs at 3.3V. Applying more than 3.3V on any pin will damage the board. Power management is suboptimal when powering the board via USB; it is automatically optimized when the board is battery powered and super optimized when the solder jumper under the battery connector gets cut (in this case 3.3V must be provided externally). The reference library to manage this feature is Arduino Low Power.
Accessing the SPI 2MB Flash
To access the memory on the board you can use the Serial Flash library developed by Paul Stoffregen, but you should avoid to access it while the radio module s active. To achieve this you should follow a simple procedure.
To activate the radio modem you use the
LoRamodem.begin(); function and to deactivate it to prepare Flash access you need to reset the module with this function:
You perform your access to the SPI memory - read or write - enclosing it between
It is important to follow this procedure to avoid any access to SPI while there is a radio communication ongoing.
Serial ports on the MKR WAN 1310
The MKR WAN 1310 has a number of facilities for communicating with a computer or other microcontrollers. The USB connector exposes as a virtual serial port that can be controlled by writing and reading to the Serial object. Pins 13/14, instead, expose a Hardware serial port mapped to Serial1 object. Opening and closing the USB Serial port at a baud rate other than 1200bps will not reset the board. To use the serial monitor, and see what your sketch does from the beginning, you'll need to add few lines of code inside the setup(). This will ensure the board will wait for the serial port to open before executing the sketch:
while (!Serial) ;
Pressing the Reset button on the MKR WAN 1310 causes the microcontroller to reset as well as resetting the USB communication.
This interruption means that if the serial monitor is open, it's necessary to close and reopen it to restart the communication.
On Windows, drivers are needed to allow the board communication. These drivers will be installed automatically when adding the core.
On MacOSX and Linux no driver is needed.
For more details on the Arduino MKR WAN 1310, see the product page.
The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain.