problemi with arduino nano and hoperf rfm95w

Hello,

I have a problem with connecting my arduino nano to the hoperf RFM95W.

I have two nanos connected each to one rfm95w as per image.
I uploaded to them the default lora Sender and lora receiver from sandeep

it did work perfectly when connected to the arduino uno, then I tried moving the setup to the nano, and here's my problem:

both sender and receiver when started or reset often fail at LoRa.begin command (show the failed string on the serial) sometimes they manage to begin their loop.

on the sender it looks everything fine, and messages are being sent (sometimes they stop for several seconds, and then continue sending)

on the receiver the messages received are extremely long garbled strings,

1:37:56.542 -> LoRa Receiver
11:37:56.575 -> Starting LoRa failed!
11:37:58.762 -> LoRa Receiver
11:37:58.797 -> Received packet 'a00aaa000a0aaaaaaa0!⸮aaa⸮Baaaa⸮a⸮⸮⸮Ca	⸮⸮⸮⸮A⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮`y⸮^=^8⸮ ⸮NF	⸮a ⸮$ '#⸮aaaaaaaaaa⸮ ⸮NF	@B1⸮⸮⸮D⸮⸮⸮⸮⸮⸮D⸮⸮⸮⸮⸮t`GC0⸮⸮⸮ @@0 x⸮⸮

and it seems to receive data even when the sender is off.

any clues of what could I be doing wrong here?

The RFM95W is a 3.3V supply device, so use logic level conversion between the NANO and RFM95W pins.

Could be an issue with the code too, but you did not post it.

hello,

thanks for your help, I’m not sure I understand what you mean by logic level conversion, I didn’t think that would be the issue, because when I tested on the arduino uno it did work fine (and that’s 5v too). It’s been pretty hard for me to figure which pins connect where, I still think I might have gotten something wrong there.

I thought I could place between arduino output and rfm95w input a 100 ohm resistor.

but I’m not sure which pins should I treat this way

Here’s the code, it’s the library example from https://github.com/sandeepmistry/arduino-LoRa

sender:

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

int counter = 0;

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

  Serial.println("LoRa Sender");

  if (!LoRa.begin(915E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);

  // send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(5000);
}

receiver:

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

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

  Serial.println("LoRa Receiver");

  if (!LoRa.begin(915E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  // try to parse packet
  int packetSize = LoRa.parsePacket();
  if (packetSize) {
    // received a packet
    Serial.print("Received packet '");

    // read packet
    while (LoRa.available()) {
      Serial.print((char)LoRa.read());
    }

    // print RSSI of packet
    Serial.print("' with RSSI ");
    Serial.println(LoRa.packetRssi());
  }
}

The code from that library does work, so the starting assumption is that you have it wired wrong in some way.

The symptoms do suggest the NANO (a 5V device) is possibly having trouble reading the logic pins on the 3.3V device.

Google 'Arduino logic level conversion' for some tips.

Do not assume you do not need to follow standard practice for logic level conversion because it happend to work on one micro without it.

I see, thanks, I'll procure the converters and try again.

I would save your money and buy a 3.3V Arduino.

The 3.3V output of the Nano has a current capability of 50mA if I recall correctly, thats unlikely to be enough to power the RFM95 as a transmitter.