[Request - Answered] nRF24L01+ library

FlorianZ, the Smartthings shield is essentially an AT command version of the EM357. I am looking at making “things” with the Spark and integrating through their cloud and smartapps. Smartthings has announced that they will be adding WiFi device capability and work to use the Spark has been discussed in another topic on this forum. These are still early days.

As for the zigbee module, I still have not decided if the Spark and its dependency on the Spark Cloud is a good match for a zigbee module. And I too found out that developing for the M3 processors of the EM357 and the like is not cheap. I don’t want to use an AT command-based zigbee module if I don’t have too! :smile:

RWB, digole is now carrying 2 xbee/xbee pro adapter boards (xbee to standard proto board pinout). One has a 5v-to-3.3v converter, the other does not. They are mega cheap ($1.30)! Thought you should know :smile:

@peekay123 yea I saw that but then read the reviews on Amazon about them and people said that the pin spacing is not breadboard friendly. I picked up some boards from Parellax .

The 2 x XBee Pro 900 HP’s are supposed to arrive today FYI

Parallax’s xbee adapter looks just as non-breadboard friendly as Digole’s. I’m guessing it’s because the xbee is wide and the board’s “wings” cover up your breadboard wiring. Not really that much of an issue though.

I do like Parallax’s adapter because it had the FTDI right on it, but I wouldn’t want to pay for that for each of my xbee’s since I have a FTDI friend that would work the same.

@Bdub Yea same here. I plan to use use my FTDI Friend to program the XBee’s. I got the cheap $3 boards because I only plan on using 3v sensors with it anyway. I’ll buy the better boards if I need them in the future from Spark Fun or Adafruit which both have boards.

Oh I see the cheap non-FTDI one now: http://www.parallax.com/product/32403

I picked up the 900Mhz 2.1 Gain Dipole Antenna from them also.

@BDub stick around I’m sure I’ll need your brain to get this thing working right.

@BDub @peekay123 @timb @rlogiacco

The XBee Pro 900 HP radios came in and I was able to do a quick range test with them. I got a pretty impressive .77 miles with just putting one transmitter in the front window and then drove out and ran the range test app in Digi’s X-CTU software which is really nice, its been updated. I’m sure I could have gotten more range but I didn’t have time to go any further.

I also received the Amplifed nRF24L01+ with antennas today also so we can do a range test against the XBee once I figure out how to use it.

I’ll do a separate thread on the XBee radios later. Just figured I would share this for now since I was kinda expecting alot less than this range but was pleasantly surprised.

These are the Digimesh version, the radios found each other on Power up automatically.

Another cool thing is that you don’t need an extra microprocessor to use Analog or Digital Read or write to the XBee, you can program the pins to do what ever you want.

2 Likes

RWB, that rocks! Those modules here in Canada are between $50 and $60 each! However, they get the job done. I look forward to seeing the results of your nRF24 tests. :slight_smile:

I picked up the modules for $37 from Parallax but the Dipole antennas were $18 each. You can get the boards with wire antennas for $37 but your range is going to suffer compared to using the Dipole Antennas.


@BDub Hey what do you think is the best way to setup a range test with these amplified nRF21 boards with the Spark Core? If you can get me going I’l do side by side range test against the XBee Pro 900 HP.

Wiring them up to a proto shield and plugging into a shield shield seems to be working well for me. A little large, but easy enough. Keep your wiring short and put the filter cap across the power pins of the radio. I’m probably going to add a 3.3V regulator on the proto shield for the higher power radios.

BTW I recently replaced my Unit 1 that didn’t Rx well with a completely different nrf24L01+ unit that a coworker had and it works perfectly without any dropped acknowledgement packets Tx’ing every 1/10th of a second.

So one of those with my other black ones… worked fine. The pinout was different a bit though, so I had to get creative with an adapter to plug it into my proto shield.

@BDub Can you tell me what the pin layout should be between the nRF and the Core? I have no idea.

Also will I just need to load your library and the demo code and watch the serial output on the computer screen? Whats the best way to go about trying to test the range on this board?

You could easily just watch the Rx serial output, and if it's not receiving it just stops.

Or add a D7 led toggle in the Rx code when a new byte is received.

I've seen mention of a signal strength example that scans all channels as well... that might be an interesting test. I don't know how that works though since Maniacbug says there's nothing baked in...

Q: is there way somehow to print the received signal strength ? so we can find where the range start to finish and debug ?

A: I don't believe so. All of my sensor nodes have a range-finder software built in. So you can put the unit into 'range test' mode, in which it constantly sends a test packet back to its parent. If the send goes through, it turns on the green light, if not it turns on the red light. I can then just walk around and explore the extents of the range.

1 Like

Cool. I’ll rig it up and report back we I have a few hours to play with all this.

RWB & BDub, the nRF24L01+ does not have RSSI but has a single register bit called Receive Power Detector:

6.4 Received Power Detector measurements

Received Power Detector (RPD), located in register 09, bit 0, triggers at received power levels above -64 dBm that are present in the RF channel you receive on. If the received power is less than -64 dBm,
RDP = 0.

The scanner sketch that's included in the nRF24 library essentially scans all channels and reads the RPD for each. For the tests, you will want to make sure you set the output power to maximum value:

setPALevel( RF24_PA_MAX ) ;

This is done in the begin() call but make sure it is not set lower in your test sketch. You may want to use the pingpair sketch for your distance tests. :smile:

Good info.

Peekay if you can throw the code together that you think would be best then I’ll run the test and come back with all the data. There are lots of open areas around here also I can do line of sight test also.

RWB, do you want a sketch that does serial output or an LED or a display? I have a two-pipe sketch (send/recv) or a single pipe sketch. For lowest power, I suspect the single pipe sketch is more representative.

Lets do a sketch that provides Serial output so I can screen cast record it during the test.

I can record both the XBee and the nRF24 the same way with a GPS map open also so you see where the the transceivers actually are during the test.

@RWB I suggest you use this sketch first in order to identify the less cluttered RF channel https://github.com/yovio/RF24/tree/master/examples/scanner, pick the one which contains the lowest possible number

@RWB If you run the pingpair sketch on two Arduino you will see when the two RF24 gets out of range on the Serial

@BDub I believe we should try to port over to :spark: the yovio fork linked above as it seems it has some improvements over the original Maniacbug library: I can do it myself if you prefer, may be I’ll ask a couple of questions though