This project implements a LoRa-based receiver node using an STM32 microcontroller and an SX1278 transceiver. In addition to receiving data, the node can send telemetry or acknowledgment data back to the sender, enabling bidirectional communication.
- 📥 Reliable LoRa packet reception
- 📤 Telemetry / acknowledgment transmission
- 🔄 Bidirectional communication (Receiver ↔ Sender)
- 📡 Based on SX1278 (433 MHz) LoRa module
- ⚡ Built with STM32 HAL drivers
- 📊 RSSI / signal strength monitoring (optional)
This project focuses on the receiver side of a LoRa communication system.
The STM32 communicates with the SX1278 LoRa module via SPI, enabling long-range, low-power wireless communication.
- Continuously listens for incoming LoRa packets
- Processes received data
- Sends telemetry or response data back to the sender
- Can be used as a base station or gateway node
Unlike a simple receiver, this system supports two-way communication, making it suitable for real-world IoT systems.
- STM32 development board (e.g., STM32F103, Nucleo, etc.)
- SX1278 LoRa module (Ra-02 recommended)
- 433 MHz antenna
⚠️ (required for safe operation) - ST-Link debugger/programmer
- Jumper wires / breadboard
| STM32 Pin | LoRa Module Pin | Description |
|---|---|---|
| SPI NSS | NSS | Chip Select |
| SPI SCK | SCK | Clock |
| SPI MISO | MISO | Data Out |
| SPI MOSI | MOSI | Data In |
| GPIO | DIO0 | Interrupt (RX ready) |
| GPIO | RST | Reset |
| 3.3V | VCC | Power |
| GND | GND | Ground |
The SX1278 uses SPI communication, making it compatible with most STM32 MCUs.
- STM32CubeIDE
- STM32 HAL drivers
- Git (optional)
Core/
├── Src/ # Application source files
├── Inc/ # Header files
Drivers/
├── CMSIS/
├── STM32_HAL_Driver/
LoRa/
├── LoRa driver implementation
.ioc # STM32CubeMX configuration
git clone https://github.com/Hamo-creator/STM32-LoRa-Receiver.git
cd STM32-LoRa-Receiver- File → Open Projects from File System
- Select the project directory
- Build:
Ctrl + B - Flash: Click Run (▶)
- Initializes LoRa module
- Switches to continuous receive mode
- Waits for incoming packets
- Reads and processes received data
Typical workflow:
- Start receiving mode
- Detect incoming packet (interrupt via DIO0)
- Read payload
- Process message
LoRa drivers typically use continuous RX mode for efficient reception. (GitHub)
After receiving data, the node can:
- Send acknowledgment (ACK)
- Return sensor values
- Transmit status/debug information
Example use cases:
- Confirm packet reception
- Send back RSSI or signal quality
- Return sensor readings
Sender ---> Receiver (this project)
|
└──> Telemetry / ACK ---> Sender
- 📡 Base station for wireless sensor networks
- 🌱 Smart agriculture gateway
- 🏠 Home automation hub
- 🚗 Vehicle telemetry receiver
- 🛰️ Remote monitoring systems
-
Always connect a 433 MHz antenna before powering the module
-
Ensure both nodes share the same:
- Frequency (e.g., 433 MHz)
- Spreading factor
- Bandwidth
-
Use 3.3V only — SX1278 is NOT 5V tolerant
-
Keep SPI wires short to avoid signal issues
- SPI with DMA
- Add structured packet protocol (CRC, IDs)
- Implement encryption
- Support multiple nodes
- Integrate sensors (BME280, GPS, etc.)
- Low-power (sleep mode) optimization
- LoRaWAN support
Contributions are welcome!
Steps:
- Fork the repository
- Create a new branch
- Commit your changes
- Open a Pull Request
This project is open-source and available under the MIT License.
Hamo-creator GitHub: https://github.com/Hamo-creator
If you find this project useful, give it a ⭐ on GitHub!
The LoRa Library used in this example is from: https://github.com/SMotlaq/LoRa The servo Library used is from: https://deepbluembedded.com/stm32-servo-motor-control-with-pwm-servo-library-examples-code/