Weak RSSI from RFM69HW

I’ve been working on building a home automation system similar to that built by Eric Tsai, but I’m having some signal issues with my RFM69HW chips. I have one chip connected to a Arduino Pro Mini, and another connected to a Raspberry Pi. The chips are able to communicate (most of the time), but the best signal I’ve seen so far is -93 with a distance of about 4 feet. Each chip has a 3 inch antenna attached currently, but I’ve tried as much as a 13 inch antenna with no better signal.

I’m using almost identical code to Eric Tsai’s mailbox sensor, however, I’ve noticed that if I leave the “setHighPower” uncommented, then the unit fails to transmit. If I leave it commented out, then it transmits fine, but the signal is weak. Also, in order to upload new sketches to the arduino, I need to remove power from the RFM chip.

Is my issue due to a low input power? I’ve tried powering everything via the power regulator onboard the arduino, as well as using a seperate 3.3v regulator. At all times, this was being powered by a USB port off my PC. I’ve just run the power pin from the FTDI connector to the raw pin or the voltage regulator instead.

Here’s my code:

Original Author:  Eric Tsai
License:  CC-BY-SA, https://creativecommons.org/licenses/by-sa/2.0/
Date:  7-21-2014
File: Mailbox.ino
This sleeps until interrupted, then sends data via RFM69

Modifications Needed:
1)  Update encryption string "ENCRYPTKEY"

//RFM69  --------------------------------------------------------------------------------------------------
#include <RFM69.h>
#include <SPI.h>
#define NODEID        41    //unique for each node on same network
#define NETWORKID     101  //the same on all nodes that talk to each other
#define GATEWAYID     1
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
//#define FREQUENCY   RF69_433MHZ
//#define FREQUENCY   RF69_868MHZ
#define FREQUENCY     RF69_915MHZ
#define ENCRYPTKEY    "xxxxxxxxxxxxxxxx" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME      30 // max # of ms to wait for an ack

#define SERIAL_BAUD   9600  //must be 9600 for GPS, use whatever if no GPS

typedef struct {		
  int           nodeID; 
  int			deviceID;
  unsigned long var1_usl;
  float         var2_float;
  float			var3_float;
} Payload;
Payload theData;

char buff[20];
byte sendSize=0;
boolean requestACK = false;
RFM69 radio;

//end RFM69 ------------------------------------------

//analog read
int analogPin = 0;
byte adcsra_save;

#include <avr/sleep.h>

const byte LED = 8;
const byte redLED = 4;
const byte greenLED = 5;
int scan_num = 0;		//keep track of how many times opened.
long lastDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 50;    // the debounce time; increase if the output flickers
int buttonState;             // the current reading from the input pin
int lastButtonState = LOW;   // the previous reading from the input pin
boolean stable = false;      // determines whether the button reading is stable

void wake ()
  // must do this as the pin will probably stay low for a while
  detachInterrupt (1);
  // cancel sleep as a precaution

}  // end of wake

void setup () 
    digitalWrite (2, HIGH);  // enable pull-up
    Serial.begin(SERIAL_BAUD);  //Begin serial communcation
    adcsra_save = ADCSRA;	//save ADCSRA to re-enable later.
    #ifdef IS_RFM69HW
      radio.setHighPower(); //uncomment only for RFM69HW!
    char buff[50];
    sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
    theData.nodeID = 41;  //this node id should be the same for all devices in this node
    pinMode (LED, OUTPUT);
    pinMode (redLED, OUTPUT);
    pinMode (greenLED, OUTPUT);
    digitalWrite (greenLED, HIGH);
    Serial.println("finished setup");
  }  // end of setup

void loop () 
  // read the state of the switch into a local variable:
  int reading = digitalRead(3);
  if (reading){
    digitalWrite (LED, HIGH);
    //re-enable analog:
    ADCSRA = adcsra_save;
    scan_num = scan_num + 1;
    //send data
    theData.nodeID = 41; 
    theData.deviceID = 2;
    theData.var1_usl = millis();
    theData.var2_float = scan_num;
    //radio.sendWithRetry(GATEWAYID, (const void*)(&theData), sizeof(theData));
    theData.var3_float = (analogRead(A3))*3.30/1023.00*2.00;
    //use either send;  sendwithretry sends it 3 times if no ack
    //radio.sendWithRetry(GATEWAYID, (const void*)(&theData), sizeof(theData));
    radio.send(GATEWAYID, (const void*)(&theData), sizeof(theData));
    digitalWrite (LED, LOW);
    // disable ADC
    ADCSRA = 0;  
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  

  // Do not interrupt before we go to sleep, or the
  // ISR will detach interrupts and we won't wake.
  noInterrupts ();
  // will be called when pin D2 goes HIGH  
  attachInterrupt (1, wake, HIGH);
  // turn off brown-out enable in software
  // BODS must be set to one and BODSE must be set to zero within four clock cycles
  MCUCR = bit (BODS) | bit (BODSE);
  // The BODS bit is automatically cleared after three clock cycles
  MCUCR = bit (BODS); 
  // We are guaranteed that the sleep_cpu call will be done
  // as the processor executes the next instruction after
  // interrupts are turned on.
  interrupts ();  // one cycle
  sleep_cpu ();   // one cycle

  } // end of loop

Maybe another way to approach this is, How can I tell which side has the issue, sender or receiver? Perhaps it's both, but is there a good way to find out, outside of an oscilloscope? If I put a multimeter across the transceiver, I don't see a significant change in mA during transmission.

Hi, it seems I am in the same boat as yours, got the whole setup working from the instructable you are referring to (http://www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/?ALLSTEPS) and the library provided by abouillot on Github (https://github.com/abouillot/HomeAutomation/tree/master/piGateway), so now running the central node on my PI and a node on arduino Uno.

I am seeing regular MQTT messages, but RSSI is no higher than -90db. This means, I can't move the node further than a few meters from the central hub on the pi. I have tried a new RFM69HW, same result. New dupont cables, same result. using a 10cm antenna, made sure its not connected to ground.

My setup is somewhat different than in the instructable, I use a 5v Arduino uno as node, so am using logic level converters to regulate voltage up/down between 5v and 3.3v.

Curiously, when I power the arduino with 5v it sends messages happlily all day long, but no go on 9v...

Anyone any clues?

I finally got my RSSI to a good place. I’m not completely certain what it was, but I was running through an external voltage regulator previously, and am now running through the on-board regulator.

I have a hunch that my external regulator (MCP1702, 3.3v) was limiting my current too much. Apparently that regulator has a maximum current of 250mA. Since it was powering the arduino and the RFM69, it’s likely it just couldn’t keep up with the 130mA spike that was required for the high power.

Good luck troubleshooting!

Oh - And there is a known issue with the raspberry pi not providing a strong signal when transmitting back to the arduino. See the conversation here: https://github.com/abouillot/HomeAutomation/issues/7

abouillot is working on testing a power converter to power the rfm chip off the 5v pin instead, since that should have higher current potential. We're still waiting to see if that test was successful or not.

Hi all, i now have the stuff to test the overall system.... so I'm so curious to do it ASAP! Just a question: have you used capacitors to stabilize and clean the power you supply to both arduino and rpi? Gi@n

I haev the setup now running on the Pi with an AMS 1117 voltage regulator, this helps a little in increasing Db strength, but not by much, when I test receiving with an anarduino with RFM69HW as gateway I still get better reception. I might opt to create an arduino gateway anyway instead of using the Pi as one.