Nordic FOB and nRF24L01+

Nordic FOB and nRF24L01+

Sparkfun sells a nifty little gadget to control your project remotely using nRF24L01+ radios. It’s a small key fob with 5 buttons, which transmits codes when you press each button. Today we’re going to explore how to receive those signals using the RF24 library. This is all thanks to Kirk Mower who sent me these units for Christmas. Thanks, Kirk! 🙂


Qty Vendor# Description Price
1 WRL-08602 Nordic FOB $24.95
1 WRL-00691 Transceiver nRF24L01+ Module with Chip Antenna $19.95


Sparkfun nRF24L01+ module connections

Connecting the Sparkfun transceiver unit to an Arduino using a breadboard is easier than with the typical modules. Does that make it worth $20 over $4? You’ll have to decide that. To connect it, we can follow the guidance on my previous post, Getting Started with nRF24L01+ on Arduino. Wiring it this way means we can use all the RF24 examples, which are set up to use these pins by default.

Radio Arduino
CE 9
CSN 10
SCK 13


This is now an example for the RF24 library, nordic_fob.pde.

Setting up the radio is simply a matter of matching the radio parameters on the receiver with those of the transmitter. We can refer to the device firmware for the transmitter settings.


The payload sent by the transmitter is 4 bytes long. The first is one byte containing the current state of the buttons. The low 5 bits correspond with each button, and the bit is 1 when the button is up and 0 when pressed. Bytes 2 & 3 are a 16-bit sequence number I call the ‘id’. Every time the unit sends a packet, the sequence number is increased by 1. The 4th byte is not used. So this is what our payload looks like:

struct payload_t
uint8_t buttons;
uint16_t id;
uint8_t empty;

The main loop simply listens for packets, and dumps out the results, translating the button bits into words so it’s easier to read.

void loop(void)
// Receive each packet, dump it out

// if there is data ready
if ( radio.available() )
// Get the packet from the radio
payload_t payload; &payload, sizeof(payload) );

// Print the ID of this message.  Note that the message
// is sent 'big-endian', so we have to flip it.
printf("#%05u Buttons ",flip_endian(;

// Print the name of each button
int i = num_buttons;
while (i--)
if ( ! ( payload.buttons & _BV(i) ) )
printf("%s ",button_names[i]);

// If no buttons, print None
if ( payload.buttons == _BV(num_buttons) - 1 )




Filed under Arduino, RF Radio

13 responses to “Nordic FOB and nRF24L01+

  1. Great. So what pins/wires did you use to solder the RF unit onto those male pins for the BreadBoard?

  2. Those are right-angle pin strip headers. Mouser part #517-500-01-36.

  3. Finally got to trying it out – I get an infinite loop when running the example Nordic_FOB.pde (well as .ino in Arduino 1.0). From the Serial Monitor:

    #65535 Buttons
    #65535 Buttons
    …and on – button clicks don’t seem to get picked up at all.
    Do I need to change the address of the radio in Nordic_FOB.pde to one of those parameters at top? Thanks.

    • > RX_ADDR_P0-1 = 0xffffffffff 0xffffffffff
      All these FF’s are telling us that the software cannot communicate with the radio attached to the Arduino. This usually means one of the wires is not connected properly.

  4. OK – I may have fried the radio by having mistakenly plugged it into 5V previously….

  5. John

    I made some changes for noobs like me who do not understand the arrays and const functions. See

  6. Don

    After no success with other libraries, yours worked very easily! Thanks so much.
    I am using the Nordic FOB and it read key presses and outputs to the serial monitor, however I get:
    1-¤ 5êä¤qDC@C”’j˜¨˜A`–’zž2b ÑGˆeð²Èx‚
    zÑ8©a.@Ãd,9Cp8BQjb–j˜¨˜A`–’zž2b ÑGˆeð²Èx‚
    þÃøþÂè þâÄàBÉ`ôbÄQðCØ@ðbÌÕÿBÁ ðãØ@ðBÉøñâèáÂéàñ

    That last line is a series of key presses.
    Any hints on how to turn that into plain English?
    Thanks so much!

  7. Thanks, worked perfectly first time! Now I just need an idiots guide to re-programming the FOB so I can switch to a different channel…

  8. John Howard

    Do these fobs have an identifier so that it’s data can be recognized or ignored (such as is done with a garagedoor opener)?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s