More Wireless (1)

nrf24-showing-status-byte3Figure 1: The all-important STATUS! Click to Enlarge.

Some people may be confused about the CE and CSN nomenclature.  The CE is really used as a transmit enable/disable, and the CSN is the real CE. Another point of confusion is the pin description.  The header pins are on the back of the board, but the numbering refers to the front of the board.  It’s easy to backwards wire these things, if you’re running on autopilot.  Guess who might have done that?  My brain-fart didn’t do any damage though, thank goodness.

The Adafruit forum has a piece about the nRF24 devices, and in at least one case, it was necessary to put a 4.7 uF (approximately) capacitor from VCC to GND to make the devices work.  This should be located as close as possible to the radio.  It may be less of an issue for me, due to my use of batteries (not necessarily entirely though).  On some of my units I have DC-DC converters (even with batteries), and on others just straight batteries.  It depends on the types of coupling issues involved.  I’ve put a link to a discussion about the issue at the bottom of this page.

I should have mentioned something in the last page. When building the nRF24 library, one needs to have the /dev/spi* devices available. In other words, load the modules before building the library. The build system has a script to pick up the appropriate spidev device. The default, if your spidev cannot be found, is spidev1.0, but on the Odroid it should be spidev0.0. Loading the modules let’s the script find the right one. This is not obvious, and can result in a lot of wheel spinning and no traction. Voice of experience.  I know when I have to look at pkgconfig.  But, this is a new one.

This can be made into a three wire connection, instead of the current five wire connection (excluding power/gnd).  The go-to blog page for the three wire setup is NerdRalph, at:

nerdralph.blogspot.fi/…

He did it for the attiny85 (THAT is another interesting project that most likely will have to find its way into my collection). It seems it should be OK for the droid type stuff, but I haven’t tried it yet.  Ralph has another circuit, that uses only TWO wires for SPI, but it requires his own bit-banging software SPI implementation.  The three wire deal should work with a standard SPI setup.

Adafruit Forum link (capacitor issue)

SPI can be quite quick.  It is full duplex, but as of this time I’ve tried it only at 1 Mbps.  Notice the channel value in the printDetail screen output.  AFAIK, the channel frequency for these devices is calculated as 2400 MHz plus the channel value, in MHz.  So, channel one is 2401 MHz, channel 2 is 2402 MHz, etc.

AFAIK, the nRF24 module, in its primary mode, is unlike a regular WiFi module, because it uses FSK or GFSK (gaussian frequency shift keying), with no frequency hopping.  I’ve just started reading the docs on this, so don’t take any of it as the last word.  The nRF24 uses the so-called “WiFi” band at 2.4 GHz.  The 2.4 GHz band is 83 MHz wide and extends up close to 2.5 GHz.  There are eleven standard WiFi channels, but many of them overlap (otherwise, the math wouldn’t work).

Each WiFi channel is about 20 MHz wide. WiFi uses spread spectrum techniques, with one carrier centered in a 22 MHz channel.  Its spread spectrum technique is called Direct Sequence Spread Spectrum (DSSS). AKAIK, to reduce interference, WiFi uses digital modulation techniques to change its use of the channel, which is as narrow as 5 MHz, or as wide as 22 MHz, while reducing the amplitude and “spreading out”.

Bluetooth, on the other hand, uses FHSS (Frequency Hopping Spread Spectrum) to divide and conquer the interference. It hops around among 79 different 1 MHz channels.  The nRF24 devices, when in their primary mode, require less width than a single WiFi channel, meaning that many “nRF24 channels” fit into one “WiFi” channel.  The downside of this is that a lower bandwidth means a lower data rate.  This is why Bluetooth and similar technologies have a lower throughput than WiFi.  The nRF24 uses much less power than WiFi or Bluetooth.  It has registers with which to create frequency hopping spread spectrum algorithms, to take the device into the realm of “WiFi” – but on one forum I visited, it was indicated that experimental results weren’t optimal:

  https://github.com/TMRh20/RF24Network/issues/72

In addition to GFSK and FSK, some of these modules support OOK (on/off keying) which IIRC has a 50 percent higher throughput.

Read More of this Blog Post

Note: the author does not have a recent, applicable background in circuit building, or battery related issues, so this is presented as the work of a hobbyist, and is not meant for duplication by others. Readers should look elsewhere for design advice and info.

Note: The Odroid site is http://www.hardkernel.com and is not affiliated with this site in any way. The nrf24 is a product of http://www.nordicsemi.com, and they are not affiliated with this author or website in any way.  Note: The RFM69W module is a product of HopeRF, LTD.  They are at http://www.hoperf.com  Bluetooth is a trademark of the Bluetooth Special Interest Group, and is not affiliated with this author or site in any way.  Adafruit is a trademark of Adafruit, Inc. While the author uses many Adafruit products, there is no affiliation of this site or author with Adafruit.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s