arduino microcontroller and nrf24l01+ transceivers
TRANSCRIPT
![Page 1: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/1.jpg)
Arduino microcontroller and nRF24L01+ transceivers
Pavlos Kallis
Supervisor : prof. Leandros Tassiulas
University of Thessaly
Network implementation testbed laboratory (NITLAB)
![Page 2: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/2.jpg)
Purpose
Deployment of a wireless sensor network using arduino microcontrollers and nRF24L01+
transceivers
![Page 3: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/3.jpg)
Wireless sensor network
● Nodes receive measurements through sensors
● Nodes forward measurements to a central node
![Page 4: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/4.jpg)
Arduino Leonardo
![Page 5: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/5.jpg)
NRF24L01+ Transceiver
![Page 6: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/6.jpg)
RF24L01+ TransceiverΝ
Low CostAlternative to Xbee
![Page 7: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/7.jpg)
NRF24L01+ Transceiver
Data Rates: 250 kbps, 1 Mbps, 2 Mbps
![Page 8: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/8.jpg)
NRF24L01+ Transceiver
Frequency: 2400-2525 MHz
![Page 9: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/9.jpg)
NRF24L01+ Transceiver
Channels : 126
![Page 10: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/10.jpg)
NRF24L01+ Transceiver
Modulation: GSFK
![Page 11: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/11.jpg)
NRF24L01+ Transceiver
Line-of-sight range : ~40m
![Page 12: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/12.jpg)
NRF24L01+ Transceiver
Channel sensing
![Page 13: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/13.jpg)
NRF24L01+ TX/RX
● Auto packet assembly
● Auto ACKs and retransmissions
– Configurable # of retries
– Configurable delay between retries
![Page 14: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/14.jpg)
NRF24L01+ Packet structure
![Page 15: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/15.jpg)
NRF24L01+ pipes
Transmitter Receiver
Pipe
Write 0x01
Read 0x01
![Page 16: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/16.jpg)
NRF24L01+ pipes
ReceiverPipe
Read 0x05Pipe
Pipe
Pipe
Pipe
Read 0x04
Read 0x03
Read 0x02
Read 0x01
Write 0x01
Write 0x05
Write 0x04
Write 0x03
Write 0x02
Transmitters
![Page 17: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/17.jpg)
RF24 library
● Software for Point-to-point communication between nRF24L01+ transceivers
● Abstracts low-level communication between the microcontroller and the transceiver
![Page 18: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/18.jpg)
RF24 libraryconfiguration
● Channel● Payload size● Data rate● ACKs or no● Retry delay● Number of retries● CRC length
![Page 19: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/19.jpg)
Schematic to connect arduino leonardo with nRF24L01+ transceivers
![Page 20: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/20.jpg)
RF24 Library example setup
1) Ping role sends its
timestamp
2) Pong role replies with timestamp
3) Ping role calculates round-trip
time
Ping RolePong role
![Page 21: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/21.jpg)
RF24 Library transmission mechanism
● When two transmitters send a packet simultaneously
![Page 22: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/22.jpg)
RF24 Library transmission mechanism
● When two transmitters send a packet simultaneously
– A collision occurs
TX
RX
TX
![Page 23: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/23.jpg)
RF24 Library transmission mechanism
● When two transmitters send a packet simultaneously
– A collision occurs
– Receiver cannot decode the message
TX
RX
TX
![Page 24: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/24.jpg)
RF24 Library transmission mechanism
● When two transmitters send a packet simultaneously
– A collision occurs
– Receiver cannot decode the message
– The transmitters will retry in the SAME time slots
– Until maximum no. of retries reached
![Page 25: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/25.jpg)
Proposed mechanism
● If a transmitter fails to transmit a packet(no ack received)
– It will wait for a random period, then retransmit
![Page 26: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/26.jpg)
Proposed mechanism
● If a transmitter fails to transmit a packet(no ack received)
– It will wait for a random period, then retransmit
– The random period is selected from a contention window, that is doubled every time the TX fails to transmit a packet
![Page 27: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/27.jpg)
Proposed mechanism
● If a transmitter fails to transmit a packet(no ack received)
– It will wait for a random period, then retransmit
– The random period is selected from a contention window, that is doubled every time the TX fails to transmit a packet
– Until the maximum number of retries is exceeded
![Page 28: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/28.jpg)
Proposed mechanism : Implementation
● Disabled the retransmission mechanism by calling setRetries(0, 0)
● Built on top of write(buf, len)
![Page 29: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/29.jpg)
Proposed mechanism : Implementation
● Problem : The function write was poweringDown() the transmitter after a packet transmission
– Increased delay to wake ( 1.5 ms)
– Our random backoff time was much less than that
● Solution : We disabled the powerDown() function
![Page 30: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/30.jpg)
RF24Network Library
● Network layer software library for nRF24L01+ transceivers
● Built on top of RF24 library● Handles transmissions in network layer
![Page 31: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/31.jpg)
RF24Network Library
● Tree topology– Max no. of children = 5
![Page 32: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/32.jpg)
WSN Addressing
![Page 33: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/33.jpg)
WSN Setup
Base Node
Relay Node
Leaf Node
![Page 34: Arduino microcontroller and nRF24L01+ transceivers](https://reader034.vdocuments.mx/reader034/viewer/2022042521/5554b0e3b4c90502618b560c/html5/thumbnails/34.jpg)
Thank you