Heltec Lora-32 is a high-quality Wi-Fi LoRa (long-range) development board that competes with the Lilygo TTGO T-LoRa32, RAKwireless WisNode LoRaWAN RAK811, and STMicroelectronics Nucleo boards. What differentiates Heltec LoRa-32 is that it’s more than a LoRa-only device, offering Bluetooth and Wi-Fi capabilities. This allows Heltec to easily integrate into existing network infrastructure in an Internet-of-Things (IoT) environment.
Currently, Heltec LoRa-32 V3 is widely available. The V3 version of the board is reported to have a LoRa range of up to 28.25 km in an open-air environment when using a high-gain antenna (and a few hundred meters in urban environments where buildings obstruct the signal).
The V3 is based on the ESP-32-S3 microcontroller and includes:
- An SX1262 LoRa onboard chip
- A USB Type-C port for faster data communication
- An integrated CP2102 USB-to-serial-port-chip for programming
- A 0.96-inch OLED to display data and the user interface
- A real-time clock and temperature sensor
Heltec LoRa-32 is an excellent board but somewhat challenging for beginners. It requires set-up with Arduino IDE before writing or uploading sketches for LoRa-based IoT applications. In this project, we’ll do just that — set-up the Heltec LoRa-32 and learn how to flash user code using Arduino IDE.
Heltec LoRa-32
Heltec LoRa-32 is a LoRa IoT development board from Heltec Automation. The board combines the ESP32 microcontroller with the SX1262 LoRa radio and features Wi-Fi, Bluetooth, and LoRa connectivity.
Heltec LoRa-32 offers several IoT development possibilities and has:
- Multiple GPIOs and 2I2C ports
- Two SPI ports
- Three UART ports
- Seven touch pins
- Nine analog pins
The V2 version of the board has the following pin diagram:
The more recent V3 version of the board has this pin diagram:
Installing the USB driver
To get started with the LoRa-32 board, install the necessary USB drivers to your system.
Windows’ PC users can download the drivers from this link (MAC users, see below). Open the link in a browser and select “CP210x Windows Drivers,” the fourth in the list. A ZIP file will download after you click the link.
Here’s the Heltec LoRa-32 Windows USB driver:
https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip
Unzip the folder. If you have the 64-bit Windows installed, double-click the “x64 exe” file. Otherwise, click on the “x86 exe” file.
Follow the instructions provided by the Installation Wizard to complete the drivers’ installation process.
After installing the USB driver, connect the Heltec LoRa-32 board to your computer using:
- The Micro-USB cable for the V2 version
- A Type-C USB cable for the V3 version
Open the Device Manager and the Ports tab to verify that your system detects the Heltec LoRa-32 board.
MAC users can download and install the drivers from this link. Here are the USB drivers for the Heltec LoRa-32 for MAC OS:
https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip
After installing the driver for Mac OS, check the Port Number to ensure the Heltec Lora-32 is connected by executing this command: ls /dev/cu.*
Setting up Arduino IDE
Next, let’s set up the Arduino IDE so we can program the Heltec LoRa-32 board. To do so, open the IDE and navigate to Files-> Preferences.
In the Additional Board Manager’s URLs, add the following resource link: https://resource.heltec.cn/download/package_heltec_esp32_index.json
Then, click on the Board Manager, and search for ‘Hetec esp 32’. Install the Heltec ESP32 Series Dev-boards by Heltec Automation. The installation of the boards package might take awhile.
Next, click on the Library Manager and search for ‘Heltec esp32’. Install the Heltec ESP32 Dev-boards from Heltec Automation.
This completes Arduino IDE’s set-up, and it’s now possible to program the Heltec LoRa-32.
Uploading a test sketch
After setting up Arduino IDE, connect the Heltec LoRa-32 to your computer. Select the LoRa board by navigating Tools-> Board -> Heltec ESP32 Series Dev-boards -> <Your Heltec LoRa-32 board variant>.
Select the correct Port by navigating Tools -> Port.
After selecting the Heltec Lora-32 Port, upload the following sketch to the board.
#include <heltec.h>
void setup(){
Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, 470E6 /**/);
}
void loop() {
}
You might also need to install the Heltec.h library, which can be downloaded from this link. To install the library, navigate to Sketch -> Include Library -> Add .ZIP library.
After compiling and uploading the Sketch Monitor, the output for Arduino’s Serial Monitor is @ 115200 bps. The LoRa board will print debug messages similar to the one in the image below.
Flashing the LED
On the Heltec LoRa-32 board, the LED adjacent that powers the LED light is connected internally to the GPIO26. As part of the Arduino sketch, let’s flash the LED so that it blinks repeatedly.
To do so, upload the following sketch to LoRa-32 board.
#define LED 25
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, LOW);
delay(1000);
digitalWrite(LED, HIGH);
delay(1000);
}
After uploading this sketch, the LED on the Heltec LoRa-32 board will flash, as shown in the video below. It’s also possible to control all other GPIO and peripherals on the Heltec LoRa-32 board.
The video
You may also like:
Filed Under: Electronic Projects, Video
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.