SlideShare una empresa de Scribd logo
1 de 34
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.)
#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

Más contenido relacionado

La actualidad más candente

05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES
05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES
05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUESEMERSON EDUARDO RODRIGUES
 
Synchronization in SDH network
Synchronization in SDH networkSynchronization in SDH network
Synchronization in SDH networkasifmatin
 
5G NR parameters
5G NR parameters5G NR parameters
5G NR parametersSasi Reddy
 
Mobile transport layer .
Mobile transport layer .Mobile transport layer .
Mobile transport layer .junnubabu
 
Class notes fhrp,hsrp
Class notes  fhrp,hsrpClass notes  fhrp,hsrp
Class notes fhrp,hsrpSagarR24
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slidesMahesh Rajawat
 
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPTEC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPTbabuece
 
Handover &amp;mobility in 4g5g
Handover &amp;mobility in 4g5gHandover &amp;mobility in 4g5g
Handover &amp;mobility in 4g5gabolfazlzakeri
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrpSagarR24
 
Satellite link using 16 psk
Satellite link using 16 pskSatellite link using 16 psk
Satellite link using 16 pskchintanajoshi
 
A neighbor coverage based probabilistic rebroadcast for reducing routing over...
A neighbor coverage based probabilistic rebroadcast for reducing routing over...A neighbor coverage based probabilistic rebroadcast for reducing routing over...
A neighbor coverage based probabilistic rebroadcast for reducing routing over...Abhiram Subhagan
 
MANET, Unicast Routing Protocol, Multicast Routing Protocol.
MANET, Unicast Routing Protocol, Multicast Routing Protocol.MANET, Unicast Routing Protocol, Multicast Routing Protocol.
MANET, Unicast Routing Protocol, Multicast Routing Protocol.Editor IJMTER
 

La actualidad más candente (19)

05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES
05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES
05 c rrm ul amc atb pc ENGINEERING EMERSON EDUARDO RODRIGUES
 
05 b rrm dl PARAMETER
05 b rrm dl PARAMETER05 b rrm dl PARAMETER
05 b rrm dl PARAMETER
 
Synchronization in SDH network
Synchronization in SDH networkSynchronization in SDH network
Synchronization in SDH network
 
5G NR parameters
5G NR parameters5G NR parameters
5G NR parameters
 
Mobile Transport layer
Mobile Transport layerMobile Transport layer
Mobile Transport layer
 
Mobile transport layer .
Mobile transport layer .Mobile transport layer .
Mobile transport layer .
 
Class notes fhrp,hsrp
Class notes  fhrp,hsrpClass notes  fhrp,hsrp
Class notes fhrp,hsrp
 
TCP over wireless slides
TCP over wireless slidesTCP over wireless slides
TCP over wireless slides
 
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPTEC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
 
Umts 18 19
Umts 18 19Umts 18 19
Umts 18 19
 
Handover &amp;mobility in 4g5g
Handover &amp;mobility in 4g5gHandover &amp;mobility in 4g5g
Handover &amp;mobility in 4g5g
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrp
 
Satellite link using 16 psk
Satellite link using 16 pskSatellite link using 16 psk
Satellite link using 16 psk
 
A neighbor coverage based probabilistic rebroadcast for reducing routing over...
A neighbor coverage based probabilistic rebroadcast for reducing routing over...A neighbor coverage based probabilistic rebroadcast for reducing routing over...
A neighbor coverage based probabilistic rebroadcast for reducing routing over...
 
sigtran
sigtransigtran
sigtran
 
Rach procedure in lte
Rach procedure in lteRach procedure in lte
Rach procedure in lte
 
Routing Techniques
Routing TechniquesRouting Techniques
Routing Techniques
 
MANET, Unicast Routing Protocol, Multicast Routing Protocol.
MANET, Unicast Routing Protocol, Multicast Routing Protocol.MANET, Unicast Routing Protocol, Multicast Routing Protocol.
MANET, Unicast Routing Protocol, Multicast Routing Protocol.
 
IP essentials
IP essentialsIP essentials
IP essentials
 

Similar a final14-4

Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...
Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...
Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...Editor IJCATR
 
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...Berna Bulut
 
3 phase energy meter on Zigbee1
3 phase energy meter on Zigbee13 phase energy meter on Zigbee1
3 phase energy meter on Zigbee1Sumit Vyas
 
Ppt on low power wireless sensor network 5th sem
Ppt on low power wireless sensor network 5th semPpt on low power wireless sensor network 5th sem
Ppt on low power wireless sensor network 5th semshikhathegreat
 
WPAN According To ZIGBEE
WPAN According To ZIGBEEWPAN According To ZIGBEE
WPAN According To ZIGBEEAfaq Siddiqui
 
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)Pradeep Singh
 
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...ijsrd.com
 
SMART GRID USING WSN
SMART GRID USING WSNSMART GRID USING WSN
SMART GRID USING WSNJaganya Naina
 
Performance analysis and implementation of modified sdm based noc for mpsoc o...
Performance analysis and implementation of modified sdm based noc for mpsoc o...Performance analysis and implementation of modified sdm based noc for mpsoc o...
Performance analysis and implementation of modified sdm based noc for mpsoc o...eSAT Journals
 
Mac protocols sensor_20071105_slideshare
Mac protocols sensor_20071105_slideshareMac protocols sensor_20071105_slideshare
Mac protocols sensor_20071105_slideshareChih-Yu Lin
 
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Design
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit DesignArea Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Design
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Designijsrd.com
 
Performance Improvement of IEEE 802.22 WRAN Physical Layer
Performance Improvement of IEEE 802.22 WRAN Physical LayerPerformance Improvement of IEEE 802.22 WRAN Physical Layer
Performance Improvement of IEEE 802.22 WRAN Physical LayerIOSR Journals
 

Similar a final14-4 (20)

ADC
ADCADC
ADC
 
PROGRESS 1& 2.ppt
PROGRESS 1& 2.pptPROGRESS 1& 2.ppt
PROGRESS 1& 2.ppt
 
Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...
Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...
Improvement In LEACH Protocol By Electing Master Cluster Heads To Enhance The...
 
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...
Cross-Layer Design of Raptor Codes for Video Multicast over 802.11n MIMO Chan...
 
Wsn protocols
Wsn protocolsWsn protocols
Wsn protocols
 
3 phase energy meter on Zigbee1
3 phase energy meter on Zigbee13 phase energy meter on Zigbee1
3 phase energy meter on Zigbee1
 
Ppt on low power wireless sensor network 5th sem
Ppt on low power wireless sensor network 5th semPpt on low power wireless sensor network 5th sem
Ppt on low power wireless sensor network 5th sem
 
Zigbee 802-15-4
Zigbee 802-15-4Zigbee 802-15-4
Zigbee 802-15-4
 
WPAN According To ZIGBEE
WPAN According To ZIGBEEWPAN According To ZIGBEE
WPAN According To ZIGBEE
 
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)
Project Report on Optical Fiber Cables and Systems (MTNL Mumbai)
 
Sdh total final
Sdh total finalSdh total final
Sdh total final
 
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...
Optimizing the Performance of I-mod Leach-PD Protocol in Wireless Sensor Netw...
 
wsn
wsnwsn
wsn
 
R,aouami wccs
R,aouami wccsR,aouami wccs
R,aouami wccs
 
final
finalfinal
final
 
SMART GRID USING WSN
SMART GRID USING WSNSMART GRID USING WSN
SMART GRID USING WSN
 
Performance analysis and implementation of modified sdm based noc for mpsoc o...
Performance analysis and implementation of modified sdm based noc for mpsoc o...Performance analysis and implementation of modified sdm based noc for mpsoc o...
Performance analysis and implementation of modified sdm based noc for mpsoc o...
 
Mac protocols sensor_20071105_slideshare
Mac protocols sensor_20071105_slideshareMac protocols sensor_20071105_slideshare
Mac protocols sensor_20071105_slideshare
 
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Design
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit DesignArea Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Design
Area Versus Speed Trade-off Analysis of a WiMAX Deinterleaver Circuit Design
 
Performance Improvement of IEEE 802.22 WRAN Physical Layer
Performance Improvement of IEEE 802.22 WRAN Physical LayerPerformance Improvement of IEEE 802.22 WRAN Physical Layer
Performance Improvement of IEEE 802.22 WRAN Physical Layer
 

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.)
  • 18.
  • 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