arduino microcontroller and nrf24l01+ transceivers

34
Arduino microcontroller and nRF24L01+ transceivers Pavlos Kallis Supervisor : prof. Leandros Tassiulas University of Thessaly Network implementation testbed laboratory (NITLAB)

Upload: pavlos-kallis

Post on 14-May-2015

4.527 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Arduino microcontroller and nRF24L01+ transceivers

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

Purpose

Deployment of a wireless sensor network using arduino microcontrollers and nRF24L01+

transceivers

Page 3: Arduino microcontroller and nRF24L01+ transceivers

Wireless sensor network

● Nodes receive measurements through sensors

● Nodes forward measurements to a central node

Page 4: Arduino microcontroller and nRF24L01+ transceivers

Arduino Leonardo

Page 5: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Page 6: Arduino microcontroller and nRF24L01+ transceivers

RF24L01+ TransceiverΝ

Low CostAlternative to Xbee

Page 7: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Data Rates: 250 kbps, 1 Mbps, 2 Mbps

Page 8: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Frequency: 2400-2525 MHz

Page 9: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Channels : 126

Page 10: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Modulation: GSFK

Page 11: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Line-of-sight range : ~40m

Page 12: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Transceiver

Channel sensing

Page 13: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ TX/RX

● Auto packet assembly

● Auto ACKs and retransmissions

– Configurable # of retries

– Configurable delay between retries

Page 14: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ Packet structure

Page 15: Arduino microcontroller and nRF24L01+ transceivers

NRF24L01+ pipes

Transmitter Receiver

Pipe

Write 0x01

Read 0x01

Page 16: Arduino microcontroller and nRF24L01+ transceivers

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

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

RF24 libraryconfiguration

● Channel● Payload size● Data rate● ACKs or no● Retry delay● Number of retries● CRC length

Page 19: Arduino microcontroller and nRF24L01+ transceivers

Schematic to connect arduino leonardo with nRF24L01+ transceivers

Page 20: Arduino microcontroller and nRF24L01+ transceivers

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

RF24 Library transmission mechanism

● When two transmitters send a packet simultaneously

Page 22: Arduino microcontroller and nRF24L01+ transceivers

RF24 Library transmission mechanism

● When two transmitters send a packet simultaneously

– A collision occurs

TX

RX

TX

Page 23: Arduino microcontroller and nRF24L01+ transceivers

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

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

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

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

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

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

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

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

RF24Network Library

● Tree topology– Max no. of children = 5

Page 32: Arduino microcontroller and nRF24L01+ transceivers

WSN Addressing

Page 33: Arduino microcontroller and nRF24L01+ transceivers

WSN Setup

Base Node

Relay Node

Leaf Node

Page 34: Arduino microcontroller and nRF24L01+ transceivers

Thank you