ULTRASONIC SENSOR NETWORK
COMMUNICATING USING NRF24L01+
TEAM MEMBERS:
ANKITH KUMAR HANUMANTHAPPA
SHANMUGAVEL RAMANI
ASHOK RAJ PILLI
SAIMA KHAN
EHSAN GOZARNOEE
INTRODUCTION
THE FOLLOWING SUBJECTS ARE INCLUDED IN THIS PRESENTATION:
• NRF24L01
• CONTENTION BASED PROTOCOLS
• STOCHASTIC AND DETERMINISTIC THRESHOLD ALGORITHMS
• THE MICROCONTROLLER STRUCTURE OF THE INTERFACES
• PROGRAMMING
• RESULTS
• CONCLUSION
• BIBLIOGRAPHY
OVERVIEW
nRF24L01+
 The nRF24L01+ is a single chip 2.4Ghz transceiver, suitable for ultra low power
communication.
 For designing a radio system we require a MCU.
 In our project we operate and configure the nRF24L01+ through SPI.
 It has internal FIFOs which ensure a smooth data flow between radio and MCU.
 It has 126 channel
 It has 6 pipes. In our project we are using pipe0.
nRF24L01+
 It has data rate of 250 kbps, 1 Mbps and 2 Mbps.
 Channels while running at < 1 Mbps require minimum spacing of 1 Mbps
 Channels while running at 2 Mbps require minimum spacing of 2 Mbps
 Two nrf24L01+ chips must have the same channel and air data rate in order
to communicate.
 Radio operates in 4 different modes.
1. Power down mode
2. Standby mode
3. Transmit mode
4. Receiver mode
Power
mode
Standby-
I
mode
RX
TX
Standby-
II
mode
150
μs
130μs
130μs
130μs
130μs
Radio control state diagram
130μs
Packet Structure
Packet Structure
Addresses
 Every wireless transmission is preceded by the address of the receiver it is intended for.
 Addresses can be 3, 4 or 5 bytes long.
Payloads
 The payload is the actual data you are trying to send in your wireless transmission.
 The wireless chips can handle payload sizes from 1-32 bytes.
Category Xbee Bluetooth WiFi nRF24L01
Distance 50-1600 m 10 m 50 m 40 m
Transmission Speed 250 Kbps 1 Mbps 1-54 Mbps 250 -2 Mbps
Frequency Range 868 MHz -916 MHz 2.4 GHz 2.4 GHz 2.4 -2.525 GHz
-2.4 GHz
Cost of terminal unit Low Low High Low
Difference between different RF radios
CONTENTION BASED PROTOCOLS
MACA
MACA
W
PAMA
S
A B C D
MACA-MULTIPLE ACCESS WITH COLLISON AVOIDANCE
A B C D
A B C D
PAMAS:POWER AWARE MULTIPLE ACCESS
WITH SIGNALLINGA B C D
Data channel
Control channel
Busy tone
CSMA
WHICH IS THE BEST ONE ?
PAMAS
PAMAS
MACAW
MACA
SPI
Serial Peripheral Interface (SPI) is an interface commonly used to send data
between microcontrollers and small peripherals.
SPI is a serial data protocol used by microcontroller for communicating to one or
more peripheral devices.
Master device (Microcontroller)
MISO
MOSI
SCK
Begin() SetBitOrder() Transfer() End()
CE Chip enable(Activate RX or TX mode)
CSN SpI chip select
Setup NRF Radio on SPI bus
RX (PRIM_RX)-> HIGH
TX(PRIM_RX)-> LOW
NRF24 Library
Abstract Low –level communication between microcontroller and transeiver.
Start sending voltage to radio.
Setup data rate .
Setup the internal clock.
Setup frequency/channel.
ShockBurst
It is a packet based data link layer that features
Automatic packet handling
Auto Acknowledgement
Auto Retransmission
SPI (CONTD.)
final14-4
#include <SPI.h>
#include <RF24.h>
#define CE_PIN 9
#define CSN_PIN 10
int Sig=3;
const uint64_t pipe = 0xF0F0F0F0A1;
RF24 radio(CE_PIN, CSN_PIN);
void setup()
{
Serial.begin(9600);
radio.begin();
radio.setAutoAck(false);
radio.openWritingPipe(pipe);
}
void loop()
{
Serial.print("test");
int time;
int dis,z;
pinMode(Sig,OUTPUT);
digitalWrite(Sig,HIGH);
delay(50);
digitalWrite(Sig,LOW);
pinMode(Sig,INPUT);
time= pulseIn(Sig,HIGH);
dis=(((time/2)*340.29*100)/1000000);
Serial.print(dis);
For(i=0;i<15;i++)
{
radio.write( dis, sizeof(dis) );
}
delay(50);
}
Transmitter Code
radio.openReadingPipe(1,pipe);
radio.startListening();
}
void loop()
{
if ( radio.available() )
{
bool done = false;
while (!done)
{
done = radio.read(dis, sizeof(dis) );
Serial.print(" Y = ");
Serial.println(dis);
Serial.print(“ cm ");
delay(500);
} } else
{ Serial.println("No radio available");
}
delay(300);}
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 9
#define CSN_PIN 10
const uint64_t pipe[4] =
{0xF0F0F0F066,0xF0F0F0F0AA,
0xF0F0F0F0A1,0xF0F0F0F0B4};
RF24 radio(CE_PIN, CSN_PIN); // Create a
Radio
Int dis;
void setup()
{
Serial.begin(9600);
delay(1000);
Serial.println("Nrf24L01 Receiver Starting");
radio.begin();
radio.setAutoAck(false);
Receiver Code
LEACH PROTOCOL
• LEACH stands for Low-Energy Adaptive Clustering Hierarchy
• This WSN is considered to be a dynamic clustering method
• LEACH has two phases
THE PROBLEM
• The reason we need network protocol such as LEACH is due to the
fact that a node in the network is no longer useful when its battery
dies
• This protocol allows us to space out the lifespan of the nodes,
allowing it to do only the minimum work it needs to transmit data
• LEACH uses a TDMA MAC protocol to communicate between its
nodes.
THE CLUSTER-HEAD
• The LEACH Network is made up of nodes, some of which are called
cluster-heads
• The job of the cluster-head is to collect data from their surrounding nodes and
pass it on to the base station
• LEACH is dynamic because the job of cluster-head rotates and it selects a
cluster head in each round freshly.
DIRECT V. MINIMUM TRANSMISSION
• The amount of energy
used in figure (a) can be
modeled by this formula:
• eampk(3d1 + d2)2
• Whereas the amount of
energy used in figure (b)
uses this formula:
• eampk(3d1
2
+ d2
2
)
THE AMOUNT OF ENERGY DEPLETION
• This is the formula for the amount of energy depletion by data
transfer:
LEACH’S TWO PHASES
• The LEACH network has two phases: the set-up phase and the
steady-state
• The Set-Up Phase
• Where cluster-heads are chosen
• The Steady-State
• The cluster-head is maintained
• When data is transmitted between nodes
STOCHASTIC THRESHOLD ALGORITHM
 Cluster-heads can be chosen stochastically (randomly
based) on this algorithm:
 If n < T(n), then that node becomes a cluster-head
 The algorithm is designed so that each node becomes a
cluster-head at least once
DETERMINISTIC THRESHOLD ALGORITHM
• A modified version of this protocol is known as LEACH-C (or LEACH
Centralized)
• This version has a deterministic threshold algorithm, which takes into
account the amount of energy in the node…
DETERMINISTIC THRESHOLD ALGORITHM
• …and/or whether or not the node was recently a cluster-head.
• This formula helps us to stimulate a new cluster head making sure it
wasn’t a cluster head previously.
WHAT’S THE DIFFERENCE?
• REMEMBER: The goal of these protocol is to increase the life of the
network
• The changes between the LEACH stochastic algorithm and the
LEACH-C deterministic algorithm alone is proven to increase the FND
(First Node Dies) lifetime by 30% and the HND (Half Node Dies)
lifetime by 20%
AN EXAMPLE OF A LEACH
NETWORK
• While neither of these
diagrams is the optimum
scenario, the second is
better because the cluster-
heads are spaced out and
the network is more
properly sectioned
Conclusion:
 We were successful in building a sensor node which senses the distance from obstacle.
 Arduino are not so useful in designing the low power consumption node.
 Study of various contention based protocols were done.
 PAMAS seem to be the most suitable one.
 The sensors and the radio was programmed completely in Arduino and found to be completely
functional.
Result:
 We were successful in communicating in the wireless sensor network.
 The communication is not smooth.
 The collision of packet occur and there is loss of data.
Future Work:
 The protocols can be used for smooth communication.
 Minimize energy consumption by maximizing sleep time.
 Include error control protocol for efficient transmission.
BIBLIOGRAPHY
 “Low Energy Adaptive Clustering Hierarchy with Deterministic
Cluster-Head Selection”; M.J. Handy, M. Haas, D. Timmermann;
2002; http://www.vs.inf.ethz.ch/publ/se/IEEE_MWCN2002.pdf
 “Probabilistic Modeling of Leach Protocol and Computing Sensor
Energy Consumption Rate in Sensor Networks”; Song, Dezhen;
February 22, 2005; http://www.cs.tamu.edu/academics/tr/tamu-cs-tr-
2005-2-2

More Related Content

PPTX
OLSR | Optimized Link State Routing Protocol
PPTX
Traffic-adaptive Medium Access Protocol
PDF
Performance Analysis and Simulation of OLSR Routing Protocol in MANET
PDF
Lte protocol-stack-mac-rlc-pdcp
PPTX
Computer networks comparison of aodv and olsr in ad hoc networks
PPTX
Versatile Low Power Media Access for Wireless Sensor Networks
PPT
Synchronization in SDH network
PPTX
5G NR parameters
OLSR | Optimized Link State Routing Protocol
Traffic-adaptive Medium Access Protocol
Performance Analysis and Simulation of OLSR Routing Protocol in MANET
Lte protocol-stack-mac-rlc-pdcp
Computer networks comparison of aodv and olsr in ad hoc networks
Versatile Low Power Media Access for Wireless Sensor Networks
Synchronization in SDH network
5G NR parameters

What's hot (15)

PPTX
Mobile Transport layer
PPTX
Mobile transport layer .
PDF
Class notes fhrp,hsrp
PDF
TCP over wireless slides
PDF
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
PDF
Umts 18 19
PDF
Handover &amp;mobility in 4g5g
PDF
3 ip routing eigrp
DOCX
Satellite link using 16 psk
PPTX
A neighbor coverage based probabilistic rebroadcast for reducing routing over...
PDF
sigtran
DOCX
Rach procedure in lte
PPTX
Routing Techniques
PDF
MANET, Unicast Routing Protocol, Multicast Routing Protocol.
PDF
IP essentials
Mobile Transport layer
Mobile transport layer .
Class notes fhrp,hsrp
TCP over wireless slides
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
Umts 18 19
Handover &amp;mobility in 4g5g
3 ip routing eigrp
Satellite link using 16 psk
A neighbor coverage based probabilistic rebroadcast for reducing routing over...
sigtran
Rach procedure in lte
Routing Techniques
MANET, Unicast Routing Protocol, Multicast Routing Protocol.
IP essentials
Ad

Similar to final14-4 (20)

PDF
Enhancing the Energy Parameter of Leach Protocol For Wireless Sensor Network
PPT
Protocols for wireless sensor networks
PPTX
Routing protocols of wsn
PDF
Analysis of different hierarchical routing protocols of wireless sensor network
PDF
Analysis of different hierarchical routing protocols of wireless sensor network
PPTX
Wsn protocols
PPTX
Ppt on low power wireless sensor network 5th sem
PDF
A04560105
PPTX
Power Measurement of chain based routing protocol in wireless sensor network
PDF
Based on Heterogeneity and Electing Probability of Nodes Improvement in LEACH
PPT
Wireless Sensor Network WSN Power Point .ppt
PPT
WSN-IEEE-Nov2005-v2.ppt
PDF
IRJET- Optimization with PSO and FPO based Control for Energy Efficient of Se...
PPTX
Energy efficient communication techniques for wireless micro sensor networks
PDF
Experimental Analysis of an Energy-Efficient WSN
PDF
Energy Efficient Optimized LEACH-C Protocol using PBO Algorithm For Wireless ...
PDF
B045070510
PDF
unit-iv-wireless-sensor-networks-wsns-and-mac-protocols
PDF
Energy in Wireless Sensor Network
PDF
A NOVEL APPROACH FOR ENERGY EFFICIENT HIERARCHY BASED ROUTING IN SENSOR NETWO...
Enhancing the Energy Parameter of Leach Protocol For Wireless Sensor Network
Protocols for wireless sensor networks
Routing protocols of wsn
Analysis of different hierarchical routing protocols of wireless sensor network
Analysis of different hierarchical routing protocols of wireless sensor network
Wsn protocols
Ppt on low power wireless sensor network 5th sem
A04560105
Power Measurement of chain based routing protocol in wireless sensor network
Based on Heterogeneity and Electing Probability of Nodes Improvement in LEACH
Wireless Sensor Network WSN Power Point .ppt
WSN-IEEE-Nov2005-v2.ppt
IRJET- Optimization with PSO and FPO based Control for Energy Efficient of Se...
Energy efficient communication techniques for wireless micro sensor networks
Experimental Analysis of an Energy-Efficient WSN
Energy Efficient Optimized LEACH-C Protocol using PBO Algorithm For Wireless ...
B045070510
unit-iv-wireless-sensor-networks-wsns-and-mac-protocols
Energy in Wireless Sensor Network
A NOVEL APPROACH FOR ENERGY EFFICIENT HIERARCHY BASED ROUTING IN SENSOR NETWO...
Ad

final14-4

  • 1. ULTRASONIC SENSOR NETWORK COMMUNICATING USING NRF24L01+ TEAM MEMBERS: ANKITH KUMAR HANUMANTHAPPA SHANMUGAVEL RAMANI ASHOK RAJ PILLI SAIMA KHAN EHSAN GOZARNOEE
  • 2. INTRODUCTION THE FOLLOWING SUBJECTS ARE INCLUDED IN THIS PRESENTATION: • NRF24L01 • CONTENTION BASED PROTOCOLS • STOCHASTIC AND DETERMINISTIC THRESHOLD ALGORITHMS • THE MICROCONTROLLER STRUCTURE OF THE INTERFACES • PROGRAMMING • RESULTS • CONCLUSION • BIBLIOGRAPHY
  • 4. nRF24L01+  The nRF24L01+ is a single chip 2.4Ghz transceiver, suitable for ultra low power communication.  For designing a radio system we require a MCU.  In our project we operate and configure the nRF24L01+ through SPI.  It has internal FIFOs which ensure a smooth data flow between radio and MCU.  It has 126 channel  It has 6 pipes. In our project we are using pipe0.
  • 5. nRF24L01+  It has data rate of 250 kbps, 1 Mbps and 2 Mbps.  Channels while running at < 1 Mbps require minimum spacing of 1 Mbps  Channels while running at 2 Mbps require minimum spacing of 2 Mbps  Two nrf24L01+ chips must have the same channel and air data rate in order to communicate.  Radio operates in 4 different modes. 1. Power down mode 2. Standby mode 3. Transmit mode 4. Receiver mode
  • 8. Packet Structure Addresses  Every wireless transmission is preceded by the address of the receiver it is intended for.  Addresses can be 3, 4 or 5 bytes long. Payloads  The payload is the actual data you are trying to send in your wireless transmission.  The wireless chips can handle payload sizes from 1-32 bytes.
  • 9. Category Xbee Bluetooth WiFi nRF24L01 Distance 50-1600 m 10 m 50 m 40 m Transmission Speed 250 Kbps 1 Mbps 1-54 Mbps 250 -2 Mbps Frequency Range 868 MHz -916 MHz 2.4 GHz 2.4 GHz 2.4 -2.525 GHz -2.4 GHz Cost of terminal unit Low Low High Low Difference between different RF radios
  • 11. A B C D MACA-MULTIPLE ACCESS WITH COLLISON AVOIDANCE
  • 12. A B C D
  • 13. A B C D
  • 14. PAMAS:POWER AWARE MULTIPLE ACCESS WITH SIGNALLINGA B C D Data channel Control channel Busy tone
  • 15. CSMA WHICH IS THE BEST ONE ? PAMAS PAMAS MACAW MACA
  • 16. SPI Serial Peripheral Interface (SPI) is an interface commonly used to send data between microcontrollers and small peripherals. SPI is a serial data protocol used by microcontroller for communicating to one or more peripheral devices. Master device (Microcontroller) MISO MOSI SCK Begin() SetBitOrder() Transfer() End() CE Chip enable(Activate RX or TX mode) CSN SpI chip select Setup NRF Radio on SPI bus
  • 17. RX (PRIM_RX)-> HIGH TX(PRIM_RX)-> LOW NRF24 Library Abstract Low –level communication between microcontroller and transeiver. Start sending voltage to radio. Setup data rate . Setup the internal clock. Setup frequency/channel. ShockBurst It is a packet based data link layer that features Automatic packet handling Auto Acknowledgement Auto Retransmission SPI (CONTD.)
  • 19. #include <SPI.h> #include <RF24.h> #define CE_PIN 9 #define CSN_PIN 10 int Sig=3; const uint64_t pipe = 0xF0F0F0F0A1; RF24 radio(CE_PIN, CSN_PIN); void setup() { Serial.begin(9600); radio.begin(); radio.setAutoAck(false); radio.openWritingPipe(pipe); } void loop() { Serial.print("test"); int time; int dis,z; pinMode(Sig,OUTPUT); digitalWrite(Sig,HIGH); delay(50); digitalWrite(Sig,LOW); pinMode(Sig,INPUT); time= pulseIn(Sig,HIGH); dis=(((time/2)*340.29*100)/1000000); Serial.print(dis); For(i=0;i<15;i++) { radio.write( dis, sizeof(dis) ); } delay(50); } Transmitter Code
  • 20. radio.openReadingPipe(1,pipe); radio.startListening(); } void loop() { if ( radio.available() ) { bool done = false; while (!done) { done = radio.read(dis, sizeof(dis) ); Serial.print(" Y = "); Serial.println(dis); Serial.print(“ cm "); delay(500); } } else { Serial.println("No radio available"); } delay(300);} #include <SPI.h> #include <nRF24L01.h> #include <RF24.h> #define CE_PIN 9 #define CSN_PIN 10 const uint64_t pipe[4] = {0xF0F0F0F066,0xF0F0F0F0AA, 0xF0F0F0F0A1,0xF0F0F0F0B4}; RF24 radio(CE_PIN, CSN_PIN); // Create a Radio Int dis; void setup() { Serial.begin(9600); delay(1000); Serial.println("Nrf24L01 Receiver Starting"); radio.begin(); radio.setAutoAck(false); Receiver Code
  • 21. LEACH PROTOCOL • LEACH stands for Low-Energy Adaptive Clustering Hierarchy • This WSN is considered to be a dynamic clustering method • LEACH has two phases
  • 22. THE PROBLEM • The reason we need network protocol such as LEACH is due to the fact that a node in the network is no longer useful when its battery dies • This protocol allows us to space out the lifespan of the nodes, allowing it to do only the minimum work it needs to transmit data • LEACH uses a TDMA MAC protocol to communicate between its nodes.
  • 23. THE CLUSTER-HEAD • The LEACH Network is made up of nodes, some of which are called cluster-heads • The job of the cluster-head is to collect data from their surrounding nodes and pass it on to the base station • LEACH is dynamic because the job of cluster-head rotates and it selects a cluster head in each round freshly.
  • 24. DIRECT V. MINIMUM TRANSMISSION • The amount of energy used in figure (a) can be modeled by this formula: • eampk(3d1 + d2)2 • Whereas the amount of energy used in figure (b) uses this formula: • eampk(3d1 2 + d2 2 )
  • 25. THE AMOUNT OF ENERGY DEPLETION • This is the formula for the amount of energy depletion by data transfer:
  • 26. LEACH’S TWO PHASES • The LEACH network has two phases: the set-up phase and the steady-state • The Set-Up Phase • Where cluster-heads are chosen • The Steady-State • The cluster-head is maintained • When data is transmitted between nodes
  • 27. STOCHASTIC THRESHOLD ALGORITHM  Cluster-heads can be chosen stochastically (randomly based) on this algorithm:  If n < T(n), then that node becomes a cluster-head  The algorithm is designed so that each node becomes a cluster-head at least once
  • 28. DETERMINISTIC THRESHOLD ALGORITHM • A modified version of this protocol is known as LEACH-C (or LEACH Centralized) • This version has a deterministic threshold algorithm, which takes into account the amount of energy in the node…
  • 29. DETERMINISTIC THRESHOLD ALGORITHM • …and/or whether or not the node was recently a cluster-head. • This formula helps us to stimulate a new cluster head making sure it wasn’t a cluster head previously.
  • 30. WHAT’S THE DIFFERENCE? • REMEMBER: The goal of these protocol is to increase the life of the network • The changes between the LEACH stochastic algorithm and the LEACH-C deterministic algorithm alone is proven to increase the FND (First Node Dies) lifetime by 30% and the HND (Half Node Dies) lifetime by 20%
  • 31. AN EXAMPLE OF A LEACH NETWORK • While neither of these diagrams is the optimum scenario, the second is better because the cluster- heads are spaced out and the network is more properly sectioned
  • 32. Conclusion:  We were successful in building a sensor node which senses the distance from obstacle.  Arduino are not so useful in designing the low power consumption node.  Study of various contention based protocols were done.  PAMAS seem to be the most suitable one.  The sensors and the radio was programmed completely in Arduino and found to be completely functional.
  • 33. Result:  We were successful in communicating in the wireless sensor network.  The communication is not smooth.  The collision of packet occur and there is loss of data. Future Work:  The protocols can be used for smooth communication.  Minimize energy consumption by maximizing sleep time.  Include error control protocol for efficient transmission.
  • 34. BIBLIOGRAPHY  “Low Energy Adaptive Clustering Hierarchy with Deterministic Cluster-Head Selection”; M.J. Handy, M. Haas, D. Timmermann; 2002; http://www.vs.inf.ethz.ch/publ/se/IEEE_MWCN2002.pdf  “Probabilistic Modeling of Leach Protocol and Computing Sensor Energy Consumption Rate in Sensor Networks”; Song, Dezhen; February 22, 2005; http://www.cs.tamu.edu/academics/tr/tamu-cs-tr- 2005-2-2