This document discusses an ultrasonic sensor network that communicates using NRF24L01+ radio modules. It covers the network components including the NRF24L01+ transceiver, contention-based MAC protocols like MACA and PAMAS, and the LEACH clustering protocol. It also describes how the sensors and radios are programmed using Arduino to successfully transmit distance readings wirelessly between nodes with some data loss due to packet collisions. Future work aims to improve the communication efficiency and reduce energy consumption.
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
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.)
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