NRF24L01+ Transceiver Module

Goeytex

Senior Member
I recently recently received a pair of these modules from Spark Fun in order to help a friend who was having trouble getting them working. Neither of us had any experience with SPI.

Well, getting these to work with a Picaxe is not for the faint of heart or those that give up easily.

I chose the 20x2 and after at least 40 hours of fiddling I have the pair communicating nicely using one as a dedicated transmitter and the other as
a dedicated receiver. This is because the transmit section on one of the modules doesn't work due to me accidentally connecting the module and one of the 20x2s to 11 volts instead of 5v. The picaxe survived, but the PTX section on the NRF24L01+ did not.

In any case at 2.4 Ghz, a chip antenna and a 1 mbps air data rate the range is adequate for around the house and adjacent out buildings. Max output is 0db. An SMA with a whip might improve range a bit. Changing the air data rate to 250 kbps may also improve range at the expense of a slightly higher power consumption.

These are nice units with a lot of features and work well once the data sheet is deciphered and understood. Packet size is up to 32 bytes and CRC is automatic in what they call Enhanced Shock Burst mode. One PRX device can communicate easily with up to 6 PTX devices in a mini network that Nordic calls "Multicast". There are 126 selectable RF channels in the range of 2.4 to 2.4835 Ghz. Data can be stored in the TX FIFO and transmitted later if needed. There are 3 separate 32 byte TX and RX FIFOSs and the Pins are 5 v tolerant so you dont have to worry about frying the modules with 5v HSPI data. The transceiver module generates an "interrupt" signal when data is successfully sent, or received or if there are to many retries. The micro can read the status register to see which of these occured and then take appropriate action. So these modules are quite sophisticated but at the expense of more complex code than the typical serial out serial in modules.

If anyone in interested I will post some Picaxe code to show how I got these units to communicate using HSPI. I also wrote some routines that will dump out the settings of all the registers and send them out to the Picaxe serial terminal. And other sub routines that do a lot of the necessary functions and housekeeping. So if anyone is interested I will post the (commented) code I have to possibly make it easier for others to get these nice units working with a Picaxe.

Goeytex
 
Last edited:

matherp

Senior Member
Goeytex

I'd really appreciate seeing the code if you don't mind posting. I've a couple of these waiting in the parts drawer but have only scanned the spec sheet so far.

Thanks

Peter
 

alexlopez2612

New Member
Hello,
I just discovered this modules and I'm interested in use them. Can you please post the things that you say? It will be really good for me to start to learn about this modules working with picaxe.
Thank you very much
 

erco

Senior Member
Goeytex: I would definitely like to see your code. Did you post it elsewhere? Thanks.
 

mikeyBoo

Senior Member
hi Goeytex,
Would love to see your code as this is one of the items on my to-do list.
The project I had in mind is to use Picaxes as wireless switches or sensors to replace some of
the analog stuff that I am already using (e.g. my mailbox flasher). The thing I like about the
analog stuff is it will run for a year (or more) on a 9v battery.
However, the idea I am playing with is to use a 4011 as an SR flip-flop because of very low
operating current. When the Set input is made on the flip-flip (triggered by motion detector,switch, etc.)
it turns on the Picaxe, then after the Picaxe sends an RF code stating it's unit ID & event code
(i.e. what just happened), the Picaxe sends the Reset on the SR Lo, turning itself off.
Now the circuit is back to pulling a few microamps until the next event.

Attached a crude drawing (.jpg) of what I had in mind:

The attached drawing .pdf shows analog circuits, but illustrates the 4011 lo-power front end.
The receiver for the RF codes could be a PC/Mac (or whatever makes one happy).

Sounds like a good project for collaboration. Anybody wanna' play?
(c'mon Goeytex, let's see the code)

p.s. hey Erco, better not stay out there too long, you'll ruin your eloquent Carolina vernacular!
(special thanks to my English teacher at Jethro Bodine Technical Institute & double naught spy academy)
 

Attachments

Top