ESP32 LoRaWAN Mote


2,164

1

2

Electronic and Computer Engineering student University of Limerick.

In this project we will be using the ESP32 Heltec WiFi LoRa OLED board from Banggood to build a LoRaWAN Mote (end node) to send data from an DHT22 sensor to The Things Network(TTN) and display the sensor values. The code and libraries used in the project can be found on GitHub. You will also need to purchase an antenna and pig tail connector (U.FL to SMA). An TTN account is also needed to register the Mote and application.

This project assumes some knowledge of the Arduino IDE, LoRaWAN and of ESP32 in general. Some soldering skills are also required to attached the header pins to the ESP32 board. A working LoRa Gateway connected to The Things Network will also be needed.

If you do not have an LoRa Gateway up and running you can follow my other tutorial setting up an 1_CH LoRa Gatway using this Heltec board. This type of Gateway is only for development on the bench and is not a full LoRa Gateway.

This project will also work using other ESP32 development board’s with WiFi, LoRa and OLED but pin_mapping will be different and will require good knowledge of how to follow schematics and pin_out diagrams of the selected board

For a full walk through with step by step pictures vist here.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: About the Heltec Board

Specifications:

  • CPU: ESP32 DOWDQ6
    • 240 MHz dual core
    • WiFi up to 150Mbps 802.11 b/g/n/e/i
    • Bluetooth 4.2 (BLE)
  • Flash: 4MB (32Mbit)
  • USB-Serial Converter: CP2102
  • Radio: Semtech SX1276
  • Antenna connector: IPX (U.FL)
  • OLED Screen:
    • Size: 0.96″
    • Driver: SSD1306
    • Resolution: 128×64 px
  • Li-Ion/Li-Po charging circuit
  • Battery socket: 2pin raster 1.25 mm
  • Size: 52 x 25.4 x 10.3 mm

Step 2: Setting Up the Arduino IDE for ESP32

Important: before starting this installation procedure, make sure you have the latest version of the Arduino IDE installed in your computer. If you don’t, uninstall it and install it again. Otherwise, it may not work. The ESP32 is currently being integrated with the Arduino IDE just like it was done for the ESP8266. This add-on for the Arduino IDE allows you to program the ESP32 using the Arduino IDE and its programming language.

IMPORTANT NOTE:

If this is your first time installing the ESP32 on the Arduino IDE, simply follow the installation procedure described below.
If you’ve already installed the ESP32 add-on using the old method, you should remove the espressif folder first. Go to the end of this part to learn how to remove the espressif folder by following Part 1 Note#1.
Never power on the board without connecting the antenna first as you may damage the radio chip on board.

Step 3: Installing the ESP32 Board

To install the ESP32 board in your Arduino IDE, follow these next instructions:
1) Open the preferences window from the Arduino IDE. Go to File > Preferences
2) Enter https://dl.espressif.com/dl/package_esp32_index.json into the “Additional Board Manager URLs” field as shown in the figure below. Then, click the “OK” button.
Note: if you already have the ESP8266 boards URL, you can separate the URLs with a comma as follows:
https://dl.espressif.com/dl/package_esp32_index.json,
http://arduino.esp8266.com/stable/package_esp8266com_index.json

Be the First to Share

    Recommendations

    • Assistive Tech Contest

      Assistive Tech Contest
    • Reuse Contest

      Reuse Contest
    • Made with Math Contest

      Made with Math Contest

    2 Discussions

    0
    None
    patmolloy

    18 days ago

    Have built this but have some curious behaviour .. I see the following on the serial monitor .. I get some data upoaded, but the this error and silence .. any ideas ?

    Starting
    OLED and DHT init'd
    Temperature: 26.60 *C
    %RH 34.30
    EV_TXSTART
    409217: EV_JOINING
    725559: EV_TXSTART
    1056599: EV_JOINED
    netid: 19
    devaddr: 26012CD4
    artKey: 19-12-90-9A-3B-5A-18-5D-4E-54-2E-2A-C4-XX-XX-XX [obscured]
    nwkKey: DA-5F-A9-1E-AA-42-D-82-8B-72-7E-37-CE-XX-XX-XX [obscured]
    1063555: EV_TXSTART
    22794984: EV_TXCOMPLETE (includes waiting for RX windows)
    FAILURE
    C:\Users\patmo\OneDrive\Documents\Arduino\arduino-lmic-for_ESP32-master\arduino-lmic-for_ESP32-master\ESP32_Heltec_V1_LoRa_Mote\libraries\MCCI_LoRaWAN_LMIC_library\src\lmic\lmic.c:1547