까시남의 소소한 일상들..
Nrf24L01-2.4GHz-HowTo 본문
nRF24L01 2.4GHz Radio/Wireless Transceivers How-To
Having two or more Arduinos be able to communicate with each other wirelessly over a distance opens lots of possibilities:
- Remote sensors for temperature, pressure, alarms, much more
- Robot control and monitoring from 50 feet to 2000 feet distances
- Remote control and monitoring of nearby or neighborhood buildings
- Autonomous vehicles of all kinds
These are a series of 2.4 GHz Radio modules that are all based on the Nordic Semiconductor nRF24L01+ chip. (Details) The Nordic nRF24L01+ integrates a complete 2.4GHz RF transceiver, RF synthesizer, and baseband logic including the Enhanced ShockBurst™ hardware protocol accelerator supporting a high-speed SPI interface for the application controller. The low-power short-range (200 feet or so)Transceiver is available on a board with Arduino interface and built-in Antenna for less than $3! See it here.
Link to nRF24L01+ Data Sheet. You don't have to, but if you want to understand more about what you can do with this "little" radio, download the data sheet. In particular you may want to read pages 7-8-9 ( For Overview and Features), and page 39 (MultiCeiver, which allows 6 Arduinos to talk to a Primary Arduino in an organized manner). Fortunately the board-level products we have take care of many of the physical and electrical details and Antenna Impedance Matching etc., and this library takes care of lots of register initialization and operational details.
There are additional modules which add Transmitter power amplifiers and Receiver preamplifiers for longer distances.. up to 1 Km (3000 feet). See them all here. These modules use an external antenna which can be a simple directly-attached one or a cable-connected antenna with more gain or directivity. Here's what some of these look like:


On the left is the low-power version, with it's built-in zig-zag antenna. On the right you can see the pins sticking down (up in this photo) that connect to Arduino. Later we will show the pinout.


Above is the version with Transmit Power amplifier and Receive Preamplifier. Our low-cost antenna is on the unit shown on the right. The same 8 pins connect to Arduino and the same software is used.
These transcevers use the 2.4 GHz unlicensed band like many WiFi routers, some cordless phones etc.
Transceivers like these both send and receive data in 'packets' of several bytes at a time. There is built-in error correction and resending, and it is possible to have one unit communicate with up to 6 other similar units at the same time.
These amazing low-cost units have a lot of internal complexity but some talented people have written Arduino libraries that make them easy to us. We have other pages that show examples and point to the free software libraries you may need. They all use the same pinout as shown in the following diagram, which is a TOP VIEW(Correction!):

![]() |
BOTTOM VIEW |
Signal | RF Module | COLOR | Arduino pin forRF24 Library | Arduino pin forMirf Library |
GND | 1 | Brown | GND | GND |
VCC | 2 | Red | 3.3V | 3.3V |
CE | 3 | Orange | 9 | 8 |
CSN | 4 | Yellow | 10 | 7 |
SCK | 5 | Green | 13 | 13 |
MOSI | 6 | Blue | 11 | 11 |
MISO | 7 | Violet | 12 | 12 |
IRQ | 8 | Gray |
NOTE: Pin 8 IRQ is Unused by most software
The COLOR is for optional color-coded flat cable such as THIS. We'll add some photos soon showing easiest ways to cable these...
NOTE: These units VCC connection must go to 3.3V not 5.0V, although the Arduino itself may run at 5.0V and the signals will be OK. Arduino UNO and earlier versions have a 3.3V output that can run the low-power version of these modules, but the high-power versions must have a separate 3.3V supply. The YourDuinoRobo1 has a higher power 3.3V regulator and can be used to run the high-power Power Amplifier type module without a separate 3.3V regulator.
There are two (or more) good software Libraries for nRF24L01 and we have pages that show some examples:
Maniacbug's excellent RF24 Library and many examples:
RF24 Library and Examples: Many good details and more features like error correction and Networking.
RF24 Network System information: A many-node network under development
ManiacBug's Blog entry and discussion of the Network
Mirf Library Example: A simpler demonstration
abc
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
관련 자료
- 2.4GHz nRF24L01 무선 송수신 모듈
- nRF24L01 모듈 회로도
- nRF24L01 칩 데이터시트
- nRF24L01 모듈 핀맵
- 80S52 MCU 용 데모 예제
- AVR MCU 용 수신 데모 예제
- AVR MCU 용 송신 데모 예제 - 2.4GHz nRF24L01 무선 송수신 모듈용 아두이노 데모 예제
- 2.4GHz nRF24L01 무선 송수신 모듈용 다중 채널 수신 데모 예제