Help with NRF905?

Hi,

I’ve been working for a while on a NRF905 Electrodragon project, trying to transmit some UV sensor data wirelessly and I’ve got two problems I don’t know how to fix.

Thanks to another thread I found out it was necessary to revert to Arduino 1.6 for the NRF905, which finally got the example code working.

I then changed the example code a little to send UV sensor data instead. I’m not a coder so I apologize for the hacky code, I just need Serial Monitor information so it can be used with MaxMSP.

This is for the transmitter:

#include <NRF905.h>
#include <SPI.h>

#define BUF_LEN          32
#define CONF_LEN         10

#define NRF905_CSN       10

unsigned char tx_buf[BUF_LEN]= "Hi, Arduino   \r\n";
unsigned char read_config_buf[CONF_LEN];

byte tx_address[4]= {0xcc,0xcc,0xcc,0xcc};

// UV Sensor
int sensorValue;

void setup()
{
    unsigned char i;
    
    pinMode(NRF905_CSN,OUTPUT); //to make sure SPI works
    
    nrf905=NRF905(NRF905_CSN);
    
    nrf905.init();

    /**
        default configuration, need to specify frequency
        choose Z-Wave frequency band, support :
        US		908.42Mhz
        EUROPE		868.42MHz
        AFRICA		868.42MHz
        CHINA		868.42MHz
        HK		919.82MHz
        JAPAN		853.42MHz
        AUSTRALIA	921.42MHz
        NEW_ZEALAND	921.42MHz
        BRASIL		921.42MHz
        RUSSIA		896MHz
    */
    nrf905.write_config(NEW_ZEALAND);	
	
    nrf905.read_config(read_config_buf);

    Serial.begin(9600);

    for(i=0; i<10; i++)
    {
        Serial.print(read_config_buf[i],HEX);
        Serial.print(' ');
    }
    
    tx_buf[12] = '0';
}

void loop()
{
    delay(200);
    sensorValue = analogRead(0);                        //connect UV sensor to Analog 0   
  
  if (sensorValue == 1)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 1   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 2)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 2   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 3)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 3   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 4)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 4   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 5)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 5   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 6)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 6   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 7)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 7   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 8)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 8   \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 9)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 9   \r\n";
    nrf905.TX(tx_buf);
  }
  else  if (sensorValue == 10)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 10  \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 11)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 11  \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 12)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 12  \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 13)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 13  \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 14)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 14  \r\n";
    nrf905.TX(tx_buf);
  }
  else if (sensorValue == 15)
  {
    unsigned char tx_buf[BUF_LEN] = "UV Sensor 15  \r\n";
    nrf905.TX(tx_buf);
  }
}

Playing with the UV sensor previously (with wires) it stayed very stable until it was moved into shade. With this it seems to be working but the information sent is varying wildly (from 1 to 14 in a second). Could anyone tell me why?

Secondly the distance it transmits is super tiny, it stops working when the Arduinos are moved more than a centimeter away.

Is there a way to boost the signal?

Thank you.