LoRa-E5 mini (STM32WLE5JC) Development Board Documentation
The LoRa-E5 mini (STM32WLE5JC) Development Board is a compact and feature-rich development platform for IoT applications, based on the STM32WLE5JC microcontroller. This board integrates a LoRa transceiver, allowing for long-range wireless communication, and is suitable for a wide range of applications, including smart cities, industrial automation, and environmental monitoring.
STM32WLE5JC microcontroller with Arm Cortex-M4 core
Semtech SX1276 LoRa transceiver
Supports LoRaWAN, FSK, and OOK modulation
On-board antennas for LoRa and Wi-Fi
Wi-Fi and Bluetooth 4.2 connectivity
USB Type-C interface for programming and debugging
3.3V operating voltage
Compact size (30.5 mm x 20.5 mm)
The LoRa-E5 mini development board is supported by a range of software development tools, including STM32CubeMX, Keil Vision, and mbed.
Example 1: LoRa Point-to-Point Communication
This example demonstrates the use of the LoRa-E5 mini development board for point-to-point communication between two boards.
Sender Code
```c
#include <LoRa.h>
#define LORA_SS_PIN 18
#define LORA_RST_PIN 14
#define LORA_DIO0_PIN 26
LoRa lora = LoRa(LORA_SS_PIN, LORA_RST_PIN, LORA_DIO0_PIN);
void setup() {
Serial.begin(115200);
lora.begin(433E6); // set frequency to 433 MHz
}
void loop() {
String message = "Hello, LoRa!";
lora.beginPacket();
lora.print(message);
lora.endPacket();
delay(1000);
}
```
Receiver Code
```c
#include <LoRa.h>
#define LORA_SS_PIN 18
#define LORA_RST_PIN 14
#define LORA_DIO0_PIN 26
LoRa lora = LoRa(LORA_SS_PIN, LORA_RST_PIN, LORA_DIO0_PIN);
void setup() {
Serial.begin(115200);
lora.begin(433E6); // set frequency to 433 MHz
}
void loop() {
int packetSize = lora.parsePacket();
if (packetSize) {
String receivedMessage = "";
while (lora.available()) {
receivedMessage += (char)lora.read();
}
Serial.println(receivedMessage);
}
delay(1000);
}
```
Example 2: LoRaWAN Sensor Node
This example demonstrates the use of the LoRa-E5 mini development board as a sensor node in a LoRaWAN network.
Code
```c
#include <LoRaWAN.h>
#define LORA_SS_PIN 18
#define LORA_RST_PIN 14
#define LORA_DIO0_PIN 26
LoRaWAN loraWAN = LoRaWAN(LORA_SS_PIN, LORA_RST_PIN, LORA_DIO0_PIN);
#define SENSOR_PIN A0 // analog sensor pin
void setup() {
Serial.begin(115200);
loraWAN.begin();
loraWAN.joinABP("your_dev_eui", "your_app_eui", "your_app_key");
}
void loop() {
int sensorValue = analogRead(SENSOR_PIN);
String sensorData = "Temperature: " + String(sensorValue) + "C";
loraWAN.send(sensorData);
delay(60000); // send data every 1 minute
}
```
Note: Please replace "your_dev_eui", "your_app_eui", and "your_app_key" with your actual LoRaWAN credentials.
These examples demonstrate the basic use of the LoRa-E5 mini development board for LoRa point-to-point communication and LoRaWAN sensor node applications. For more advanced applications, please refer to the LoRa-E5 mini documentation and the STM32WLE5JC datasheet.