Poor Man's 2.4 GHz Scanner

Hi Terry, Forest - thanks for your nice feedback.

Acutally, the MIRF-lib available in the playground has been updated in the meantime to use the SPI-lib build into the Arduino 22 IDE. I think the playground library would benefit from some nice and simple examples, making the great features of the nRF24L01+ more accessible to everybody.

Personally, I did not have yet the time to expand my own lib to a state were it would be useful. And due to time restraints, it will take me some additional months until I will be able to finish this one. I will post it here in the forum as soon as I have something workable.

However, there is another nRF24L01+/Arduino library available on the net which features a slightly different design and interface and which might be interesting for people using the Arduino/nRF24L01+ combination. It can be found here: http://maniacbug.github.com/RF24/index.html.

Furthermore, there is also a nice nRF24L01-library design for the mbed-platform at http://mbed.org/cookbook/nRF24L01-wireless-transceiver, also with a slightly different approach, which could easily be adapted for the Arduino.

Currently, only the mbed-lib does feature direct access to important parameters of the Enhanced-Shockburst mode, which is in my point of view the most convenient and important feature of these chips. Another nice property of a full lib would probably be a simple, automatic packaging mechanism, making oneself somewhat more independent from the maximum 32 byte packet size of the nRF24L01+ ... - I am thinking along these lines, but did not yet come up with a good implementation idea here.

Terry: you posted in another thread that you are researching the possibilities of an enhanced nRF24L01+ with power amplifiers and/or low-noise receivers. I'd love to hear about your results!

Best, cpixip

@cpixip thanks a lot for your work on this stuff; it's given me a leg up.

I have 2 of the "1000 meters distance NRF24L01 + PA + LNA wireless module" (As translated from the Chinese...) coming; we know Mr. Tang who runs this TaoBao (Chinese Ebay) shop.

Take a look here: http://item.taobao.com/item.htm?id=9107958905&frm= (Chinese) , but use Google Translate or run Google Chrome.

I like the idea that we have a transceiver that has 3 levels of price and performance with exact same software!

I THINK the prices will be something like $5 - plain nRF24L01 with PCB antenna , $12 with Power Amplifier +15 dBm - sma RF connector, $18 with Power Amp and Low-Noise receiver preamp, Antenna for last 2 about $1.50

But I want to get good working Arduino examples before I start selling these to the newbies and having people be unhappy...

I should have them in about a week....

cpixip:
However, there is another nRF24L01+/Arduino library available on the net which features a slightly different design and interface and which might be interesting for people using the Arduino/nRF24L01+ combination. It can be found here: http://maniacbug.github.com/RF24/index.html.

By the way, I am actively developing this library. Feel free to IM if there's anything you need on it. The goal is to completely cover the chip's entire usage. I'm getting there.

Hi James/Maniac!

Glad to hear that! I'm reading thru your ping-pong examples now and will try to get that running soon.

I'd like to talk about what a good set of examples for newbies would be, and how that all might progress.

I'm working on documenting a lot of Arduino stuff to make it approachable. Example: http://arduino-info.wikispaces.com/Nrf24L01-Poor+Man's+2.4+GHz+Scanner

I'd like to get a couple of examples based on your work working and documented.

One might be a "control of the remote device's LEDs and Motors", with feedback??

One might be "Transmit remote sensor data to base" ??

What do you think would be good examples, and how might a user-friendly set of functionality be exposed for new users??

Thanks for your good work on this; your code is very well done...

Regards, Terry

Thanks!

These are all great ideas. It is helpful to hear some of these ideas for what would help new people. My own usage of the library has grown rather monstrous and complex, so I'm kind of losing perspective.

The problem is, as the usefulness increases so does the complexity, and then inversely goes the approachability.

My full-blown usage is a multi-hop mesh network with sensor nodes reporting readings back to a base unit that logs to a MySQL database. But, uh, good luck to new users figuring that all out.

I have this notion of writing a higher-level library that sits atop the RF24 library, and manages the mesh network details. That might make the complex stuff more approachable.

I'll try working up some examples based on your suggestions, though. If you think of more details on how a user might actually do something with those parts, do feel free to expound.

Hi, Wow, cool applications.. That should be really extensible with long-range radios.. like over a campus.

There are two levels of users to support. I am doing a workshop with guys here at the King Abdullah University of Science and Technology who are Supercomputer admins, Algorithm researchers, Unix/SQL weenies, BioDatabase guys etc. Then I have 9th graders. I think there can be a higher level API with the lower levels exposed so a user can learn and do more complex things.

So let's think about it a bit and try to figure out the appropriate levels...

Thanks for your work and your willingness!

This works great. (wondering the first thing I was going to build with these things.)

I made sure that all WiFi, Bluetooth, and (anything around 2.4Ghz) was off.
(I only got a few minor blips from some random device.)
Then I turned on the microwave.
On all chanels, I got very heavy interfierence.

So you can also put this as a microwave detector.

Awesome project.

Hey, sorry for hijacking the thread, above. I posted a new thread http://arduino.cc/forum/index.php/topic,62222.0.html for RF24, so as to keep this one on-topic.

Thanks for all the nice feedback!

Just a short note I forgot to mention in the intial post: the above listed scanner program switches off the Enhanced Shockburst feature of the nRF24L01+. As all libs available currently for nRF24L01+ do not initialize this feature of the chip correctly on start-up, you need to power down your circuit once before uploading and using another program/lib in order to reset the nRF24L01+. Otherwise programs which use the Enhanced Shockburst feature (basically all libs available for the nRF24L01+ do this) won't run.

The reason is that a simple reset (as happening for example when uploading new programs with the Arduino IDE) won't reset the nRF24L01+ to it's factory setting. However, simply unconnecting the power-supply and/or USB for a few seconds will do the trick.

Have fun! - cpixip

maniacbug:
new people

Hey, That's me! :slight_smile:

I just got a pair of transceivers in the mail this morning from an eBay seller in China ($12.80 for 2 with free shipping). Don't need them yet, but figured that at that price they're be worth getting to play around with at some point, so will be keeping an eye on this thread (and Maniac's newly created one). :slight_smile:

Thanks for all the hard work guys.

cpixip:
As all libs available currently for nRF24L01+ do not initialize this feature of the chip correctly on start-up, you need to power down your circuit once before uploading and using another program/lib in order to reset the nRF24L01+.

Yes, indeed. I suppose this could be stated more broadly. The available libs do not reset the chip registers to the factory state on startup. If you want the factory state, you have to power cycle. Not sure this is "incorrect".

Hi maniacbug -

maniacbug:
... I suppose this could be stated more broadly. The available libs do not reset the chip registers to the factory state on startup. If you want the factory state, you have to power cycle. Not sure this is "incorrect".

... - as we are doing this for a hobby, it's probably ok. Just need to remember that only a power cycle gets your device in a properly defined state.

On the other hand, from a design point of view, any lib (for any device, not just the nRF24L01+) which only works if the device is in a certain state on start-up will fail under some circumstances.

Clearly something you want to avoid if that device is mission-critical ... :wink:

A lib which does not a full initialization will probably also fail in an application featuring a watchdog function - as this won't "reset" external chips properly when a restart is occuring. So it maybe a good idea to mention this fact for other users of a lib.

My code of the 2.4 GHz scanner above does of course violate this as well - it does assume that the nRF24L01+ is in the factory reset state when it starts. For a hobby project, I think this is ok. You just need to be aware that a simple reset won't get the nRF24L01+ back into a working state for other libraries/programs... :slight_smile:

Best, cpixip.

Hey thanks for making such a great tool - When i try to run this code i see a Series of M or Rs across the channels with no color - I really was unsure how to interpret it or if it is working correctly. Any help would be appreciated if this code still works on the current Arduino platform. Thanks again

Thanks for your comments. The colors were added in the inital example just for marking the different 2.4GHz component seen. Of course there are no colors available in the terminal prg of the Arduino IDE.

The amount of power in each channel is displayed in ASCII grey scale. This is an old technique from the time when lineprinters were the primary output of mainframe computers. Have a try on your favorite search engine to find out more (here's one link which came up Character representation of grey scale images).

There is no reason why the code should not work with current Arduinos as the code uses only standards. I have however no way of testing the UNO or newer devices - I do not own any of these.

In case you have doubts, try any of the newer RF24-libraries. Most of them feature a scanner example based on my old code. These libraries are pretty much up-to-date.

In any case - have fun!

The Poor Man's 2.4 GHz Scanner work great on my UNO, but it will not work on the Mega2560.
I changed the following in the program #define CE 53

Where do I make the changes for CSN 48, MOSI 51, MISO 50, SCK 52 ?
Any help would be great
Ron

really great work and very inspiring. i'm thinking about using wifi signals for indoor positioning.
as i understand, your design is not actually a wifi transmitter but really more like a listener and
is not able to communicate via standard wifi.
i could imagine that this is actually a bonus since probably the power consumption is less compared
to a fully fledged wifi connector such as sparkfun's wifly.

do you have any thoughts / tips /caveat about using your setup for indoor positioning? for example,
the network activity (if that correlates with the power on different bands, i don't know) should certainly
not be used, but actually the network strenght of the different routers around.
also, we possibly would need to find out about temporary signals and stationary signals (wifii routers
are pretty stationary and continous, bluetooth may move or be off, microwaves don't move but are
on and off at unpredictable times).

finally: would it make sense to use two such scanners on either end of the bot so that one could have
a "stereo" view on the singals? or are these wave lengths / the sample rate of the device not suitable?
sorry, i'm a newbie on all of this, but to use wifi signals as a reference for sensor fusing is really tempting.

Hello,

Very nice scanner! I really would like to use it.
I want to use the nrf24L01 in combination with a 2.4Ghz camera and want to see the free zone to set the channel.
I have two breakout board which both do not seem to work with the code.
I hooked them up on an Arduino mini pro and an Arduino uno to see if that was the problem.
I'm sorry for the long paste, but they both show something like:
(look at the end of the output, it finally produces something, but it is very little)
What am I doing wrong?

Starting Poor Man's Wireless 2.4GHz Scanner ...

Channel Layout
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|  *****-W*                                                      | 3
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|              ::::WW+++::    :+++:++++                          | 4
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
>      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
|                                                                | 0
  • the nrf24 might not working properly. You might check this by creating some 2.4GHz traffic close to the nrf24. Put it in close vincinity of your WLAN (make sure it's on ;). Putting the nrf24 in the vincinity of a microwave (but don't put it into the microwave!!!) and switching that on for a few seconds should give you also a strong signal.

assadollahi:
do you have any thoughts / tips /caveat about using your setup for indoor positioning?

this is not a very precise 2.4GHz scanner as the nrf24 delivers only a single bit, "signal strength above threshold" (or not). You won't be able to use it for such a purpose. Other chips have a better output of reception strength, you might google around for these. This tiny hack is just good to spot channels of low activity, nothing more... :sunglasses:

Here is a blog post about implementing the poor man's 2.4G scanner using the RFToy:
http://weatherhelge.wordpress.com/2014/12/31/2-4ghz-scanner-using-rftoy/
the built-in OLED screen that comes with the RFToy is quite handy for display.