The RFM95 module is a compact, long-range transceiver featuring the LoRa (Long Range) spread spectrum modulation technology designed for high sensitivity and robust communication. It operates in the license-free 868/915 MHz ISM bands, making it suitable for a variety of applications in the Internet of Things (IoT), Machine to Machine (M2M) communication, and amateur radio uses.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (1.8 - 3.7 V) |
3 | DIO0 | Digital I/O, configurable for interrupt and LoRa functions |
4 | DIO1 | Digital I/O, configurable for interrupt and LoRa functions |
5 | DIO2 | Digital I/O, configurable for interrupt and LoRa functions |
6 | DIO3 | Digital I/O, configurable for interrupt and LoRa functions |
7 | DIO4 | Digital I/O, configurable for interrupt and LoRa functions |
8 | DIO5 | Digital I/O, configurable for interrupt and LoRa functions |
9 | RESET | Reset pin (active low) |
10 | NSS | SPI Chip Select (active low) |
11 | SCK | SPI Clock |
12 | MOSI | SPI Master Out Slave In |
13 | MISO | SPI Master In Slave Out |
14 | GND | Ground connection |
15 | ANT | Antenna connection |
Q: Can I use the RFM95 module with an Arduino? A: Yes, the RFM95 can be interfaced with an Arduino using the SPI interface and appropriate libraries.
Q: What is the maximum range I can achieve with the RFM95? A: The range depends on the environment, antenna, and settings, but it can reach up to 15 km in open, suburban areas.
Q: Is the RFM95 module compatible with LoRaWAN? A: Yes, the RFM95 can be used in LoRaWAN networks with the correct firmware and network settings.
Below is an example of how to initialize the RFM95 module with an Arduino UNO. This code assumes the use of the RadioHead library for LoRa communication.
#include <SPI.h>
#include <RH_RF95.h>
// Singleton instance of the radio driver
RH_RF95 rf95;
void setup() {
Serial.begin(9600);
while (!Serial) ; // Wait for serial port to be available
if (!rf95.init()) {
Serial.println("LoRa radio init failed");
while (1);
}
Serial.println("LoRa radio init OK!");
// Set frequency
if (!rf95.setFrequency(915.0)) {
Serial.println("setFrequency failed");
while (1);
}
// Set the power level: 1-23, 23 being the highest
rf95.setTxPower(23, false);
}
void loop() {
// Send a message every 3 seconds
const char *msg = "Hello World!";
rf95.send((uint8_t *)msg, strlen(msg));
rf95.waitPacketSent();
delay(3000);
}
Remember to adjust the frequency and power level according to your regional regulations and requirements. The setFrequency
function should be set to the appropriate frequency for your region (either 868 or 915 MHz).