รหัสสินค้า | IN0005 |
หมวดหมู่ | โมดูล Wifi / Bluetooth / Lan |
ราคาปกติ | |
ลดเหลือ | 55.00 บาท |
น้ำหนัก | 2 กรัม |
สถานะสินค้า | พร้อมส่ง |
ลงสินค้า | 1 ส.ค. 2560 |
อัพเดทล่าสุด | 21 ก.ย. 2565 |
คงเหลือ | 12 ชิ้น |
จำนวน | ชิ้น |
product description
The NRF24L01 is a monolithic transceiver that operates in the 2.4-2.5GHz world-wide ISM band. The radio transceivers include: Frequency Generator Enhanced SchockBurstTM Mode Controller Power Amplifier Crystal Amplifier Modulator Demodulator Output Power Channel Selection and Protocol Setting can be set through the SPI interface Very low current consumption when operating in transmit mode Transmit power is 6dBm when the current consumption is 9.0mA Accept mode is 12.3mA Power down mode and standby mode, lower current consumption mode.
Ball open ISM band, the maximum 0dBm transmit power, license-free use. Open 100 meters!
Support six-channel data reception
1. Low operating voltage: 1.9 ~ 3.6V low voltage operation
2. High-speed: 2Mbps, because the air transit time is very short, greatly reducing the collision in the wireless transmission phenomenon (the software set to 1Mbps or 2Mbps air transmission rate)
3. Multi-frequency: 125 frequency, to meet the multi-point communications and frequency hopping communications needs
4. Ultra-small: built-in 2.4GHz antenna, small size, 15x29mm (including the antenna)
5. Low power consumption: When working in response mode communication, rapid air transmission and start-up time, greatly reducing the current consumption.
6. Low application cost: NRF24L01 integrates all the RF protocol-related high-speed signal processing, such as: automatic retransmission of lost packets and automatically generate response signals, NRF24L01 the SPI interface can use the microcontroller's hardware SPI port or single-chip microcomputer I / O port for simulation, the internal FIFO with a variety of high and low speed microprocessor interface, easy to use low-cost single-chip.
7. Easy to develop: Because the link layer is fully integrated in the module, very easy to develop. Automatic retransmission function, automatic detection and retransmission of lost data packets, retransmission time and retransmission times can be automatically controlled by the software control does not receive the response to the data packet auto-answer function, the valid data, the module automatically sends the answer - Fixed frequency detection Built-in hardware CRC error detection and point-to-multipoint communication address control Packet transmission error counter and carrier detection function can be used for frequency hopping settings can be set up six receive channel address, can be selective Of the open receive channel standard pin Dip2.54MM pitch interface for easy embedded applications.
วิธีต่อ
sensor to arduino uno board
GND > ground
VCC > 3.3V
CE > 7
CSN > 8
CE และ CSN สามารถกำหนดช่องเองได้ ส่วน SCK, MISO และ MOSI แต่ละรุ่นของ arduino จะต่อไม่เหมือนกัน
Arduino | SCK | MISO | MOSI | SS |
Uno | 13 | 12 | 11 | 10 |
Nano | 13 | 12 | 11 | 10 |
Mega | 52 | 50 | 51 | 53 |
โหลด libraly ที่นี่
ตัวอย่าง code สำหรับส่งข้อความ ใช้สำหรับการตรวจสอบอุปกรณ์และ code ว่าปกติหรือไม่
#include <SPI.h> #include <nRF24L01p.h> nRF24L01p transmitter(7,8);//CSN,CE void setup(){ delay(150); Serial.begin(115200); SPI.begin(); SPI.setBitOrder(MSBFIRST); transmitter.channel(90); // ตั้งช่องความถี่ให้ตรงกัน transmitter.TXaddress("ALL"); // ตั้งชื่อตำแหน่งให้ตรงกัน ชื่อตั้งได้สูงสุด 5 ตัวอักษร transmitter.init(); } String message; void loop(){
transmitter.txPL("www.arduino2robot.com"); // ค่าที่ต้องการส่ง
transmitter.send(FAST); // สั่งให้ส่งออกไป
delay(1000); }
#include <SPI.h> #include <nRF24L01p.h> nRF24L01p receiver(7,8);//CSN,CE void setup(){ delay(150); Serial.begin(115200); SPI.begin(); SPI.setBitOrder(MSBFIRST); receiver.channel(90); // ตั้งช่องความถี่ให้ตรงกัน receiver.RXaddress("ALL"); // ตั้งชื่อตำแห่นงให้ตรงกัน ชื่อตั้งได้สูงสุด 5 ตัวอักษร receiver.init(); } String message; void loop(){ if(receiver.available()){
receiver.read(); // สั่งให้เริ่มอ่าน
receiver.rxPL(message); // สั่งใหอ่านเก็บไว้ที่ตัวแปร
Serial.println(message); message=""; } }
Transmitter Code
#include <SPI.h> #include <nRF24L01p.h> |
|
String message; | |
nRF24L01p transmitter(7,8);//CSN,CE | |
void setup(){ | |
Serial.begin(115200); | |
Serial.println("www.ArduinoThai.com"); | |
Serial.println("NFR24L01"); | |
SPI.begin(); | |
SPI.setBitOrder(MSBFIRST); | |
transmitter.channel(88); // กำหนดช่องสื่อสาร | |
transmitter.TXaddress("AAA"); // ตั้งชื่อตำแหน่งให้ตรงกันระหว่างตัวรับ ตัวส่ง (ได้สูงสุด 5 ตัวอักษร) | |
transmitter.init(); | |
} | |
void loop(){ | |
int val=analogRead(A0); //รับค่าจากเซนเซอร์ | |
val = map(val,0,1023,255,0); //แปลงค่า | |
Serial.println(">> "+String(val)); | |
text_send(String(val)); //ส่งค่าไปยังฟังก์ชั่นส่ง | |
delay(100); | |
} | |
void text_send(String text){ | |
transmitter.txPL(text); // ข้อความที่ต้องการส่ง | |
transmitter.send(FAST); // สั่งให้ส่งส่งข้อความออกไป | |
} |
Code language: Arduino (arduino)
Receiver Code
#include <SPI.h> #include <nRF24L01p.h> |
|
String message; | |
nRF24L01p receiver(7,8);//CSN,CE | |
void setup(){ | |
Serial.begin(115200); | |
Serial.println("www.ArduinoThai.com"); | |
Serial.println("NFR24L01"); | |
SPI.begin(); | |
SPI.setBitOrder(MSBFIRST); | |
receiver.channel(88); // ตั้งช่องสื่อสารให้ตรงกันระหว่างตัวรับตัวส่ง | |
receiver.RXaddress("AAA"); // ตั้งชื่อตำแหน่งให้ตรงกันระหว่างตัวรับ ตัวส่ง (ได้สูงสุด 5 ตัวอักษร) | |
receiver.init(); | |
pinMode(3,OUTPUT); | |
} | |
void loop(){ | |
if(receiver.available()){ | |
receiver.read(); // สั่งให้อ่านค่าที่ส่งมา | |
receiver.rxPL(message); // สั่งให้อ่านเก็บไว้ที่ตัวแปร | |
int val = message.toInt(); //แปลงค่าจาก String เป็น int | |
Serial.println("<< "+String(val)); | |
analogWrite(3,val); //สั่ง LED | |
message=""; | |
} | |
} |
หน้าที่เข้าชม | 419,676 ครั้ง |
ผู้ชมทั้งหมด | 257,584 ครั้ง |
เปิดร้าน | 5 มิ.ย. 2560 |
ร้านค้าอัพเดท | 4 ก.ย. 2568 |