Arduino NRF24L01 Скачать руководство пользователя страница 1

Arduino Wireless Communication – 
NRF24L01 Tutorial

Dejan Nedelkovski
Arduino Tutorials
36

In this Arduino tutorial we will learn how to make a wireless communication between two
Arduino boards using the NRF24L01 transceiver module. You can watch the following 
video or read the written tutorial below.

Overview

For explaining the wireless communication we will make two examples, the first one will be
sending a simple “Hello World” message from one Arduino to another, and in the second 
example we will have a bi-directional communication between the Arduino boards, where 
using the Joystick at the first Arduino we will control the servo motor at the second 
Arduino, and vice versa, using the push button at the second Arduino we will control the 
LED at the first Arduino.

NRF24L01 Transceiver Module

Let’s take a closer look at the NRF24L01 transceiver module. It uses the 2.4 GHz band 
and it can operate with baud rates from 250 kbps up to 2 Mbps. If used in open space and 
with lower baud rate its range can reach up to 100 meters.

Содержание NRF24L01

Страница 1: ...le Hello World message from one Arduino to another and in the second example we will have a bi directional communication between the Arduino boards where using the Joystick at the first Arduino we wil...

Страница 2: ...ch unit can communicate with up to 6 other units at the same time The power consumption of this module is just around 12mA during transmission which is even lower than a single LED The operating volta...

Страница 3: ...used for setting the module in standby or active mode as well as for switching between transmit or command mode The last pin is an interrupt pin which doesn t have to be used So once we connect the NR...

Страница 4: ...al 3 Example 1 Transmitter Code 4 5 by Dejan Nedelkovski www HowToMechatronics com 6 7 Library TMRh20 RF24 https github com tmrh20 RF24 8 9 include SPI h 10 include nRF24L01 h 11 include RF24 h 12 RF2...

Страница 5: ...rh20 RF24 8 9 include SPI h 10 include nRF24L01 h 11 include RF24 h 12 RF24 radio 7 8 CE CSN 13 const byte address 6 00001 14 void setup 15 Serial begin 9600 16 radio begin 17 radio openReadingPipe 0...

Страница 6: ...t the same address and in that way we enable the communication between the two modules 1 radio openReadingPipe 0 address Then using the radio setPALevel function we set the Power Amplifier level in ou...

Страница 7: ...ments called text in which we will save the incoming data 1 void loop 2 if radio available 3 char text 32 4 radio read text sizeof text 5 Serial println text 6 7 Using the radion read function we read...

Страница 8: ...Joystick Module Amazon Arduino Board Amazon Servo Motor Amazon Pushbutton Amazon LED Amazon...

Страница 9: ...addresses 6 00001 00002 15 boolean buttonState 0 16 void setup 17 pinMode 12 OUTPUT 18 radio begin 19 radio openWritingPipe addresses 1 00001 20 radio openReadingPipe 1 addresses 0 00002 21 radio setP...

Страница 10: ...1 00002 16 Servo myServo 17 boolean buttonState 0 18 void setup 19 pinMode button INPUT 20 myServo attach 5 21 radio begin 22 radio openWritingPipe addresses 0 00002 23 radio openReadingPipe 1 address...

Страница 11: ...d the data to the receiver 1 radio stopListening 2 int potValue analogRead A0 3 int angleValue map potValue 0 1023 0 180 4 radio write angleValue sizeof angleValue On the other side using the radio st...

Страница 12: ...but some talented people have written Arduino libraries that make them easy to us They all use the same pinout as shown in the following diagram which is a TOP VIEW Correction Here are details of the...

Страница 13: ...o 3 3V not 5 0V although the Arduino itself may run at 5 0V and the signals will be OK The NRF24L01 IC is a 3 3V device but its I O pins are 5 V tolerant which makes it easier to interface to Arduino...

Страница 14: ......

Отзывы: