

The Heltec WiFi LoRa 32 V2 is a powerful microcontroller board developed by Heltec Automation. It is based on the ESP32 chip and integrates WiFi, LoRa communication, and a built-in OLED display, making it an excellent choice for IoT (Internet of Things) applications. This board is designed for low-power, long-range wireless communication and is ideal for projects requiring connectivity, data visualization, and sensor integration.








| Parameter | Specification |
|---|---|
| Microcontroller | ESP32 (dual-core, 32-bit, Xtensa LX6) |
| Clock Speed | Up to 240 MHz |
| Flash Memory | 8 MB |
| SRAM | 520 KB |
| WiFi | IEEE 802.11 b/g/n |
| LoRa Frequency Bands | 433 MHz, 868 MHz, 915 MHz (region-specific) |
| LoRa Modulation | Semtech SX1276 |
| OLED Display | 0.96-inch, 128x64 pixels, monochrome |
| GPIO Pins | 21 (including ADC, DAC, I2C, SPI, UART, PWM) |
| Operating Voltage | 3.3V |
| Input Voltage Range | 5V (via USB) or 3.3V (via pin) |
| Power Consumption | Low-power mode supported |
| Dimensions | 41 x 25 x 12 mm |
| Pin Name | Pin Number | Description |
|---|---|---|
| GND | Multiple | Ground pin |
| 3V3 | Multiple | 3.3V power output |
| VIN | - | Power input (5V via USB or external source) |
| GPIO0 | 0 | General-purpose I/O, boot mode selection |
| GPIO21 | 21 | I2C SDA (data line) |
| GPIO22 | 22 | I2C SCL (clock line) |
| GPIO16 | 16 | OLED reset pin |
| GPIO17 | 17 | UART TX |
| GPIO18 | 18 | SPI SCK |
| GPIO19 | 19 | SPI MISO |
| GPIO23 | 23 | SPI MOSI |
| GPIO25 | 25 | DAC1, PWM output |
| GPIO26 | 26 | DAC2, PWM output |
| GPIO32 | 32 | ADC1, touch sensor |
| GPIO33 | 33 | ADC1, touch sensor |
Powering the Board:
Connecting Peripherals:
Programming the Board:
Using the OLED Display:
U8g2 or Adafruit_SSD1306 to control the display.Below is an example of how to display text on the OLED and send a LoRa message:
#include <Wire.h>
#include <U8g2lib.h>
#include <LoRa.h>
// Initialize the OLED display (I2C address: 0x3C)
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 16, /* clock=*/ 22, /* data=*/ 21);
void setup() {
// Initialize serial communication
Serial.begin(115200);
// Initialize the OLED display
u8g2.begin();
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_ncenB08_tr);
u8g2.drawStr(0, 10, "Heltec LoRa V2");
u8g2.sendBuffer();
// Initialize LoRa communication
if (!LoRa.begin(915E6)) { // Set frequency to 915 MHz
Serial.println("LoRa initialization failed!");
while (1);
}
Serial.println("LoRa initialized successfully!");
}
void loop() {
// Send a LoRa message
LoRa.beginPacket();
LoRa.print("Hello, LoRa!");
LoRa.endPacket();
// Display message on OLED
u8g2.clearBuffer();
u8g2.drawStr(0, 10, "Message Sent:");
u8g2.drawStr(0, 30, "Hello, LoRa!");
u8g2.sendBuffer();
delay(2000); // Wait 2 seconds before sending the next message
}
Problem: The board does not power on.
Solution: Check the USB cable and power source. Ensure the VIN pin receives 3.3V if using external power.
Problem: LoRa communication fails.
Solution: Verify that both sender and receiver are set to the same frequency and spreading factor. Ensure antennas are properly connected.
Problem: OLED display does not show anything.
Solution: Confirm the I2C connections (SDA to GPIO21, SCL to GPIO22). Check the I2C address (default is 0x3C).
Problem: Unable to upload code to the board.
Solution: Ensure the correct board and COM port are selected in the Arduino IDE. Press and hold the "BOOT" button while uploading.