arduino microcontroller and nrf24l01+ transceivers

Post on 14-May-2015

4.527 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Arduino microcontroller and nRF24L01+ transceivers

Pavlos Kallis

Supervisor : prof. Leandros Tassiulas

University of Thessaly

Network implementation testbed laboratory (NITLAB)

Purpose

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

transceivers

Wireless sensor network

● Nodes receive measurements through sensors

● Nodes forward measurements to a central node

Arduino Leonardo

NRF24L01+ Transceiver

RF24L01+ TransceiverΝ

Low CostAlternative to Xbee

NRF24L01+ Transceiver

Data Rates: 250 kbps, 1 Mbps, 2 Mbps

NRF24L01+ Transceiver

Frequency: 2400-2525 MHz

NRF24L01+ Transceiver

Channels : 126

NRF24L01+ Transceiver

Modulation: GSFK

NRF24L01+ Transceiver

Line-of-sight range : ~40m

NRF24L01+ Transceiver

Channel sensing

NRF24L01+ TX/RX

● Auto packet assembly

● Auto ACKs and retransmissions

– Configurable # of retries

– Configurable delay between retries

NRF24L01+ Packet structure

NRF24L01+ pipes

Transmitter Receiver

Pipe

Write 0x01

Read 0x01

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

RF24 library

● Software for Point-to-point communication between nRF24L01+ transceivers

● Abstracts low-level communication between the microcontroller and the transceiver

RF24 libraryconfiguration

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

Schematic to connect arduino leonardo with 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

RF24 Library transmission mechanism

● When two transmitters send a packet simultaneously

RF24 Library transmission mechanism

● When two transmitters send a packet simultaneously

– A collision occurs

TX

RX

TX

RF24 Library transmission mechanism

● When two transmitters send a packet simultaneously

– A collision occurs

– Receiver cannot decode the message

TX

RX

TX

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

Proposed mechanism

● If a transmitter fails to transmit a packet(no ack received)

– It will wait for a random period, then retransmit

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

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

Proposed mechanism : Implementation

● Disabled the retransmission mechanism by calling setRetries(0, 0)

● Built on top of write(buf, len)

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

RF24Network Library

● Network layer software library for nRF24L01+ transceivers

● Built on top of RF24 library● Handles transmissions in network layer

RF24Network Library

● Tree topology– Max no. of children = 5

WSN Addressing

WSN Setup

Base Node

Relay Node

Leaf Node

Thank you

top related