Issues with the RFM96W

I'm doing a project where an Aanuino nano 33 ble is transmitting to an uno. The transceiver that I am using is the Adafruit RFM96W.

The code I am using:

#include <SPI.h>
#include <LoRa.h>

#define NSS_PIN   10   // Choose a digital pin on Nano 33 BLE for NSS
#define DIO0_PIN   2   // Choose a digital pin on Nano 33 BLE for DIO0
#define RST_PIN    9   // Choose a digital pin on Nano 33 BLE for RST
#define LED_PIN   13   // Built-in LED on Nano 33 BLE

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("Initializing LoRa module...");

  // Initialize LoRa module
  LoRa.setPins(NSS_PIN, DIO0_PIN, RST_PIN);
  if (!LoRa.begin(433E6)) {
    Serial.println("LoRa initialization failed. Check your connections.");
    while (1);
  }
  Serial.println("LoRa initialized successfully.");

  // Configure LED pin as output
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  Serial.println("Sending LoRa message...");

  // Blink the LED to indicate LoRa activity
  digitalWrite(LED_PIN, HIGH);  // Turn on the LED
  delay(500);                   // Wait for 500 milliseconds
  digitalWrite(LED_PIN, LOW);   // Turn off the LED

  // Send a LoRa message
  LoRa.beginPacket();
  LoRa.print("Hello, LoRa!");
  LoRa.endPacket();

  delay(5000);  // Send a message every 5 seconds
}

On the Arduino Uno the LoRa module works fine and is transmitting.

on the Arduino Nano 33 BLE, it fails to initialize. I've checked the wiring multiple times and I know that the wires are not broken since I checked. Im not sure why one gets further than the other even though it is the same wiring.

The wiring is:
VIN - 3.3v
GND - GND
G0 - D2
SCK - D13
MISO - 12
MOSI - 11
CS - 10
RST - 9

Do you have any idea where i have gone wrong or need to fix something?

in lora.h setPins is defined as

void setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN);

which does not match your code

LoRa.setPins(NSS_PIN, DIO0_PIN, RST_PIN);

With a normal 3.3V LoRa device I would expect that LoRa library to initialise the device and to transmit or receive when DIO0 and NRESET pin allocations were reversed.

Not sure about the impact of the logic level conversion circuit on that Adafruit module though.

I tried it but it didnt fix the problem unfortunatly

I've been looking online for tutorials on setting up these two together but they either don't run due to compatibility issues or the module fails to initialize. Does anyone have any knowledge on how to make these two work together?

Ive seen the arduino uno work together with it. Could that be do to the voltage being higher so therefore it works?

Cannot comment on the Adafruit board, it seems to be dual 5V\3.3V, maybe thats an issue.

Never had any compatibility issues with 3.3V Arduinos and the 3.3V SPI LoRa modules.

Do you think I should get a level converter that converts my Arduino nano 33 BLE 3.3v to a 5v signal? To see if it works. Just want to make sure that that wont damage my Arduino.

A logic level converter is required for wired communications between 5V and 3.3V equipment.

Please do not cross post. Flagged for moderator.

@coding_astronaut,

Your two or more topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

I don't have a Nano 33 BLE so just guessing
when you declare

#define NSS_PIN   10   // Choose a digital pin on Nano 33 BLE for NSS

is it pin D10?
could you declare

#define NSS_PIN   D10   // Choose a digital pin on Nano 33 BLE for NSS

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.