Skip to content

Hamo-creator/STM32-LoRa-Receiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

📡 STM32 LoRa Receiver (with Telemetry Feedback)

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.


🚀 Features

  • 📥 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)

🧠 Project Overview

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.

Key Capabilities:

  • 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.


🛠️ Hardware Requirements

  • 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

🔌 Wiring (STM32 ↔ SX1278)

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.


⚙️ Software Requirements

  • STM32CubeIDE
  • STM32 HAL drivers
  • Git (optional)

📁 Project Structure

Core/
 ├── Src/        # Application source files
 ├── Inc/        # Header files

Drivers/
 ├── CMSIS/
 ├── STM32_HAL_Driver/

LoRa/
 ├── LoRa driver implementation

.ioc             # STM32CubeMX configuration

▶️ Getting Started

1. Clone Repository

git clone https://github.com/Hamo-creator/STM32-LoRa-Receiver.git
cd STM32-LoRa-Receiver

2. Open in STM32CubeIDE

  • File → Open Projects from File System
  • Select the project directory

3. Build & Flash

  • Build: Ctrl + B
  • Flash: Click Run (▶)

🔄 How It Works

Receiver Mode (Primary)

  • Initializes LoRa module
  • Switches to continuous receive mode
  • Waits for incoming packets
  • Reads and processes received data

Typical workflow:

  1. Start receiving mode
  2. Detect incoming packet (interrupt via DIO0)
  3. Read payload
  4. Process message

LoRa drivers typically use continuous RX mode for efficient reception. (GitHub)


Telemetry / Response Mode

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

📡 Communication Flow

Sender  --->  Receiver (this project)
             |
             └──> Telemetry / ACK ---> Sender

🧪 Example Use Cases

  • 📡 Base station for wireless sensor networks
  • 🌱 Smart agriculture gateway
  • 🏠 Home automation hub
  • 🚗 Vehicle telemetry receiver
  • 🛰️ Remote monitoring systems

⚠️ Important Notes

  • 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


🔧 Future Improvements

  • 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

🤝 Contributing

Contributions are welcome!

Steps:

  1. Fork the repository
  2. Create a new branch
  3. Commit your changes
  4. Open a Pull Request

📜 License

This project is open-source and available under the MIT License.


👤 Author

Hamo-creator GitHub: https://github.com/Hamo-creator


⭐ Support

If you find this project useful, give it a ⭐ on GitHub!


Notice

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/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages