nRF905 Radio Library for AVR and Arduino

The nRF905 is a radio transceiver IC similar to the well known nRF24L01, but operates at 433/898/915MHz instead of 2.4GHz, has a much longer range and a few extra IO pins. However, the nRF905 data rate is only 50Kbps compared to nRF24L01’s 2Mbps.

This library offers quite a bit of flexibility: Optional use of interrupts, 2 of the connections to the module are optional since their states can also be accessed by the ICs status register, and supports basic collision avoidance.

NOTE: v3.0.0 of the library was released on 12th September 2017, the default CD pin has changed and the AM pin is now used by the library.

ArduinoDocumentation (or use the Arduino library manager, search for “nrf905”)
AVR (non-Arduino)

nRF905 ATmega48/88/168/328 Arduino Uno Description
VCC 3.3V 3.3V Power (3.3V)
CE D7 (13) 7 Standby – High = TX/RX mode, Low = standby
TXE B1 (15) 9 TX or RX mode – High = TX, Low = RX
PWR B0 (14) 8 Power-up – High = on, Low = off
CD D4 (6) 4 Carrier detect – High when a signal is detected, for collision avoidance
AM D2 (4) 2 Address Match – High when receiving a packet that has the same address as the one set for this device, optional since state is stored in register, if interrupts are used (default) then this pin must be connected
DR D3 (5) 3 Data Ready – High when finished transmitting/High when new data received, optional since state is stored in register, if interrupts are used (default) then this pin must be connected
SO B4 (18) 12 SPI MISO (Mega pin 50)
SI B3 (17) 11 SPI MOSI (Mega pin 51)
SCK B5 (19) 13 SPI SCK (Mega pin 52)
CSN B2 (16) 10 SPI SS

Some of the module pin names differ from the IC pin names in the datasheet:

Module IC

The nRF905 is not 5V compatible, so some level conversions will need to be done with the Arduino outputs. A simple voltage divider or resistor and zener diode will do the trick. Only TXE, CE, PWR, SI, SCK and CSN pins need level conversion (not CD, AM, DR and SO).

Divider Zener

The nRF905 has 511 channels ranging 422.4MHz – 473.5MHz in 100KHz steps on the 433MHz band and 844.8MHz – 947MHz in 200KHz steps on the 868/915MHz band (remember to check which frequencies are legal in your country!), but each channel overlaps adjacent channels so there are only a total of 170 usable channels at once.

Searching for nRF905, PTR8000 and PTR8000+ should yield some results for modules on AliExpress, Ebay and DealExtreme. You should be able to get 2 for around £10.

Since v3.0.0 this library uses callbacks which are ran when events occur. If the option to use interrupts is enabled then the callbacks will run from the interrupt routine so be sure that any global variables you use in them are declared ‘volatile’, just as you would when dealing with normal ISRs. These events will wake the microcontroller if it is sleeping.

Event Callback Notes
New packet incoming NRF905_CB_ADDRMATCH  
Valid packet received NRF905_CB_RXCOMPLETE  
Invalid packet received NRF905_CB_RXINVALID  
Packet transmission complete NRF905_CB_TXCOMPLETE This only works if the nextMode is NRF905_NEXTMODE_STANDBY when calling nRF905_TX()

Nitty-gritty radio stuff
The actual air data-rate of nRF905 is 100Kbps, but the data is Manchester encoded which halves the throughput to 50Kbps. The modulation is GFSK with ±50KHz deviation. The radio also adds a few extra bits of data to the address and payload; a preamble and CRC.

Transmitted packet
10 bits
1 or 4 bytes
1 – 32 bytes
0 – 2 bytes

The address is also used as the syncword and should have as many level shifts as possible. 10100110 01100101 00011010 11011010 (2791643866) would be a good address to use, but 00000000 00000000 00000000 0010000 (32) would not be.

The CRC is used to detect errors in the received data. Having a CRC doesn’t eliminate all bad packets, there is always a small chance of a bad packet passing the CRC. Using larger CRCs helps to reduce that chance.
When the CRC is set to 16 bit the radio uses the CRC16-CCITT-FALSE (0xFFFF) algorithm. I’m not sure what it uses for 8 bit CRCs.

Transmission time
The sizes of the address, payload and CRC can be adjusted for a balance between throughput and latency.

Example configurations
Address size Payload size CRC size = Throughput (bps) Latency (ms)
4 32 2 = 36940 6.93
1 4 1 = 17680 1.81
1 1 0 = 6838 1.17

Throughput is how much useful data can be sent (the payload part), assuming no delays for writing and reading the payload.
Latency is how long it takes for the transmission to complete.
Switching from standby mode to receive or transmit mode takes a maximum of 650us and switching between receive and transmit modes takes a maximum of 550us.

Transmission time can be worked out with:

t = tstartup + tpreamble + ((Naddress + Npayload + NCRC) / BR)

tstartup is the time to switch mode as stated above (650us / 550us).
tpreamble is 200us for the 10 bit preamble.
Naddress, Npayload and NCRC are the address, payload and CRC sizes in bits.
BR is the bit rate which is 50,000.

For config 1, switching from standby to transmit:

t = 0.00065 + 0.0002 + ((32 + 256 + 16) / 50000)
t = 0.00693 seconds (6.93ms)

A note to developers: Before v3.0.0 this library would load the address bytes in reverse order, keep that in mind if you’re using an old version of the library to interface with other radio systems!


3 pings

Skip to comment form

    • Chris on July 28, 2019 at 7:31 pm
    • Reply

    Hello Zak,
    First of all thank you for this library. Great work!
    The communication of my modules works flawlessly. I have also connected 2 Sevomotors to the Mega (PIN 40 and 42 with separate power supply) which permanently ticks when the communication starts. Do you have any idea why this could be?
    Many thanks and best regards,

    1. Hey Chris, thanks! You’ll have to post your code before I can see what’s up! ->

    • Tim on September 27, 2019 at 8:23 pm
    • Reply

    Hi Zak, I’ve built a few of these links running at 4800 baud to handle 30 bytes of data every 250mS running at 433MHz carrier.

    However on one of the links it runs ok for about 20 seconds then hangs no tx or rx activity. This problem can happen at either end and I suspect it may actually be nRf905 module related.

    I’ve tried disabling IRQ and other variants but always the same result.

    Pressing the reset button on the tx Arduino fixes the problem. Maybe there’s an overflow problem somewhere ?

    Any pointers on how to debug ?

    I’ll try slowing down the refresh rate from 250mS to 1S and see what happens

    • Tim on September 27, 2019 at 8:52 pm
    • Reply

    Hi Zak, me again. Just reduced the update rate to 1 second and still the same problem. However looking at the MOSI pin on the nRF905 when the sending end stops transmitting there is not the normal activity on this pin – looks as though some is corruption.
    Then it’ll start up again.

    Time for a beer – will look at this again tomorrow as I’m well down a ‘rabbit hole’ here 🙂

    • Tim on September 28, 2019 at 8:52 pm
    • Reply

    Hi Zak,

    further to my last e mail about a problem I was having – I’ve managed to fix it.
    I’m running the wireless UART example and found that it would hang in the rx loop and not detect incoming traffic unless the device was reset.
    This problem appears with both the Arduino and AVR code on 2 out of 5 links.
    I fixed it by putting a watch timer set to 1 second which gets reset on transmission or reception of data.
    Thus when the rx stops getting traffic the watch dog kicks in and restarts the link.
    Bit of a bodge as I’m not sure how to get to the root cause.
    Before this fix when the rx hung the carrier detect line didn’t work – so suspect it could be the nRf905 losing it settings and needing to be re-initialized ?

    Regards Tim

    1. Hey Tim, the wireless link example isn’t really very reliable, but it shouldn’t cause things to hang. Things will get even more wack if you’ve got 5 modules with the wireless link example all talking to each other, since it’s only meant for 2 modules! I don’t think the modules are loosing their settings, what state are the TXE, DR and CE pins in when it hangs?

        • Tim on September 28, 2019 at 9:53 pm
        • Reply

        Hi Zak,

        thanks for the reply – just to clarify I’m only using them in pairs but have seen this problem on a couple of pairs and the problem moves with a particular unit.
        Each pair is far enough away not to cause mutual interference and operate on a clear frequency in the 70cm 433MHz band for which I’m licensed.
        By wrapping some extra code around yours combined with the watch dog timer it’s now fairly robust.
        I’ll check the TXE, DR and CE lines when it hangs and report back.

        Best regards Tim

    • Tim on September 29, 2019 at 12:58 pm
    • Reply

    Hi Zak,

    when the rx hangs all the lines are as they should be – a bit more testing seems to indicate the rx crash is possibly being caused by something on the tx side.

    Maybe irq collisions between UART and SPI ?

    I’m sending a total of 30 characters including a string terminator and I suspect this might be the root cause as this is the maximum allowed #define MAX_PACKET_SIZE (NRF905_MAX_PAYLOAD – 2).

    Wonder why maxpayload is -2 ?

    As I’m always sending a fixed length message I’m wondering if there’s a better way to assemble the message in the nano ready for the nRF905 to process it ?

    Currently I’m sending the message character by character at 4800 – just for fun I’ll try 9600.

    Regards Tim

    • Tim on September 29, 2019 at 7:42 pm
    • Reply

    Hi Zak,

    still plugging away at this and learning / discovering as I go along. As I suspected sometimes the tx gets corrupted and either sends jibberish or only part of the packet – maybe roughly once out of a 100 packets.
    I see you mention in your code about needing a 700uS delay going from tx to rx to avoid this so I set it to 1mS then 2mS and seems to have helped but not perfect.
    I also tried to remove your ‘ack code’ – seemed pretty obvious how it worked but strangely it shortened the tx data packet.
    Time for another break and reflection !
    I’m thinking it maybe the nRF905 chip – perhaps a counterfeit device ?
    I have another batch of nRF905’s coming so will see if that helps.

    Regards Tim

    • Tim on September 30, 2019 at 7:29 pm
    • Reply

    Ok, I’m 99% certain it’s a dodgy chip problem as my code works fine on 4 out of 5 links and never misses a beat.

    On the plus side it’s caused me to refine the protocol and generally harden the code to cope with drop outs and missed data.

    I’m going to install the next batch of nRF905 modules in sockets for easy test and replace meant !

    Thanks for a great piece of code and listening to my trials and tribulations !

    • saniul on October 2, 2019 at 1:05 am
    • Reply

    Hi Zak,
    I need your help. I need to transmit a constant data through the nrf905 transceiver module at 915mhz band. I have a arduino uno and a nano. can you please tell me how to set up the whole thing and code for transmitting a constant data. I need these for my final year project. Another thing, Can it jam a mobile signal which operates under 915mhz frequency band? I know it’s illegal to make a jammer but I am working on this project which needs to jam a signal, Which I would use with my bomb disposing robot.

    1. lol I’m not going to do your school work for you.

    • Geoffrey Brown on December 4, 2019 at 11:23 pm
    • Reply

    There are a number of NRF905 + STC15F204 combinations available from various places:,searchweb201602_2,searchweb201603_55

    The STC module appears to have defined pins for certain functions (presumably for TxE, DR, CD etc).!Am_AnSJTVHLYmo8ib-sQB_OszURpew?e=yHpupr

    It appears that the device uses a serial interface perhaps for a lot of functions and the pin assignments indicate to me that there is no SPI interface as on a mega these use D50-D52. The fact that it references P34 and P55 indicates this is intended for connection to a Arduino Mega only as other processors, to my knowledge, don’t have these pins. I think the DR and AM pins need to go to external interrupt lines so the fact that none of the labelled ports, to my knowledge.

    I suspect it was perhaps produced for a company for a specific need hence the reason that there is little available on it on the internet.

    Anyway, if you can shed any light on this it would be much appreciated.

    Geoffrey Brown, Papamoa, NZ.

    1. Hi Geoffrey, those STC15F204/NRF905 modules are plain serial-RF bridges, and are not compatible with this library (it runs its own code on the STC15F204). Those extra pin holes appear to be extra GPIOs from the STC15F204 microcontroller rather than connections to the nRF905 module. I don’t think they have any special protocol, just send it serial data at the correct baud rate and out pops the data wherever other modules are that are in range.

    • Andrei on December 9, 2019 at 1:09 pm
    • Reply

    Is it possible to change pins 2,3,4 and 7 to analog pins? As far as I know, analog pins can be used as digital, but not the ones with pwm.


    1. Hey Andrei! Pins 4 and 7 can be moved around anywhere (change things in nRF905_config.h), but 2 and 3 must be interrupt pins unless you disable interrupts (NRF905_INTERRUPTS 0).

    • Geoffrey Brown on January 25, 2020 at 9:26 am
    • Reply

    I believe I have uncovered a little issue with this library, in particular, in regards the nRF905_TX routine.

    I, like some others have mentioned, have had a situation whereby the communications have come to an end and the Arduino Mega, in my case, needed to be restarted.

    The issue I believe is as follows:

    uint8_t nRF905_TX(uint32_t sendTo, void* data, uint8_t len, nRF905_nextmode_t nextMode)
    // TODO check DR is low?

    return 0;

    setAddress(sendTo, NRF905_CMD_W_TX_ADDRESS);

    // Load new payload
    if(data != NULL)
    for(uint8_t i=0;i<len;i++)


    return 0;

    // Put into transmit mode

    // Pulse standby pin to start transmission

    if(nextMode == NRF905_NEXTMODE_RX)
    // The datasheets says that the radio can switch straight to RX mode after
    // a transmission is complete by clearing TX_EN while transmitting, but
    // if this is done within ~700us the transmission seems to get corrupt.
    else if(nextMode == NRF905_NEXTMODE_STANDBY)
    // else NRF905_NEXTMODE_TX

    return 1;

    What happens is that the CHIPSELECT() part that is inside the NRF905_ATOMIC section does two things as seen in its associated define (if I have things right):

    #define CHIPSELECT(standby) standby; for(uint8_t _cs = cselect(); _cs; _cs = cdeselect())

    #define STANDBY_LEAVE() (digitalWrite(NRF905_TRX_EN, HIGH))
    #define STANDBY_ENTER() (digitalWrite(NRF905_TRX_EN, LOW))

    It enters standby mode (CE line goes low) as the first step. Note that in Zac’s code NRF905_TRX_EN is synonymous with CE (chip enable). The second part (in the for loop) toggles the CSN pin.
    So if we look at the first part of the code we have:

    if(data != NULL)
    for(uint8_t i=0;i<len;i++)

    And NRF905_ATOMIC has the following define:

    #define NRF905_ATOMIC() for(uint8_t _cs2=interrupt_off(); _cs2; _cs2=interrupt_on())

    So this NRF905_ATOMIC part of the loop turns interrupts off then on again at the end of the loop. The CHIPSELECT inside this turns the NRF905 into standby mode (CE low) and pulses the CSN line low while SPI communications are occurring:

    Now if COLLISION_AVOID is enabled (default) the second nrf905_airwayBusy check is made. This is marked as //PROBLEM LOCATION in code above and reproduced below:

    return 0;

    // Put into transmit mode

    // Pulse standby pin to start transmission

    The end result is that if the NRF905 is busy receiving a packet at this point in the code (nrf905_airwayBusy is true) the nRF905_TX routine causes the device to return with the NRF905 in a standby state (from the CHIPSELECT loop) and the STANDBY_LEAVE never occurs as this code is after the return 0 of the second nRF905_airwayBusy and so is never reached. The upshot is that the nRF905_TX routine returns having left the NRF905 in a standby mode and the packet transmit has not started. The device will not receive another packet even if the device was in receive mode before the nRF905_TX routine was called (refer nRF905_RX()). If the code abandons the transmit of the packet then we have the signals left in the following state according to my multimeter:

    TXE 0V (read mode)
    CE 0V (also TRX_EN in code; device in standby) – this is the problem
    PWR 3.2V (device powered on)
    AM 0V (no address matched because device in standby mode)
    DR 0V (no data ready because nothing happening)

    The interrupts are left enabled (from the NRF905_ATOMIC loop completing fine). The CSN line is also left in the correct state because the CHIPSELECT loop completes as well.

    If the packet being sent was in response to a packet received (the last one) and if this issue occurs in nRF905_TX and the nRF905_TX is abandoned in the code for whatever reason then the nRF905_TX leaves the system in an mode where nothing will be received again until nRF905_RX() is called.

    What is needed is one of three solutions:

    1) Don’t perform the second check of nRF905_airwayBusy because you already did it at start of nRF905_TX routine – my preferred answer. The second nRF905_airwayBusy and the return is what is causing this issue.

    2) In the second nRF905_airwayBusy check do the following:

    if(nRF905_airwayBusy()) {
    return 0;

    3) After any failed nRF905_TX immediately call nRF905_RX() to restore an operational receive mode.

    This will undo the effect of the CHIPSELECT having entered standby mode.


    1. Hi Geoffrey, I get where you’re coming from about the CHIPSELECT() standby stuff, however this is not the case. The first parameter of the CHIPSELECT() statement is blank, which means that “standby” in the #define is also blank, and does not enter standby mode. To enter standby mode it would have to be written as CHIPSELECT(STANDBY), but this was only used in older verions of the library in a few places.
      The only way nRF905_TX() might assert the standby pin is by setting nextMode to NRF905_NEXTMODE_STANDBY.

        • Geoffrey Brown on March 2, 2020 at 9:15 am
        • Reply

        Many thanks for that feedback. Very useful. Have some more learning on #defines to do…

    • Michael on October 29, 2020 at 5:57 am
    • Reply

    Brand new to all of this.
    I wired as per the diagram and opened the supplied code in the IDE. Tried to upload but got errors with the include statement . copied all of the nRF905 folder to the libraries but no luck. Copied the individual files into the same folder as the sketch and it seems better. i now get:

    In file included from nRF905.c:15:0:
    /usr/share/arduino/libraries/SPI/SPI.h:36:1: error: unknown type name ‘class’
    class SPIClass {
    /usr/share/arduino/libraries/SPI/SPI.h:36:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{‘ token
    class SPIClass {

    1. You’re using the files for non-Arduino stuff, only use the stuff in the arduino folder. Also, try using the new library here –

        • Michael on October 29, 2020 at 11:29 pm
        • Reply

        I really appreciate the reply Zak. Have downloaded the files from Github however they seem to be only examples. I copied the nRF905-master/arduino/nRF905 library files to ~/Arduino/library/nRF905 and also to /usr/share/arduino/library/nRF905 however it did not much difference.

        I then tried to run the lowpwr_note_baseStation and got the following error:

        lowpwr_node_baseStation.ino:20:22: fatal error: LowPower.h: No such file or directory
        compilation terminated.

        Sorry for my lack of understanding.

        1. I’m not sure what you mean by they’re only examples, but to fix your error you also need this library

          • Michael on October 30, 2020 at 1:08 am
          • Reply

          Hi again Zak,
          Well, I have found one very silly thing I should have though about earlier – my preferences were pointing to the wrong directory!! No wonder it could not find the library.
          It seems to be compiling and uploading OK now. Now I just need to waiting on my second nRF905 arriving before I can test it.

    • Andrei on January 3, 2021 at 9:18 am
    • Reply

    I’m trying to compile wireless serial example, but i get this errors…
    wirelessSerialLink:40:18: error: 'NRF905_ADDR_SIZE' was not declared in this scope
    byte dstAddress[NRF905_ADDR_SIZE];
    C:\Users\Andrei\Google Drive\Arduino\libraries\nRF905_Radio_Library\examples\wirelessSerialLink\wirelessSerialLink.ino:40:18: note: suggested alternative: 'NRF905_ADDR_SIZE_RX'
    byte dstAddress[NRF905_ADDR_SIZE];
    C:\Users\Andrei\Google Drive\Arduino\libraries\nRF905_Radio_Library\examples\wirelessSerialLink\wirelessSerialLink.ino: In function 'void NRF905_CB_RXCOMPLETE()':
    wirelessSerialLink:52:2: error: 'nRF905_read' was not declared in this scope
    nRF905_read((byte*)newData, sizeof(newData));

    (*ADMIN EDIT* Shortened error messages)

    I’ve used your library in the past, but it was working fine. Any suggestion?

    1. Hey Andrei, that’s expected. The wireless serial example has a comment at the top that says “DONT USE THIS EXAMPLE, IT STILL NEEDS TO BE UPDATED FOR THE NEW VERSION OF THE NRF905 LIBRARY (v4)”.

        • Andrei on January 3, 2021 at 11:41 am
        • Reply

        :)) I’m sure you are tired of ignorants.
        Sorry for bothering you. I needed the code, I knew it as a working code and took it…surprise.

        1. It’s fine 🙂 If you really need the old stuff working again then you can get v3.1.0 from here

    • Pablo on April 13, 2021 at 11:57 am
    • Reply

    Hi, are you usign Manchester Encoded data before GFSK Modulation in “lowpwr_node_sensor” example?

    Thanks and amazing repository! 🙂

    1. Hi Pablo, data is automatically manchester encoded and decoded by the radio IC.

    • Jarosław on April 21, 2021 at 10:01 am
    • Reply

    I want to pair 2 devices. I have a problem with addressing. I generate random addresses for devices, and this is not a problem. The problem is to assign a generated UINT32_T number in HEX format to the variable in which I want to keep the address. I tried through string, but without the effect. There is still a problem with the data type.
    Can you help me?

    p.s. code:
    uint32_t RXADDR = 0xE7E7E7E7; //this work
    uint32_t buforWysylany.adresMiernika = random(268435456,368435456);
    RXADDR = “0x”+ (buforWysylany.adresMiernika ,HEX); //this is my problem

    1. Hi Jaroslaw, the 0x part tells the compiler that its a hex value, which tells it to convert 0xE7E7E7E7 to 3890735079 decimal during compilation. All you need is RXADDR = buforWysylany.adresMiernika; without any string conversion.

        • Jarosław on April 21, 2021 at 11:38 am
        • Reply

        I think I tried so. I will try again.
        Thank you for the quick reply.

    • henry on April 23, 2021 at 11:35 am
    • Reply

    Hi all,

    i would like to be able to send a single message to all my NRF905 and get a message back.

    Is this possible or i need to send individual message to each radio devices ?


    1. Hi Henry, if all of the receiving radios have the same address then they will all receive the same message. However, if you also want all of them to reply to that message then you will have to make sure that only 1 radio transmits at a time, otherwise the transmissions will corrupt each other. The library does include some collision avoidance where it checks for other transmissions before transmitting, but it may not be 100% effective. It’s probably easier to send a message to each radio one at a time (each radio will need a unique address).

        • henry on April 23, 2021 at 2:16 pm
        • Reply

        Hi Zak,

        thanks for a such prompt answer !

        No unfortunately not, each device will have its own address. i was thinking, at “switch on” of the server, to interrogate all the “client” devices in order to know which ones are up and running and optionally to ask them for the revision of their software.
        I guess i will stick to a certain range of addressees and ping them all sequentially. Unless you come up with good idea 🙂


Leave a Reply to Zak Kemble Cancel reply

Your email address will not be published.

Are you human? *