SlideShare a Scribd company logo
1 of 34
Download to read offline
Submitted	
  By	
  –Braj	
  Raj	
  Singh	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
Submitted	
  to-­‐	
  Prof.	
  Carl	
  Lundgren	
  	
  
Telecommunication	
  Engineering	
  Technology	
  
R o c h e s t e r 	
   I n s t i t u t e 	
   O f 	
   T e c h n o l o g y 	
  
	
  
	
   	
  
Graduate	
  Research	
  Paper	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
Wireless	
  Sensor	
  Network	
  For	
  Smart	
  Grid	
  	
  
Refrigerator/Freezer	
  Unit	
  
  2	
  
Index
	
  
1).	
  Introduction	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  3	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
2).	
  Required	
  Component	
  -­‐	
  
I. MSP	
  430	
  Microcontroller	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page-­‐	
  4	
  
II. CC2500	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page-­‐	
  6	
  
III. EZ430-­‐RF2500T	
  Target	
  Board	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐7	
  
3).	
  Access	
  Point	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐8	
  
4).	
  Program	
  for	
  Access	
  Point	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐9	
  
5).	
  	
  	
  End	
  Device	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐15	
  
6).	
  Compiling	
  and	
  Loading	
  the	
  Access	
  Point	
  code	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐16	
  
7).	
  Program	
  for	
  End	
  device	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐19	
  
8).	
  Compiling	
  and	
  Loading	
  the	
  End	
  Device	
  Code	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page-­‐	
  25	
  
8).	
  Temperature	
  Sensors	
  Monitoring	
  Portal	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐26	
  
9).	
  Wireless	
  Sensor	
  Network	
  diagram	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐28	
  	
  	
  	
  	
  	
  	
  
10).	
  Data	
  Acquisition	
  system	
  for	
  wireless	
  sensor	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐29	
  
11).	
  Process	
  to	
  configure	
  Real	
  Term	
  application	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐30	
  
12).	
  Representation	
  of	
  Sensors	
  data	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐31	
  
13).	
  Customized	
  program	
  for	
  Data	
  Acquisition	
  (End	
  Device).	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐32	
  
14).	
  References	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Page	
  -­‐34	
  
  3	
  
Introduction – 	
  
Wireless Sensor Network-
A	
  wireless	
  sensor	
  network	
  consists	
  of	
  spatially	
  distributed	
  autonomous	
  sensors	
  to	
  
monitor	
  physical	
  or	
  environmental	
  conditions,	
  such	
  as	
  temperature,	
  sound,	
  vibration,	
  
pressure,	
  motion	
  or	
  pollutants	
  and	
  to	
  cooperatively	
  pass	
  their	
  data	
  through	
  the	
  network	
  
to	
  a	
  main	
  location.	
  These	
  Wireless	
  networks	
  are	
  used	
  in	
  many	
  industrial	
  and	
  consumer	
  
applications,	
  such	
  as	
  industrial	
  process	
  monitoring	
  and	
  control,	
  machine	
  health	
  
monitoring,	
  and	
  so	
  on.	
  
The	
  Wireless	
  Sensor	
  Network	
  is	
  built	
  of	
  nodes	
  from	
  a	
  few	
  to	
  several	
  hundreds	
  or	
  even	
  
thousands,	
  where	
  each	
  node	
  is	
  connected	
  to	
  one	
  or	
  more	
  sensors.	
  Each	
  such	
  sensor	
  
network	
  node	
  has	
  typically	
  several	
  parts:	
  a	
  radio	
  transceiver	
  with	
  an	
  internal	
  antenna	
  or	
  
connection	
  to	
  an	
  external	
  antenna,	
  a	
  microcontroller,	
  an	
  electronic	
  circuit	
  for	
  
interfacing	
  with	
  the	
  sensors	
  and	
  an	
  energy	
  source,	
  usually	
  a	
  battery	
  or	
  an	
  embedded	
  
form	
  of	
  energy	
  harvesting.	
  A	
  sensor	
  node	
  might	
  vary	
  in	
  size	
  from	
  that	
  of	
  a	
  shoebox	
  
down	
  to	
  the	
  size	
  of	
  a	
  grain	
  of	
  dust,	
  although	
  functioning	
  "motes"	
  of	
  genuine	
  microscopic	
  
dimensions	
  have	
  yet	
  to	
  be	
  created.	
  The	
  cost	
  of	
  sensor	
  nodes	
  is	
  similarly	
  variable,	
  
ranging	
  from	
  a	
  few	
  to	
  hundreds	
  of	
  dollars,	
  depending	
  on	
  the	
  complexity	
  of	
  the	
  
individual	
  sensor	
  nodes.	
  Size	
  and	
  cost	
  constraints	
  on	
  sensor	
  nodes	
  result	
  in	
  
corresponding	
  constraints	
  on	
  resources	
  such	
  as	
  energy,	
  memory,	
  computational	
  speed	
  
and	
  communications	
  bandwidth.	
  The	
  topology	
  of	
  the	
  WSNs	
  can	
  vary	
  from	
  a	
  simple	
  star	
  
network	
  to	
  an	
  advanced	
  multi-­‐hop	
  wireless	
  mesh	
  network.	
  The	
  propagation	
  technique	
  
between	
  the	
  hops	
  of	
  the	
  network	
  can	
  be	
  routing	
  or	
  flooding.	
  
	
  
Wireless Sensor Network for Smart Grid Refrigerator-	
  
This	
  Project	
  research	
  is	
  based	
  on	
  remotely	
  monitoring	
  and	
  analyzing	
  the	
  
temperature	
  of	
  Refrigerator/Freezer	
  unit	
  using	
  wireless	
  sensors.	
  	
  Specifically,	
  this	
  
portion	
  of	
  the	
  project	
  was	
  the	
  development	
  and	
  fabrication	
  of	
  wireless	
  temperature	
  
instrumentation	
  to	
  be	
  placed	
  in	
  multiple	
  locations	
  in	
  the	
  refrigerator	
  and	
  freezer	
  
compartments.	
  	
  This	
  wireless	
  data	
  acquisition	
  system	
  allows	
  minimal	
  thermal	
  
leakage;	
  and	
  data	
  storage	
  and	
  display	
  remote	
  to	
  the	
  R/F	
  allows	
  continuous	
  and	
  
offsite	
  monitoring.	
  In	
  addition	
  to	
  data	
  acquisition,	
  the	
  system	
  is	
  a	
  prototype	
  for	
  
future	
  systems	
  where	
  the	
  temperature	
  sensor(s)	
  communicates	
  with	
  the	
  demand	
  
management	
  controller	
  to	
  avoid	
  excessive	
  temperature	
  excursions.	
  
  4	
  
Required	
  Components	
  of	
  project-­‐	
  
	
  
(1).	
  MSP430	
  Microcontroller-­‐	
  
	
  
MSP430	
  is	
  one	
  of	
  the	
  main	
  component	
  of	
  wireless	
  sensor	
  network.	
  This	
  is	
  Mixed	
  Signal	
  
Processor,	
  Which	
  is	
  ideal	
  for	
  battery-­‐powered	
  measurement	
  applications.	
  	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
  
	
  
Ultra-­‐low	
  Power-­‐	
  	
  
The	
   MSP430	
   architecture	
   is	
   designed	
   specifically	
   for	
   ultra-­‐low	
   power	
   applications.	
  
Specific	
  operating	
  modes	
  are	
  implemented	
  to	
  reduce	
  power	
  consumption	
  and	
  extend	
  
battery	
   life.	
   The	
   real-­‐time	
   clock	
   mode	
   uses	
   as	
   little	
   as	
   0.8µA	
   and	
   can	
   transition	
   to	
  
industry	
  leading	
  250mA	
  /	
  MIPS	
  full-­‐speed	
  active	
  mode	
  in	
  less	
  than	
  1µs.	
  
Other	
   important	
   low-­‐power	
   feature	
   such	
   as	
   zero-­‐power	
   brown-­‐out	
   reset	
   (BOR)	
   and	
  
extremely	
  low	
  pin	
  leakage	
  have	
  enabled	
  MSP430	
  customers	
  to	
  develop	
  battery-­‐based	
  
products	
  that	
  will	
  last	
  for	
  over	
  10-­‐years	
  from	
  the	
  original	
  battery.	
  
	
  
The	
  MSP430	
  modern	
  16-­‐bit	
  RISC	
  architecture	
  reduces	
  code	
  size	
  and	
  allows	
  advanced	
  
signal	
  processing	
  features	
  not	
  possible	
  using	
  conventional	
  8-­‐bit	
  MCUs.	
  	
  
	
  
	
  
  5	
  
Intelligent	
  mixed-­‐signal	
  peripherals	
  including	
  10-­‐16-­‐bit	
  ADC’s,	
  comparators,	
  DAC’s,	
  LCD	
  
drivers	
   and	
   supply	
   voltage	
   supervisors	
   support	
   precision	
   measurement.	
   This	
   allows	
  
applications	
  to	
  get	
  implemented	
  faster,	
  using	
  less	
  code	
  and	
  power	
  at	
  lower	
  cost.	
  
Applications	
   operating	
   at	
   lower	
   power,	
   with	
   smaller	
   packaging	
   and	
   higher-­‐precision	
  
analog	
  benefit	
  greatly	
  from	
  the	
  MSP430’s	
  embedded	
  emulation.	
  	
  
	
  
No	
   external	
   emulator	
   is	
   required	
   as	
   the	
   device	
   emulates	
   itself.	
   JTAG	
   is	
   used	
   to	
  
communicate	
   unobtrusively	
   with	
   the	
   MSP430	
   in	
   application.	
   This	
   means	
   that	
   all	
  
development	
  is	
  done	
  under	
  the	
  same	
  condition	
  that	
  will	
  be	
  seen	
  in	
  the	
  final	
  product.	
  
Using	
   embedded	
   emulation	
   projects	
   are	
   developed	
   faster,	
   with	
   few	
   errors	
   and	
   at	
   a	
  
lower	
  cost.	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
FLASH
8-60K B
RAM
512-10K B
POR
BOR
8Mhz
Basic
Clock
Watch
dog
15-bit
RISC
CPU
16-bit
JTAG/EEM
Port3/4
Port5/6
MAB
MDB
Timer_B7
16-bit
Port1/2
with IRQ
Comp_A
USART1
UART/SPI
Timer_A3
16-bit
ADC12
200ksps
Vref
Temp
DAC12_0
DAC12_1
DMA
SVS
USART0
UART/SPI
I2C
MPY
MPYS
MAC
MACS
  6	
  
	
  
	
  
(2).	
  CC2500-­‐	
  
	
  
 The	
  CC2500	
  is	
  a	
  low-­‐cost	
  2.4	
  GHz	
  transceiver	
  designed	
  for	
  very	
  low-­‐power	
  
wireless	
  applications.	
  
 	
  The	
  RF	
  transceiver	
  is	
  integrated	
  with	
  a	
  highly	
  configurable	
  baseband	
  modem.	
  The	
  
modem	
  supports	
  various	
  modulation	
  formats	
  and	
  has	
  a	
  configurable	
  data	
  rate	
  up-­‐
to	
  500	
  kBaud.	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
  
Key	
  Feature	
  of	
  CC2500-­‐	
  
 High	
  sensitivity	
  (–104	
  dBm	
  at	
  2.4	
  kBaud	
  1%	
  packet	
  error	
  rate).	
  
 	
  Low	
  current	
  consumption	
  (13.3	
  mA	
  in	
  RX,	
  250	
  kBaud,	
  input	
  well	
  above	
  sensitivity	
  
limit).	
  
 	
  Programmable	
  output	
  power	
  up	
  to	
  +1	
  dBm.	
  
 	
  Excellent	
  receiver	
  selectivity	
  and	
  blocking	
  performance.	
  
 	
  Programmable	
  data	
  rate	
  from	
  1.2	
  to	
  500	
  kBaud	
  .	
  
 	
  Frequency	
  range:	
  2400	
  –	
  2483.5	
  MHz	
  
  7	
  
(3).	
  EZ430-­‐RF2500T	
  Target	
  Board-­‐	
  
The	
  eZ430-­‐RF2500	
  used	
  as	
  a	
  stand-­‐alone	
  development	
  tool.	
  Additionally,	
  the	
  eZ430-­‐
RF2500T	
  target	
  board	
  used	
  to	
  detached	
  from	
  the	
  debugging	
  interface	
  and	
  integrated	
  
into	
  another	
  design	
  by	
  removing	
  the	
  plastic	
  enclosure.	
  	
  
The	
  target	
  board	
  features-­‐	
  
	
  Most	
  of	
  its	
  pins	
  are	
  easily	
  accessible.	
  
MSP430F2274	
  –	
  	
  
1) 32KB	
  Flash	
  
2) 1KB	
  RAM	
  
3) USCI	
  (UART,	
  2xSPI,	
  I2C,	
  IrDA)	
  	
  
4) 10-­‐bit	
  200	
  kbps	
  ADC	
  
5) 2	
  Op	
  Amps	
  
CC2500	
  –	
  	
  
1) 2.4	
  GHz,	
  ISM	
  band	
  multi-­‐channel	
  low	
  power	
  transceiver	
  
2) 2	
  LEDs	
  	
  
3) 1	
  pushbutton	
  
4) Battery	
  expansion	
  board	
  with	
  2	
  AAA	
  batteries	
  	
  
	
  
	
  
  8	
  
Access	
  Point	
  –	
  
There	
  are	
  two	
  main	
  part	
  of	
  RF	
  wireless	
  sensor	
  Network	
  one	
  is	
  programmable	
  USB	
  
Access	
  point,	
  which	
  is	
  a	
  simple	
  serial	
  port	
  device.	
  In	
  Access	
  point	
  each	
  circuit	
  board	
  
holds	
  a	
  complete	
  computer	
  and	
  a	
  2.4	
  GHz	
  radio	
  transceiver.	
  	
  
The	
  computer	
  contains	
  several	
  analog	
  and	
  digital	
  I/O	
  channels,	
  including	
  10	
  bit	
  analog	
  
to	
  digital	
  conversion,	
  two	
  op-­‐amps,	
  and	
  an	
  interface	
  to	
  the	
  radio	
  chip.	
  	
  
We	
  can	
  program	
  the	
  computer	
  in	
  C	
  using	
  a	
  very	
  nice	
  development	
  system	
  included	
  with	
  
the	
  kit.	
  This	
  also	
  provides	
  us	
  with	
  the	
  libraries	
  needed	
  to	
  use	
  the	
  radio	
  to	
  send	
  and	
  
receive	
  simple	
  messages.	
  We	
  can	
  interact	
  with	
  the	
  computer	
  via	
  18	
  pins,	
  two	
  LED’s	
  and	
  
a	
  pushbutton.	
  
	
  
	
  
	
  
	
  
	
  
	
  
  9	
  
Program	
  for	
  Access	
  point	
  –	
  
	
  
The	
  access	
  point	
  build	
  includes	
  implementation	
  of	
  an	
  unknown	
  number	
  of	
  end	
  device	
  
peers	
  in	
  addition	
  to	
  access	
  point	
  functionality.	
  In	
  this	
  scenario	
  all	
  End	
  Devices	
  establish	
  a	
  
link	
  to	
  the	
  access	
  point.	
  
The	
  AP	
  acts	
  as	
  a	
  data	
  hub.	
  All	
  End	
  Device	
  peers	
  are	
  on	
  the	
  access	
  point	
  and	
  not	
  on	
  other	
  
distinct	
  ED	
  platforms.	
  There	
  is	
  still	
  a	
  limit	
  to	
  the	
  number	
  of	
  peers	
  supported	
  on	
  the	
  
access	
  point	
  that	
  is	
  defined	
  by	
  the	
  macro	
  NUM_CONNECTIONS.	
  The	
  access	
  point	
  will	
  
support	
  NUM_CONNECTIONS	
  or	
  fewer	
  peers	
  but	
  the	
  exact	
  number	
  does	
  not	
  need	
  to	
  be	
  
known	
  at	
  build	
  time.	
  
	
  	
  	
  
	
  
/*	
  reserve	
  space	
  for	
  the	
  maximum	
  possible	
  peer	
  Link	
  IDs	
  */	
  
	
  
static	
  linkID_t	
  sLID[NUM_CONNECTIONS]	
  =	
  {0};	
  
static	
  uint8_t	
  	
  sNumCurrentPeers	
  =	
  0;	
  
/*	
  callback	
  handler	
  */	
  
static	
  uint8_t	
  sCB(linkID_t);	
  
/*	
  received	
  message	
  handler	
  */	
  
static	
  void	
  processMessage(linkID_t,	
  uint8_t	
  *,	
  uint8_t);	
  
/*	
  Frequency	
  Agility	
  helper	
  functions	
  */	
  
static	
  void	
  	
  	
  	
  checkChangeChannel(void);	
  
static	
  void	
  	
  	
  	
  changeChannel(void);	
  
/*	
  work	
  loop	
  semaphores	
  */	
  
static	
  volatile	
  uint8_t	
  sPeerFrameSem	
  =	
  0;	
  
static	
  volatile	
  uint8_t	
  sJoinSem	
  =	
  0;	
  
static	
  volatile	
  uint8_t	
  sSelfMeasureSem	
  =	
  0;	
  
#ifdef	
  FREQUENCY_AGILITY	
  
	
  
/*	
  BEGIN	
  interference	
  detection	
  support	
  */	
  
	
  
#define	
  INTERFERNCE_THRESHOLD_DBM	
  (-­‐70)	
  
#define	
  SSIZE	
  	
  	
  	
  25	
  
#define	
  IN_A_ROW	
  	
  3	
  
static	
  int8_t	
  	
  sSample[SSIZE];	
  
  10	
  
static	
  uint8_t	
  sChannel	
  =	
  0;	
  
#endif	
  	
  /*	
  FREQUENCY_AGILITY	
  */	
  
/*	
  blink	
  LEDs	
  when	
  channel	
  changes...	
  */	
  
static	
  volatile	
  uint8_t	
  sBlinky	
  =	
  0;	
  
//data	
  for	
  terminal	
  output	
  
const	
  char	
  splash[]	
  
	
  
volatile	
  int	
  *	
  tempOffset	
  =	
  (int	
  *)0x10F4;	
  
__interrupt	
  void	
  ADC10_ISR(void);	
  
__interrupt	
  void	
  Timer_A	
  (void);	
  
	
  
	
  
	
  
/*	
  	
  END	
  interference	
  detection	
  support	
  	
  	
  */	
  
#define	
  SPIN_ABOUT_A_QUARTER_SECOND	
  	
  	
  NWK_DELAY(250)	
  
void	
  main	
  (void)	
  
{	
  
bspIState_t	
  intState;	
  
memset(sSample,	
  0x0,	
  sizeof(sSample));	
  
	
  
BSP_Init();	
  
BCSCTL3	
  |=	
  LFXT1S_2;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  LFXT1	
  =	
  VLO	
  
TACCTL0	
  =	
  CCIE;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  TACCR0	
  interrupt	
  enabled	
  
TACCR0	
  =	
  12000;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  ~1	
  second	
  
TACTL	
  =	
  TASSEL_1	
  +	
  MC_1;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  ACLK,	
  upmode	
  
	
  
COM_Init();	
  
	
  
//Transmit	
  splash	
  screen	
  and	
  network	
  init	
  notification	
  
	
  
TXString(	
  (char*)splash,	
  sizeof	
  splash);	
  
TXString(	
  "rnInitializing	
  Network....",	
  26	
  );	
  
	
  
SMPL_Init(sCB);	
  
	
  
  11	
  
//network	
  initialized	
  
TXString(	
  "Donern",	
  6);	
  
	
  
/*	
  green	
  and	
  red	
  LEDs	
  on	
  solid	
  to	
  indicate	
  waiting	
  for	
  a	
  Join.	
  */	
  
	
  
if	
  (!BSP_LED2_IS_ON())	
  
{	
  
toggleLED(2);	
  
}	
  
if	
  (!BSP_LED1_IS_ON())	
  
{	
  
toggleLED(1);	
  
}	
  
	
  
/*	
  main	
  work	
  loop	
  */	
  
	
  
while	
  (1)	
  
{	
  
	
  
if	
  (sJoinSem	
  &&	
  (sNumCurrentPeers	
  <	
  NUM_CONNECTIONS))	
  
{	
  
/*	
  listen	
  for	
  a	
  new	
  connection	
  */	
  
while	
  (1)	
  
{	
  
if	
  (SMPL_SUCCESS	
  ==	
  SMPL_LinkListen(&sLID[sNumCurrentPeers]))	
  
{	
  
break;	
  
}	
  
	
  
/*Implement	
  fail-­‐to-­‐link	
  policy	
  here.	
  otherwise,	
  listen	
  again.	
  */	
  
	
  
}	
  
sNumCurrentPeers++;	
  
BSP_ENTER_CRITICAL_SECTION(intState);	
  
sJoinSem-­‐-­‐;	
  
  12	
  
BSP_EXIT_CRITICAL_SECTION(intState);	
  
}	
  
	
  
//if	
  it	
  is	
  time	
  to	
  measure	
  our	
  own	
  temperature...	
  
if(sSelfMeasureSem)	
  
{	
  
char	
  msg	
  [6];	
  
char	
  addr[]	
  =	
  {"HUB0"};	
  
char	
  rssi[]	
  =	
  {"000"};	
  
int	
  degC,	
  volt;	
  
volatile	
  long	
  temp;	
  
int	
  results[2];	
  
	
  
ADC10CTL1	
  =	
  INCH_10	
  +	
  ADC10DIV_4;	
  	
  	
  	
  	
  //	
  Temp	
  Sensor	
  ADC10CLK/5	
  
ADC10CTL0	
  =	
  SREF_1	
  +	
  ADC10SHT_3	
  +	
  REFON	
  +	
  ADC10ON	
  +	
  ADC10IE	
  +	
  ADC10SR;	
  
for(	
  degC	
  =	
  240;	
  degC	
  >	
  0;	
  degC-­‐-­‐	
  );	
  	
  //	
  delay	
  to	
  allow	
  reference	
  to	
  settle	
  
ADC10CTL0	
  |=	
  ENC	
  +	
  ADC10SC;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Sampling	
  and	
  conversion	
  start	
  
__bis_SR_register(CPUOFF	
  +	
  GIE);	
  	
  	
  	
  	
  	
  //	
  LPM0	
  with	
  interrupts	
  enabled	
  
results[0]	
  =	
  ADC10MEM;	
  
	
  
ADC10CTL0	
  &=	
  ~ENC;	
  
	
  
ADC10CTL1	
  =	
  INCH_11;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  AVcc/2	
  
ADC10CTL0	
  =	
  SREF_1	
  +	
  ADC10SHT_2	
  +	
  REFON	
  +	
  ADC10ON	
  +	
  ADC10IE	
  +	
  REF2_5V;	
  
for(	
  degC	
  =	
  240;	
  degC	
  >	
  0;	
  degC-­‐-­‐	
  );	
  	
  //	
  delay	
  to	
  allow	
  reference	
  to	
  settle	
  
ADC10CTL0	
  |=	
  ENC	
  +	
  ADC10SC;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Sampling	
  and	
  conversion	
  start	
  
__bis_SR_register(CPUOFF	
  +	
  GIE);	
  	
  	
  	
  	
  	
  //	
  LPM0	
  with	
  interrupts	
  enabled	
  
results[1]	
  =	
  ADC10MEM;	
  
ADC10CTL0	
  &=	
  ~ENC;	
  
ADC10CTL0	
  &=	
  ~(REFON	
  +	
  ADC10ON);	
  	
  	
  	
  	
  	
  //	
  turn	
  off	
  A/D	
  to	
  save	
  power	
  
	
  
//oC	
  =	
  ((A10/1024)*1500mV)-­‐986mV)*1/3.55mV	
  =	
  A10*423/1024	
  -­‐	
  278	
  
//the	
  temperature	
  is	
  transmitted	
  as	
  an	
  integer	
  where	
  32.1	
  =	
  321	
  
//hence	
  4230	
  instead	
  of	
  423	
  
  13	
  
temp	
  =	
  results[0];	
  
degC	
  =	
  (((temp	
  -­‐	
  673)	
  *	
  4230)	
  /	
  1024);	
  
if(	
  (*tempOffset)	
  !=	
  0xFFFF	
  )	
  
{	
  
degC	
  +=	
  (*tempOffset);	
  
}	
  
	
  
temp	
  =	
  results[1];	
  
volt	
  =	
  (temp*25)/512;	
  
	
  
msg[0]	
  =	
  degC&0xFF;	
  
msg[1]	
  =	
  (degC>>8)&0xFF;	
  
msg[2]	
  =	
  volt;	
  
transmitDataString(1,	
  addr,	
  rssi,	
  msg	
  );	
  
BSP_TOGGLE_LED1();	
  
sSelfMeasureSem	
  =	
  0;	
  
}	
  
	
  
/*	
  Runs	
  in	
  ISR	
  context.	
  Reading	
  the	
  frame	
  should	
  be	
  done	
  in	
  the	
  */	
  
/*	
  application	
  thread	
  not	
  in	
  the	
  ISR	
  thread.	
  */	
  
static	
  uint8_t	
  sCB(linkID_t	
  lid)	
  
{	
  
if	
  (lid)	
  
{	
  
sPeerFrameSem++;	
  
sBlinky	
  =	
  0;	
  
}	
  
else	
  
{	
  
sJoinSem++;	
  
}	
  
/*	
  leave	
  frame	
  to	
  be	
  read	
  by	
  application.	
  */	
  
return	
  0;	
  
}	
  
  14	
  
static	
  void	
  processMessage(linkID_t	
  lid,	
  uint8_t	
  *msg,	
  uint8_t	
  len)	
  
{	
  
/*	
  do	
  something	
  useful	
  */	
  
if	
  (len)	
  
{	
  
toggleLED(*msg);	
  
}	
  
return;	
  
}	
  
static	
  void	
  changeChannel(void)	
  
{	
  
#ifdef	
  FREQUENCY_AGILITY	
  
freqEntry_t	
  freq;	
  
if	
  (++sChannel	
  >=	
  NWK_FREQ_TBL_SIZE)	
  
{	
  
sChannel	
  =	
  0;	
  
}	
  
freq.logicalChan	
  =	
  sChannel;	
  
SMPL_Ioctl(IOCTL_OBJ_FREQ,	
  IOCTL_ACT_SET,	
  &freq);	
  
BSP_TURN_OFF_LED1();	
  
BSP_TURN_OFF_LED2();	
  
sBlinky	
  =	
  1;	
  
#endif	
  
return;	
  
}	
  
	
  
	
  
	
  
	
  
	
  
	
  
  15	
  
END	
  Device-­‐	
  
The	
  second	
  part	
  is	
  END	
  device.	
  Hardware	
  circuit	
  of	
  both	
  devices	
  are	
  identical	
  but	
  they	
  
both	
  running	
  on	
  different	
  programs.	
  
	
  
	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
  16	
  
Compiling	
  and	
  Loading	
  the	
  Access	
  Point	
  code-­‐	
  
To	
  build	
  the	
  executable	
  for	
  the	
  Access	
  Point	
  you	
  start	
  by	
  selecting	
  the	
  Access	
  Point	
  tab	
  
from	
  the	
  Workspace	
  panel	
  of	
  the	
  IAR	
  Embedded	
  Workbench	
  window.	
  
(1). Select the Access Point Tab –
	
  
2)	
  On	
  the	
  menu	
  bar	
  select	
  “Project”,	
  then	
  “Rebuild	
  All”.	
  This	
  will	
  recompile	
  the	
  project	
  
and	
  prepare	
  the	
  programming	
  files.	
  
  17	
  
3) The next step is to load the new code into your little Access Point
circuit board-
To do this just plug the USB stick carrying the AP device into a USB port as before. Now
select “Project” on the menu bar, then “Debug”. This will download the new program to
the little circuit board and will start the debugger.
  18	
  
4). Since we are not interested in running the debugger, once the
debugger starts we can just select “Debug” and “Stop Debugging” from
the menu bar.
Now device is programmed and we can unplug the stick from the USB port.
	
  
  19	
  
Program	
  for	
  End	
  Device-­‐	
  
EZ430-­‐RF2500	
  Temperature	
  Sensor	
  End	
  Device	
  
//	
  Description:	
  This	
  is	
  the	
  End	
  Device	
  software	
  for	
  the	
  eZ430-­‐2500RF	
  Temperature	
  
Sensing	
  //	
  
	
  
#define	
  I_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE	
  
#include	
  "bsp.h"	
  
#include	
  "mrfi.h"	
  
#include	
  "nwk_types.h"	
  
#include	
  "nwk_api.h"	
  
#include	
  "bsp_leds.h"	
  
#include	
  "bsp_buttons.h"	
  
#include	
  "vlo_rand.h"	
  
#ifndef	
  APP_AUTO_ACK	
  
#error	
  ERROR:	
  Must	
  define	
  the	
  macro	
  APP_AUTO_ACK	
  for	
  this	
  application.	
  
#endif	
  
void	
  toggleLED(uint8_t);	
  
static	
  void	
  linkTo(void);	
  
static	
  linkID_t	
  sLinkID1	
  =	
  0;	
  
#define	
  SPIN_ABOUT_A_SECOND	
  	
  	
  NWK_DELAY(1000)	
  
#define	
  SPIN_ABOUT_A_QUARTER_SECOND	
  	
  	
  NWK_DELAY(250)	
  
	
  
/*	
  How	
  many	
  times	
  to	
  try	
  a	
  Tx	
  and	
  miss	
  an	
  acknowledge	
  before	
  doing	
  a	
  scan	
  */	
  
	
  
#define	
  MISSES_IN_A_ROW	
  	
  2	
  
void	
  createRandomAddress(void);	
  	
  
volatile	
  int	
  *	
  tempOffset	
  =	
  (int	
  *)0x10F4;	
  //	
  Temperature	
  offset	
  set	
  at	
  production	
  
char	
  *	
  Flash_Addr	
  =	
  (char	
  *)0x10F0;	
  	
  	
  	
  	
  	
  	
  	
  //	
  Initialize	
  radio	
  address	
  location	
  
__interrupt	
  void	
  ADC10_ISR(void);	
  
__interrupt	
  void	
  Timer_A	
  (void);	
  
/*	
  work	
  loop	
  semaphores	
  */	
  
static	
  volatile	
  uint8_t	
  sSelfMeasureSem	
  =	
  0;	
  
void	
  main	
  (void)	
  
{	
  	
  	
  
	
  	
  addr_t	
  lAddr;	
  
	
  	
  	
  
	
  	
  BSP_Init();	
  
	
  	
  if(Flash_Addr[0]	
  ==	
  0xFF	
  &&	
  Flash_Addr[1]	
  ==	
  0xFF	
  &&	
  	
  
  20	
  
	
  	
  	
  	
  	
  Flash_Addr[2]	
  ==	
  0xFF	
  &&	
  Flash_Addr[3]	
  ==	
  0xFF	
  )	
  	
  
	
  	
  {	
  
	
  	
  	
  	
  createRandomAddress();	
  //	
  set	
  Random	
  device	
  address	
  at	
  initial	
  startup	
  
	
  	
  }	
  
	
  	
  lAddr.addr[0]	
  =	
  Flash_Addr[0];	
  
	
  	
  lAddr.addr[1]	
  =	
  Flash_Addr[1];	
  
	
  	
  lAddr.addr[2]	
  =	
  Flash_Addr[2];	
  
	
  	
  lAddr.addr[3]	
  =	
  Flash_Addr[3];	
  
	
  	
  SMPL_Ioctl(IOCTL_OBJ_ADDR,	
  IOCTL_ACT_SET,	
  &lAddr);	
  
	
  
	
  	
  /*	
  Keep	
  trying	
  to	
  join	
  (a	
  side	
  effect	
  of	
  successful	
  initialization)	
  until	
  successful	
  .	
  
Toggle	
  LEDS	
  to	
  indicate	
  that	
  joining	
  has	
  not	
  occurred*/	
  
	
  
	
  	
  while	
  (SMPL_SUCCESS	
  !=	
  SMPL_Init(0))	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(1);	
  
	
  	
  	
  	
  toggleLED(2);	
  
	
  	
  	
  	
  SPIN_ABOUT_A_SECOND;	
  
	
  	
  }	
  
	
  
	
  	
  /*	
  LEDs	
  on	
  solid	
  to	
  indicate	
  successful	
  join.	
  */	
  
	
  
	
  	
  if	
  (!BSP_LED2_IS_ON())	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(2);	
  
	
  	
  }	
  
	
  	
  if	
  (!BSP_LED1_IS_ON())	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(1);	
  
	
  	
  }	
  
	
  	
  BCSCTL3	
  |=	
  LFXT1S_2;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  LFXT1	
  =	
  VLO	
  
	
  	
  TACCTL0	
  =	
  CCIE;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  TACCR0	
  interrupt	
  enabled	
  
	
  	
  TACCR0	
  =	
  12000;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  ~	
  1	
  sec	
  
	
  	
  TACTL	
  =	
  TASSEL_1	
  +	
  MC_1;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  ACLK,	
  upmode	
  	
  	
  
	
  	
  	
  
	
  	
  /*	
  Unconditional	
  link	
  to	
  AP	
  which	
  is	
  listening	
  due	
  to	
  successful	
  join.*/	
  
	
  	
  linkTo();	
  
	
  	
  while	
  (1)	
  ;	
  
}	
  
static	
  void	
  linkTo()	
  
  21	
  
{	
  
	
  	
  uint8_t	
  	
  	
  	
  	
  msg[3];	
  
	
  	
  uint8_t	
  	
  	
  	
  	
  misses,	
  done;	
  
	
  	
  /*	
  Keep	
  trying	
  to	
  link...	
  */	
  
	
  	
  while	
  (SMPL_SUCCESS	
  !=	
  SMPL_Link(&sLinkID1))	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(1);	
  
	
  	
  	
  	
  toggleLED(2);	
  
	
  	
  	
  	
  SPIN_ABOUT_A_SECOND;	
  
	
  	
  }	
  
	
  	
  /*	
  Turn	
  off	
  LEDs.	
  */	
  
	
  	
  if	
  (BSP_LED2_IS_ON())	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(2);	
  
	
  	
  }	
  
	
  	
  if	
  (BSP_LED1_IS_ON())	
  
	
  	
  {	
  
	
  	
  	
  	
  toggleLED(1);	
  
	
  	
  }	
  
	
  	
  SMPL_Ioctl(	
  IOCTL_OBJ_RADIO,	
  IOCTL_ACT_RADIO_SLEEP,	
  0);	
  
	
  	
  while	
  (1)	
  
	
  	
  {	
  
	
  	
  
	
  	
  	
  	
  __bis_SR_register(LPM3_bits+GIE);	
  	
  //	
  LPM3	
  with	
  interrupts	
  enabled	
  	
  	
  	
  	
  
	
  	
  	
  	
  if	
  (sSelfMeasureSem)	
  {	
  
	
  	
  	
  	
  	
  	
  volatile	
  long	
  temp;	
  
	
  	
  	
  	
  	
  	
  int	
  degC,	
  volt;	
  
	
  	
  	
  	
  	
  	
  int	
  results[2];	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  uint8_t	
  	
  	
  	
  	
  	
  noAck;	
  
	
  	
  	
  	
  	
  	
  smplStatus_t	
  rc;	
  
	
  
	
  	
  	
  	
  	
  	
  /*	
  get	
  radio	
  ready...awakens	
  in	
  idle	
  state	
  */	
  
	
  
	
  	
  	
  	
  	
  	
  SMPL_Ioctl(	
  IOCTL_OBJ_RADIO,	
  IOCTL_ACT_RADIO_AWAKE,	
  0);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  ADC10CTL1	
  =	
  INCH_10	
  +	
  ADC10DIV_4;	
  	
  	
  	
  	
  	
  	
  //	
  Temp	
  Sensor	
  ADC10CLK/5	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  =	
  SREF_1	
  +	
  ADC10SHT_3	
  +	
  REFON	
  +	
  ADC10ON	
  +	
  ADC10IE	
  +	
  ADC10SR;	
  
	
  	
  	
  	
  	
  	
  for(	
  degC	
  =	
  240;	
  degC	
  >	
  0;	
  degC-­‐-­‐	
  );	
  	
  	
  	
  //	
  delay	
  to	
  allow	
  reference	
  to	
  settle	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  |=	
  ENC	
  +	
  ADC10SC;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Sampling	
  and	
  conversion	
  start	
  
	
  	
  	
  	
  	
  	
  __bis_SR_register(CPUOFF	
  +	
  GIE);	
  	
  	
  	
  	
  	
  	
  	
  //	
  LPM0	
  with	
  interrupts	
  enabled	
  
  22	
  
	
  	
  	
  	
  	
  	
  results[0]	
  =	
  ADC10MEM;	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  &=	
  ~ENC;	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  ADC10CTL1	
  =	
  INCH_11;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  AVcc/2	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  =	
  SREF_1	
  +	
  ADC10SHT_2	
  +	
  REFON	
  +	
  ADC10ON	
  +	
  ADC10IE	
  +	
  REF2_5V;	
  
	
  	
  	
  	
  	
  	
  for(	
  degC	
  =	
  240;	
  degC	
  >	
  0;	
  degC-­‐-­‐	
  );	
  	
  	
  	
  //	
  delay	
  to	
  allow	
  reference	
  to	
  settle	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  |=	
  ENC	
  +	
  ADC10SC;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Sampling	
  and	
  conversion	
  start	
  
	
  	
  	
  	
  	
  	
  __bis_SR_register(CPUOFF	
  +	
  GIE);	
  	
  	
  	
  	
  	
  	
  	
  //	
  LPM0	
  with	
  interrupts	
  enabled	
  
	
  	
  	
  	
  	
  	
  results[1]	
  =	
  ADC10MEM;	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  &=	
  ~ENC;	
  
	
  	
  	
  	
  	
  	
  ADC10CTL0	
  &=	
  ~(REFON	
  +	
  ADC10ON);	
  	
  	
  	
  	
  	
  	
  	
  //	
  turn	
  off	
  A/D	
  to	
  save	
  power	
  
	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  //	
  oC	
  =	
  ((A10/1024)*1500mV)-­‐986mV)*1/3.55mV	
  =	
  A10*423/1024	
  -­‐	
  278	
  
	
  	
  	
  	
  	
  	
  //	
  the	
  temperature	
  is	
  transmitted	
  as	
  an	
  integer	
  where	
  32.1	
  =	
  321	
  
	
  	
  	
  	
  	
  	
  //	
  hence	
  4230	
  instead	
  of	
  423	
  
	
  	
  	
  	
  	
  	
  temp	
  =	
  results[0];	
  
	
  	
  	
  	
  	
  	
  degC	
  =	
  ((temp	
  -­‐	
  673)	
  *	
  4230)	
  /	
  1024;	
  
	
  	
  	
  	
  	
  	
  if(	
  (*tempOffset)	
  !=	
  0xFFFF	
  )	
  
	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  degC	
  +=	
  (*tempOffset);	
  	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  /*	
  message	
  format,	
  	
  UB	
  =	
  upper	
  Byte,	
  LB	
  =	
  lower	
  Byte	
  
	
  	
  	
  	
  	
  	
  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐	
  
	
  	
  	
  	
  	
  	
  |degC	
  LB	
  |	
  degC	
  UB	
  |	
  	
  volt	
  LB	
  |	
  
	
  	
  	
  	
  	
  	
  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  0	
  	
  	
  	
  	
  	
  	
  	
  	
  1	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  2	
  
	
  	
  	
  	
  	
  	
  */	
  
	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  temp	
  =	
  results[1];	
  
	
  	
  	
  	
  	
  	
  volt	
  =	
  (temp*25)/512;	
  
	
  	
  	
  	
  	
  	
  msg[0]	
  =	
  degC&0xFF;	
  
	
  	
  	
  	
  	
  	
  msg[1]	
  =	
  (degC>>8)&0xFF;	
  
	
  	
  	
  	
  	
  	
  msg[2]	
  =	
  volt;	
  
	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  done	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  while	
  (!done)	
  
	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  noAck	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  /*	
  Try	
  sending	
  message	
  MISSES_IN_A_ROW	
  times	
  looking	
  for	
  ack	
  */	
  
	
  	
  	
  	
  	
  	
  	
  	
  for	
  (misses=0;	
  misses	
  <	
  MISSES_IN_A_ROW;	
  ++misses)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
  23	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (SMPL_SUCCESS	
  ==	
  (rc=SMPL_SendOpt(sLinkID1,	
  msg,	
  sizeof(msg),	
  
SMPL_TXOPTION_ACKREQ)))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  
/*	
  Message	
  acked.	
  We're	
  done.	
  Toggle	
  LED	
  1	
  to	
  indicate	
  ack	
  received.	
  */	
  
	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  toggleLED(1);	
  	
  //	
  Toggle	
  On	
  LED1	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  __delay_cycles(2000);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  toggleLED(1);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (SMPL_NO_ACK	
  ==	
  rc)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  
/*	
  Count	
  ack	
  failures.	
  Could	
  also	
  fail	
  because	
  of	
  CCA	
  and	
  we	
  don't	
  want	
  to	
  scan	
  in	
  this	
  
case.	
  	
  */	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  noAck++;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  if	
  (MISSES_IN_A_ROW	
  ==	
  noAck)	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  /*	
  Message	
  not	
  acked.	
  Toggle	
  LED	
  2.	
  */	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  toggleLED(2);	
  	
  //	
  Turn	
  On	
  LED2	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  __delay_cycles(2000);	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  toggleLED(2);	
  	
  
#ifdef	
  FREQUENCY_AGILITY	
  
	
  
/*	
  Assume	
  we're	
  on	
  the	
  wrong	
  channel	
  so	
  look	
  for	
  channel	
  by	
  using	
  the	
  Ping	
  to	
  initiate	
  
a	
  scan	
  when	
  it	
  gets	
  no	
  reply.	
  With	
  a	
  successful	
  ping	
  try	
  sending	
  the	
  message	
  again.	
  
Otherwise,	
  	
  for	
  any	
  error	
  we	
  get	
  we	
  will	
  wait	
  until	
  the	
  next	
  button	
  press	
  to	
  try	
  again.	
  
*/	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (SMPL_SUCCESS	
  !=	
  SMPL_Ping(sLinkID1))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  done	
  =	
  1;	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
#else	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  done	
  =	
  1;	
  
#endif	
  	
  /*	
  FREQUENCY_AGILITY	
  */	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  else	
  
  24	
  
	
  	
  	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  /*	
  Got	
  the	
  ack	
  or	
  we	
  don't	
  care.	
  We're	
  done.	
  */	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  done	
  =	
  1;	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  /*	
  radio	
  back	
  to	
  sleep	
  */	
  
	
  
	
  	
  	
  	
  	
  	
  SMPL_Ioctl(	
  IOCTL_OBJ_RADIO,	
  IOCTL_ACT_RADIO_SLEEP,	
  0);	
  
	
  	
  	
  	
  }	
  
	
  	
  }	
  
}	
  
void	
  toggleLED(uint8_t	
  which)	
  
{	
  
	
  	
  if	
  (1	
  ==	
  which)	
  
	
  	
  {	
  
	
  	
  	
  	
  BSP_TOGGLE_LED1();	
  
	
  	
  }	
  
	
  	
  else	
  if	
  (2	
  ==	
  which)	
  
	
  	
  {	
  
	
  	
  	
  	
  BSP_TOGGLE_LED2();	
  
	
  	
  }	
  
	
  	
  return;	
  
}	
  
void	
  createRandomAddress()	
  
{	
  
	
  	
  unsigned	
  int	
  rand,	
  rand2;	
  
	
  	
  do	
  
	
  	
  {	
  
	
  	
  	
  	
  rand	
  =	
  TI_getRandomIntegerFromVLO();	
  	
  	
  	
  //	
  first	
  byte	
  can	
  not	
  be	
  0x00	
  of	
  0xFF	
  
	
  	
  }	
  
	
  	
  while(	
  (rand	
  &	
  0xFF00)==0xFF00	
  ||	
  (rand	
  &	
  0xFF00)==0x0000	
  );	
  
	
  	
  rand2	
  =	
  TI_getRandomIntegerFromVLO();	
  
	
  	
  	
  
	
  	
  BCSCTL1	
  =	
  CALBC1_1MHZ;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Set	
  DCO	
  to	
  1MHz	
  
	
  	
  DCOCTL	
  =	
  CALDCO_1MHZ;	
  
	
  	
  FCTL2	
  =	
  FWKEY	
  +	
  FSSEL0	
  +	
  FN1;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  MCLK/3	
  for	
  Flash	
  Timing	
  Generator	
  
	
  	
  FCTL3	
  =	
  FWKEY	
  +	
  LOCKA;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Clear	
  LOCK	
  &	
  LOCKA	
  bits	
  
	
  	
  FCTL1	
  =	
  FWKEY	
  +	
  WRT;	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Set	
  WRT	
  bit	
  for	
  write	
  operation	
  
	
  	
  	
  
	
  	
  Flash_Addr[0]=(rand>>8)	
  &	
  0xFF;	
  
  25	
  
	
  	
  Flash_Addr[1]=rand	
  &	
  0xFF;	
  
	
  	
  Flash_Addr[2]=(rand2>>8)	
  &	
  0xFF;	
  	
  
	
  	
  Flash_Addr[3]=rand2	
  &	
  0xFF;	
  	
  
	
  	
  	
  
	
  	
  #pragma	
  vector=ADC10_VECTOR	
  
__interrupt	
  void	
  ADC10_ISR(void)	
  
{	
  
	
  	
  __bic_SR_register_on_exit(CPUOFF);	
  	
  	
  	
  	
  	
  	
  	
  //	
  Clear	
  CPUOFF	
  bit	
  from	
  0(SR)	
  
}	
  
	
  
/*	
  Timer	
  A0	
  interrupt	
  service	
  routine*/	
  
	
  
#pragma	
  vector=TIMERA0_VECTOR	
  
__interrupt	
  void	
  Timer_A	
  (void)	
  
{	
  
	
  	
  sSelfMeasureSem	
  =	
  1;	
  	
  	
  
	
  	
  __bic_SR_register_on_exit(LPM3_bits);	
  	
  	
  	
  	
  	
  	
  	
  //	
  Clear	
  LPM3	
  bit	
  from	
  0(SR)	
  
	
  
}	
  
Compiling and Loading the End Device code-
The	
  process	
  for	
  building	
  the	
  executable	
  for	
  the	
  End	
  Device	
  is	
  identical	
  to	
  the	
  process	
  
for	
  the	
  Access	
  Point,	
  the	
  only	
  difference	
  being	
  that	
  you	
  start	
  by	
  selecting	
  the	
  “End	
  
Device”	
  tab.	
  
	
  
	
  
	
  
	
  
  26	
  
All	
  of	
  the	
  other	
  steps	
  are	
  identical,	
  except	
  we	
  need	
  to	
  plug	
  a	
  different	
  little	
  circuit	
  
board	
  into	
  the	
  USB	
  stick	
  before	
  doing	
  the	
  programming	
  step,	
  otherwise	
  we	
  will	
  just	
  
end	
  up	
  reprogramming	
  the	
  Access	
  Point.	
  In	
  other	
  words,	
  we	
  will	
  need	
  to	
  open	
  up	
  
the	
  USB	
  stick	
  and	
  remove	
  the	
  AP	
  circuit	
  board	
  and	
  then	
  attach	
  the	
  ED	
  circuit	
  
board	
  to	
  the	
  USB	
  programmer.	
  
	
  
	
  
	
  
	
  
Temperature	
  Sensors	
  Monitoring	
  Portal-­‐	
  	
  
	
  
	
  
 eZ430-­‐RF2500	
  is	
  preloaded	
  with	
  a	
  wireless	
  temperature	
  sensor	
  network	
  firmware	
  
and	
  can	
  be	
  re-­‐programmed	
  at	
  any	
  time.	
  This	
  network	
  consists	
  of	
  an	
  Access	
  Point	
  
that	
  measures	
  its	
  own	
  temperature	
  and	
  also	
  wirelessly	
  receives	
  temperature	
  
measurements	
  from	
  End	
  Devices.	
  
	
  
 End	
  Devices	
  measure	
  their	
  temperature	
  once	
  per	
  second	
  and	
  then	
  enter	
  a	
  low-­‐
power	
  mode	
  to	
  reduce	
  battery	
  usage.	
  The	
  Access	
  Point	
  transmits	
  all	
  measured	
  
data	
  to	
  the	
  PC	
  through	
  the	
  UART	
  backchannel.	
  The	
  included	
  PC	
  Sensor	
  Monitor	
  
Visualizer	
  provides	
  a	
  demonstration	
  of	
  the	
  eZ430-­‐RF2500	
  using	
  the	
  Simplicity	
  
protocol	
  across	
  a	
  star	
  network.	
  In	
  the	
  PC	
  Sensor	
  Monitor	
  Visualizer,	
  the	
  center	
  
node	
  is	
  the	
  Access	
  Point	
  and	
  the	
  attached	
  bubbles	
  are	
  the	
  End	
  Devices.	
  
  27	
  
	
  
	
  	
  
 The	
  PC	
  application	
  displays	
  the	
  temperature	
  of	
  both	
  the	
  End	
  Devices	
  and	
  Access	
  
Point.	
  Additionally,	
  the	
  PC	
  application	
  is	
  capable	
  of	
  simulating	
  distance	
  from	
  its	
  
access	
  point	
  when	
  the	
  End	
  Devices	
  are	
  moved	
  .The	
  number	
  of	
  End	
  Devices	
  can	
  be	
  
expanded	
  by	
  adding	
  more	
  target	
  boards	
  in	
  the	
  star	
  network.	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
  28	
  
Wireless	
  sensor	
  Network	
  Diagram-­‐	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
  29	
  
Data	
  Acquisition	
  system	
  for	
  wireless	
  sensor-­‐	
  
	
  
For	
  data	
  acquisitions	
  we	
  used	
  real	
  term	
  application	
  .The	
  real	
  term	
  is	
  a	
  terminal	
  program	
  
specially	
  designed	
  for	
  capturing,	
  controlling	
  and	
  debugging	
  binary	
  and	
  other	
  difficult	
  
data	
  streams.	
  It	
  is	
  far	
  better	
  for	
  debugging	
  commas	
  than	
  Hyper-­‐terminal.	
  It	
  has	
  no	
  
support	
  for	
  dialing	
  modems.	
  
	
  
	
  
	
  
	
  
	
  
  30	
  
Process	
  to	
  configure	
  Real	
  Term	
  application-­‐	
  
	
  
1. Disconnect	
  all	
  of	
  the	
  ED’s	
  from	
  their	
  battery	
  packs	
  so	
  that	
  only	
  the	
  AP	
  is	
  left	
  
active.	
  
2. Close	
  the	
  Sensor	
  Monitor	
  window.	
  
3. The	
  AP	
  looks	
  like	
  a	
  simple	
  serial	
  port	
  device	
  to	
  your	
  computer.	
  Every	
  time	
  it	
  
blinks,	
  the	
  AP	
  is	
  actually	
  attempting	
  to	
  send	
  data	
  to	
  your	
  PC.	
  	
  
4. Start	
  up	
  Real-­‐term,	
  which	
  is	
  a	
  terminal	
  emulator	
  program	
  select	
  the	
  Port	
  tab,	
  then	
  
the	
  Port	
  dropdown	
  menu,	
  and	
  select	
  the	
  highest	
  numbered	
  serial	
  port	
  you	
  see	
  
5. Now	
  open	
  the	
  port	
  by	
  clicking	
  on	
  the	
  “Open”	
  button	
  twice.	
  You	
  should	
  see	
  a	
  new	
  
line	
  of	
  data	
  appearing	
  every	
  second	
  or	
  so.	
  
	
  
	
  
  31	
  
Representation	
  of	
  Sensors	
  data-­‐	
  
In	
  Real	
  term	
  serial	
  capture	
  program	
  Every	
  line	
  of	
  data	
  represents	
  the	
  measurements	
  
made	
  by	
  the	
  AP	
  of	
  its	
  own	
  temperature	
  and	
  operating	
  voltage:	
  $HUB0,	
  93.2F,3.5,000,N#	
  
	
  
	
  
This	
  is	
  the	
  temperature	
  information	
  the	
  Sensor	
  Monitor	
  program	
  displaying	
  in	
  the	
  
image.	
  If	
  we	
  power	
  up	
  one	
  of	
  the	
  End	
  devices	
  we	
  can	
  see	
  data	
  appearing	
  in	
  the	
  terminal	
  
program	
  window	
  at	
  about	
  twice	
  the	
  rate	
  as	
  before.	
  This	
  is	
  because	
  the	
  Access	
  point	
  is	
  
now	
  receiving	
  data	
  from	
  the	
  End	
  devices	
  every	
  second	
  or	
  so,	
  and	
  it	
  forwards	
  this	
  to	
  the	
  
PC	
  in	
  addition	
  to	
  its	
  own	
  information.	
  
Power	
  up	
  several	
  more	
  End	
  devices	
  and	
  see	
  what	
  changes	
  in	
  the	
  terminal	
  window.	
  
The	
  third	
  number	
  in	
  the	
  lines	
  from	
  the	
  ED	
  (057	
  or	
  058	
  in	
  the	
  image	
  above)	
  is	
  the	
  
signal	
  strength	
  of	
  the	
  End	
  devices	
  radio	
  transmission	
  as	
  measured	
  by	
  the	
  Access	
  point.	
  
	
  
	
  
  32	
  
Customized	
  program	
  for	
  Data	
  Acquisition	
  (End	
  Device)	
  –	
  
	
  	
  	
  	
  	
  *	
  BEGHDR	
  
*	
  NAME:	
  	
  	
  	
  	
  	
  	
  	
  void	
  transmit_time_delay(void)	
  
*	
  DESCRIPTION:	
  Sets	
  timer	
  to	
  transmit	
  time	
  based	
  on	
  timer_state	
  
*	
  INPUTS:	
  	
  	
  	
  	
  	
  void	
  
*	
  PROCESSING:	
  	
  Sets	
  timer	
  to	
  transmit	
  time,	
  for	
  2	
  min	
  and	
  4	
  min	
  transmit	
  times	
  
*	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  loop	
  number	
  of	
  30	
  sec	
  times	
  to	
  make	
  2	
  min	
  and	
  4	
  min.	
  
*	
  OUTPUTS:	
  	
  	
  	
  	
  void	
  
**************************************************************	
  
void	
  transmit_time_delay(void)	
  
{	
  
	
  	
  volatile	
  unsigned	
  int	
  i	
  =	
  0;	
  
	
  	
  in_delay	
  =	
  1;	
  
	
  	
  switch	
  (timer_state)	
  
	
  	
  {	
  
	
  	
  	
  	
  case	
  timer_state_1:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  1;	
  5	
  Secs	
  
	
  	
  	
  	
  	
  	
  delay(sec5);	
  
	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec5;	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  	
  	
  case	
  timer_state_2:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  2;	
  10	
  Secs	
  
	
  	
  	
  	
  	
  	
  delay(sec10);	
  
	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec10;	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  
	
  	
  	
  	
  case	
  timer_state_3:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  3;	
  20	
  Secs	
  
	
  	
  	
  	
  	
  	
  delay(sec20);	
  
	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec20;	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  	
  case	
  timer_state_4:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  4;	
  40	
  Secs	
  
	
  	
  	
  	
  	
  	
  delay(sec40);	
  
	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
  33	
  
	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec40;	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  
	
  	
  	
  	
  case	
  timer_state_5:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  5;	
  2	
  mins	
  
	
  	
  	
  	
  	
  	
  while((i++	
  <	
  4)	
  &&	
  (timer_state	
  ==	
  timer_state_5))	
  
	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  delay(sec30_2);	
  
	
  	
  	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec30_2;	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  
	
  	
  	
  	
  case	
  timer_state_6:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  Timer	
  State	
  ==	
  6;	
  4	
  mins	
  
	
  	
  	
  	
  	
  	
  while((i++	
  <	
  8)	
  &&	
  (timer_state	
  ==	
  timer_state_6))	
  
	
  	
  	
  	
  	
  	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  delay(sec30_4);	
  
	
  	
  	
  	
  	
  	
  	
  	
  in_delay	
  =	
  0;	
  
	
  	
  	
  	
  	
  	
  	
  	
  battery_full_timer	
  +=	
  sec30_4;	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  	
  	
  default:	
  
	
  	
  	
  	
  	
  	
  break;	
  
	
  	
  }	
  
}//	
  void	
  transmit_time_delay(void)	
  
	
  
	
  
	
  
Initial	
  steps	
  of	
  project	
  based	
  on	
  temperature	
  analyzing	
  and	
  monitoring	
  using	
  radio	
  
frequency	
  sensor.	
  This	
  range	
  is	
  limited	
  in	
  particular	
  area	
  so,	
  we	
  are	
  looking	
  forward	
  for	
  
IP	
  Address	
  based	
  temperature	
  monitoring	
  and	
  wireless	
  data	
  acquisition.	
  
This	
  project	
  could	
  play	
  a	
  substantial	
  part	
  in	
  reducing	
  carbon	
  emission	
  not	
  only	
  for	
  RIT,	
  
but	
  for	
  the	
  community	
  in	
  general.	
  
  34	
  
	
  
References-­‐	
  
	
  
	
  
 Carl	
  Lundgren	
  Professor	
  
Manufacturing	
  &	
  Mech.	
  Eng.	
  Tech./Packaging	
  Science	
  
 Antonio	
  Mondragon,	
  Ph.D.	
  Assistant	
  Professor	
  
 http://www.iar.com/en/Products/IAR-­‐Embedded-­‐Workbench/	
  
 http://realterm.sourceforge.net/	
  
 www.hep.princeton.edu/~marlow/rrs/Guides/Workbench.pdf	
  
 http://www.ti.com/tool/ez430-­‐rf2500-­‐seh	
  
 http://www.ti.com/tool/EZ430-­‐RF2500T	
  
 http://www.arduino.cc/cgi-­‐bin/yabb2/YaBB.pl?num=1289334133	
  
 http://en.wikipedia.org/wiki/Wireless_sensor_network	
  
	
  
	
  
	
  

More Related Content

What's hot

A servey on wireless mesh networking module
A servey on wireless mesh networking moduleA servey on wireless mesh networking module
A servey on wireless mesh networking moduleeSAT Journals
 
Wild fire monitoring system
Wild fire monitoring systemWild fire monitoring system
Wild fire monitoring systemJohn Mahlalela
 
Low cost smart weather station using Arduino and ZigBee
Low cost smart weather station using Arduino and ZigBeeLow cost smart weather station using Arduino and ZigBee
Low cost smart weather station using Arduino and ZigBeeTELKOMNIKA JOURNAL
 
Border security
Border securityBorder security
Border securityFarah Naaz
 
Nanometrics Titan: accelerografi strong motion
Nanometrics Titan: accelerografi strong motion Nanometrics Titan: accelerografi strong motion
Nanometrics Titan: accelerografi strong motion Codevintec Italiana srl
 
Wireless applications in various areas
Wireless applications in various areasWireless applications in various areas
Wireless applications in various areasAmulya Anu
 
Intro to wireless sensor network
Intro to wireless sensor networkIntro to wireless sensor network
Intro to wireless sensor networkVrince Vimal
 
Design and implementation of advanced security system based on one time passw
Design and implementation of advanced security system based on one time passwDesign and implementation of advanced security system based on one time passw
Design and implementation of advanced security system based on one time passwIAEME Publication
 
border-security-using-wins
 border-security-using-wins border-security-using-wins
border-security-using-winsAakashkumar276
 
Ijarcet vol-2-issue-4-1368-1373
Ijarcet vol-2-issue-4-1368-1373Ijarcet vol-2-issue-4-1368-1373
Ijarcet vol-2-issue-4-1368-1373Editor IJARCET
 
border security using gsm
border security using gsmborder security using gsm
border security using gsmbharath naidu
 
22276455 wireless-geophones
22276455 wireless-geophones22276455 wireless-geophones
22276455 wireless-geophonesshankarshankar48
 
Iaetsd flexible and reconfigurable soc for sensor network under zynq processor
Iaetsd flexible and reconfigurable soc for sensor network under zynq processorIaetsd flexible and reconfigurable soc for sensor network under zynq processor
Iaetsd flexible and reconfigurable soc for sensor network under zynq processorIaetsd Iaetsd
 
Design and implementation smart home alarm system with zigbee transceiver
Design and implementation smart home alarm system with zigbee transceiverDesign and implementation smart home alarm system with zigbee transceiver
Design and implementation smart home alarm system with zigbee transceiverzaidinvisible
 
The ARM Based Granary Environmental Monitoring and Controlling System using Z...
The ARM Based Granary Environmental Monitoring and Controlling System using Z...The ARM Based Granary Environmental Monitoring and Controlling System using Z...
The ARM Based Granary Environmental Monitoring and Controlling System using Z...paperpublications3
 

What's hot (19)

A servey on wireless mesh networking module
A servey on wireless mesh networking moduleA servey on wireless mesh networking module
A servey on wireless mesh networking module
 
Kv2518941899
Kv2518941899Kv2518941899
Kv2518941899
 
Wild fire monitoring system
Wild fire monitoring systemWild fire monitoring system
Wild fire monitoring system
 
Low cost smart weather station using Arduino and ZigBee
Low cost smart weather station using Arduino and ZigBeeLow cost smart weather station using Arduino and ZigBee
Low cost smart weather station using Arduino and ZigBee
 
Border security
Border securityBorder security
Border security
 
Nanometrics Titan: accelerografi strong motion
Nanometrics Titan: accelerografi strong motion Nanometrics Titan: accelerografi strong motion
Nanometrics Titan: accelerografi strong motion
 
Modem Acustici Subacquei EvoLogics
Modem Acustici Subacquei EvoLogics Modem Acustici Subacquei EvoLogics
Modem Acustici Subacquei EvoLogics
 
Wireless applications in various areas
Wireless applications in various areasWireless applications in various areas
Wireless applications in various areas
 
Intro to wireless sensor network
Intro to wireless sensor networkIntro to wireless sensor network
Intro to wireless sensor network
 
Design and implementation of advanced security system based on one time passw
Design and implementation of advanced security system based on one time passwDesign and implementation of advanced security system based on one time passw
Design and implementation of advanced security system based on one time passw
 
wins ABHIppt - Copy
wins ABHIppt - Copywins ABHIppt - Copy
wins ABHIppt - Copy
 
border-security-using-wins
 border-security-using-wins border-security-using-wins
border-security-using-wins
 
Ijarcet vol-2-issue-4-1368-1373
Ijarcet vol-2-issue-4-1368-1373Ijarcet vol-2-issue-4-1368-1373
Ijarcet vol-2-issue-4-1368-1373
 
border security using gsm
border security using gsmborder security using gsm
border security using gsm
 
Wsn handbook
Wsn handbookWsn handbook
Wsn handbook
 
22276455 wireless-geophones
22276455 wireless-geophones22276455 wireless-geophones
22276455 wireless-geophones
 
Iaetsd flexible and reconfigurable soc for sensor network under zynq processor
Iaetsd flexible and reconfigurable soc for sensor network under zynq processorIaetsd flexible and reconfigurable soc for sensor network under zynq processor
Iaetsd flexible and reconfigurable soc for sensor network under zynq processor
 
Design and implementation smart home alarm system with zigbee transceiver
Design and implementation smart home alarm system with zigbee transceiverDesign and implementation smart home alarm system with zigbee transceiver
Design and implementation smart home alarm system with zigbee transceiver
 
The ARM Based Granary Environmental Monitoring and Controlling System using Z...
The ARM Based Granary Environmental Monitoring and Controlling System using Z...The ARM Based Granary Environmental Monitoring and Controlling System using Z...
The ARM Based Granary Environmental Monitoring and Controlling System using Z...
 

Similar to Project Report wireless sensor Network

LORA BASED DATA ACQUISITION SYSTEM
LORA BASED DATA ACQUISITION SYSTEMLORA BASED DATA ACQUISITION SYSTEM
LORA BASED DATA ACQUISITION SYSTEMIRJET Journal
 
IRJET- Design and Development of Low Power Sensor Node For Plant Monitori...
IRJET-  	  Design and Development of Low Power Sensor Node For Plant Monitori...IRJET-  	  Design and Development of Low Power Sensor Node For Plant Monitori...
IRJET- Design and Development of Low Power Sensor Node For Plant Monitori...IRJET Journal
 
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...IRJET Journal
 
IRJET- Underground Cable Fault Detection and Transmission of Intimation t...
IRJET-  	  Underground Cable Fault Detection and Transmission of Intimation t...IRJET-  	  Underground Cable Fault Detection and Transmission of Intimation t...
IRJET- Underground Cable Fault Detection and Transmission of Intimation t...IRJET Journal
 
IRJET- Earthquake Early Warning System for Android
IRJET-  	  Earthquake Early Warning System for AndroidIRJET-  	  Earthquake Early Warning System for Android
IRJET- Earthquake Early Warning System for AndroidIRJET Journal
 
IRJET - Bridge Monitoring System using IoT
IRJET -  	  Bridge Monitoring System using IoTIRJET -  	  Bridge Monitoring System using IoT
IRJET - Bridge Monitoring System using IoTIRJET Journal
 
Office Automation & Attendance System using IoT
Office Automation & Attendance System using IoTOffice Automation & Attendance System using IoT
Office Automation & Attendance System using IoTIRJET Journal
 
Office Automation & Attendance System using IoT
Office Automation & Attendance System using IoTOffice Automation & Attendance System using IoT
Office Automation & Attendance System using IoTIRJET Journal
 
Real time approach of piezo actuated beam for wireless seismic measurement us...
Real time approach of piezo actuated beam for wireless seismic measurement us...Real time approach of piezo actuated beam for wireless seismic measurement us...
Real time approach of piezo actuated beam for wireless seismic measurement us...eSAT Journals
 
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...IRJET Journal
 
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...IRJET Journal
 
IOT ASSET TRACKING SYSTEM
IOT ASSET TRACKING SYSTEMIOT ASSET TRACKING SYSTEM
IOT ASSET TRACKING SYSTEMIRJET Journal
 
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORM
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORMDATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORM
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORMIRJET Journal
 
IRJET- Design and Development of IoT based Geiger Muller Counter
IRJET- Design and Development of IoT based Geiger Muller CounterIRJET- Design and Development of IoT based Geiger Muller Counter
IRJET- Design and Development of IoT based Geiger Muller CounterIRJET Journal
 
A Survey on the Placement of Virtual Security Network Functions in Softwarise...
A Survey on the Placement of Virtual Security Network Functions in Softwarise...A Survey on the Placement of Virtual Security Network Functions in Softwarise...
A Survey on the Placement of Virtual Security Network Functions in Softwarise...IRJET Journal
 
IRJET- A Review on Cluster-based Routing for Wireless Sensor Network
IRJET- A Review on Cluster-based Routing for Wireless Sensor NetworkIRJET- A Review on Cluster-based Routing for Wireless Sensor Network
IRJET- A Review on Cluster-based Routing for Wireless Sensor NetworkIRJET Journal
 
Lightning Acquisition and Processing On Sensor Node Using NI cRIO
Lightning Acquisition and Processing On Sensor Node Using NI cRIOLightning Acquisition and Processing On Sensor Node Using NI cRIO
Lightning Acquisition and Processing On Sensor Node Using NI cRIOijceronline
 
A Brief Review on Internet of Things
A Brief Review on Internet of ThingsA Brief Review on Internet of Things
A Brief Review on Internet of ThingsIRJET Journal
 
IRJET- A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...
IRJET-  	  A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...IRJET-  	  A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...
IRJET- A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...IRJET Journal
 
Remote Monitoring of Crop Field Using Wireless Sensor Network
Remote Monitoring of Crop Field Using Wireless Sensor NetworkRemote Monitoring of Crop Field Using Wireless Sensor Network
Remote Monitoring of Crop Field Using Wireless Sensor NetworkIJMER
 

Similar to Project Report wireless sensor Network (20)

LORA BASED DATA ACQUISITION SYSTEM
LORA BASED DATA ACQUISITION SYSTEMLORA BASED DATA ACQUISITION SYSTEM
LORA BASED DATA ACQUISITION SYSTEM
 
IRJET- Design and Development of Low Power Sensor Node For Plant Monitori...
IRJET-  	  Design and Development of Low Power Sensor Node For Plant Monitori...IRJET-  	  Design and Development of Low Power Sensor Node For Plant Monitori...
IRJET- Design and Development of Low Power Sensor Node For Plant Monitori...
 
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
DEVELOPING A REAL TIME DATA ACQUISITION , FLY-BY-WIRE COMMUNICATION SYSTEM FO...
 
IRJET- Underground Cable Fault Detection and Transmission of Intimation t...
IRJET-  	  Underground Cable Fault Detection and Transmission of Intimation t...IRJET-  	  Underground Cable Fault Detection and Transmission of Intimation t...
IRJET- Underground Cable Fault Detection and Transmission of Intimation t...
 
IRJET- Earthquake Early Warning System for Android
IRJET-  	  Earthquake Early Warning System for AndroidIRJET-  	  Earthquake Early Warning System for Android
IRJET- Earthquake Early Warning System for Android
 
IRJET - Bridge Monitoring System using IoT
IRJET -  	  Bridge Monitoring System using IoTIRJET -  	  Bridge Monitoring System using IoT
IRJET - Bridge Monitoring System using IoT
 
Office Automation & Attendance System using IoT
Office Automation & Attendance System using IoTOffice Automation & Attendance System using IoT
Office Automation & Attendance System using IoT
 
Office Automation & Attendance System using IoT
Office Automation & Attendance System using IoTOffice Automation & Attendance System using IoT
Office Automation & Attendance System using IoT
 
Real time approach of piezo actuated beam for wireless seismic measurement us...
Real time approach of piezo actuated beam for wireless seismic measurement us...Real time approach of piezo actuated beam for wireless seismic measurement us...
Real time approach of piezo actuated beam for wireless seismic measurement us...
 
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...
IRJET- Implementation of Cloud Robotics using Raspberry PI to Monitor Product...
 
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...
IRJET- - Control Center Viewing of UAS-based Real-Time Sensor and Video Measu...
 
IOT ASSET TRACKING SYSTEM
IOT ASSET TRACKING SYSTEMIOT ASSET TRACKING SYSTEM
IOT ASSET TRACKING SYSTEM
 
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORM
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORMDATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORM
DATA ACQUISITION AND ALERT SYSTEM USING BLYNK PLATFORM
 
IRJET- Design and Development of IoT based Geiger Muller Counter
IRJET- Design and Development of IoT based Geiger Muller CounterIRJET- Design and Development of IoT based Geiger Muller Counter
IRJET- Design and Development of IoT based Geiger Muller Counter
 
A Survey on the Placement of Virtual Security Network Functions in Softwarise...
A Survey on the Placement of Virtual Security Network Functions in Softwarise...A Survey on the Placement of Virtual Security Network Functions in Softwarise...
A Survey on the Placement of Virtual Security Network Functions in Softwarise...
 
IRJET- A Review on Cluster-based Routing for Wireless Sensor Network
IRJET- A Review on Cluster-based Routing for Wireless Sensor NetworkIRJET- A Review on Cluster-based Routing for Wireless Sensor Network
IRJET- A Review on Cluster-based Routing for Wireless Sensor Network
 
Lightning Acquisition and Processing On Sensor Node Using NI cRIO
Lightning Acquisition and Processing On Sensor Node Using NI cRIOLightning Acquisition and Processing On Sensor Node Using NI cRIO
Lightning Acquisition and Processing On Sensor Node Using NI cRIO
 
A Brief Review on Internet of Things
A Brief Review on Internet of ThingsA Brief Review on Internet of Things
A Brief Review on Internet of Things
 
IRJET- A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...
IRJET-  	  A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...IRJET-  	  A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...
IRJET- A Study on: Wireless Sensing Network (WSN) Gas Leakage Detection S...
 
Remote Monitoring of Crop Field Using Wireless Sensor Network
Remote Monitoring of Crop Field Using Wireless Sensor NetworkRemote Monitoring of Crop Field Using Wireless Sensor Network
Remote Monitoring of Crop Field Using Wireless Sensor Network
 

Project Report wireless sensor Network

  • 1. Submitted  By  –Braj  Raj  Singh                                                                                                                                                         Submitted  to-­‐  Prof.  Carl  Lundgren     Telecommunication  Engineering  Technology   R o c h e s t e r   I n s t i t u t e   O f   T e c h n o l o g y         Graduate  Research  Paper                                                                                                                 Wireless  Sensor  Network  For  Smart  Grid     Refrigerator/Freezer  Unit  
  • 2.   2   Index   1).  Introduction                                                                                                                                                                                                        Page  3                                                                         2).  Required  Component  -­‐   I. MSP  430  Microcontroller                                                                                                                                                  Page-­‐  4   II. CC2500                                                                                                                                                                                                                  Page-­‐  6   III. EZ430-­‐RF2500T  Target  Board                                                                                                                                    Page  -­‐7   3).  Access  Point                                                                                                                                                                                                          Page  -­‐8   4).  Program  for  Access  Point                                                                                                                                                            Page  -­‐9   5).      End  Device                                                                                                                                                                                                            Page  -­‐15   6).  Compiling  and  Loading  the  Access  Point  code                                                                                    Page  -­‐16   7).  Program  for  End  device                                                                                                                                                                  Page  -­‐19   8).  Compiling  and  Loading  the  End  Device  Code                                                                                        Page-­‐  25   8).  Temperature  Sensors  Monitoring  Portal                                                                                                      Page  -­‐26   9).  Wireless  Sensor  Network  diagram                                                                                                                            Page  -­‐28               10).  Data  Acquisition  system  for  wireless  sensor                                                                                      Page  -­‐29   11).  Process  to  configure  Real  Term  application                                                                                        Page  -­‐30   12).  Representation  of  Sensors  data                                                                                                                                  Page  -­‐31   13).  Customized  program  for  Data  Acquisition  (End  Device).                                            Page  -­‐32   14).  References                                                                                                                                                                                                            Page  -­‐34  
  • 3.   3   Introduction –   Wireless Sensor Network- A  wireless  sensor  network  consists  of  spatially  distributed  autonomous  sensors  to   monitor  physical  or  environmental  conditions,  such  as  temperature,  sound,  vibration,   pressure,  motion  or  pollutants  and  to  cooperatively  pass  their  data  through  the  network   to  a  main  location.  These  Wireless  networks  are  used  in  many  industrial  and  consumer   applications,  such  as  industrial  process  monitoring  and  control,  machine  health   monitoring,  and  so  on.   The  Wireless  Sensor  Network  is  built  of  nodes  from  a  few  to  several  hundreds  or  even   thousands,  where  each  node  is  connected  to  one  or  more  sensors.  Each  such  sensor   network  node  has  typically  several  parts:  a  radio  transceiver  with  an  internal  antenna  or   connection  to  an  external  antenna,  a  microcontroller,  an  electronic  circuit  for   interfacing  with  the  sensors  and  an  energy  source,  usually  a  battery  or  an  embedded   form  of  energy  harvesting.  A  sensor  node  might  vary  in  size  from  that  of  a  shoebox   down  to  the  size  of  a  grain  of  dust,  although  functioning  "motes"  of  genuine  microscopic   dimensions  have  yet  to  be  created.  The  cost  of  sensor  nodes  is  similarly  variable,   ranging  from  a  few  to  hundreds  of  dollars,  depending  on  the  complexity  of  the   individual  sensor  nodes.  Size  and  cost  constraints  on  sensor  nodes  result  in   corresponding  constraints  on  resources  such  as  energy,  memory,  computational  speed   and  communications  bandwidth.  The  topology  of  the  WSNs  can  vary  from  a  simple  star   network  to  an  advanced  multi-­‐hop  wireless  mesh  network.  The  propagation  technique   between  the  hops  of  the  network  can  be  routing  or  flooding.     Wireless Sensor Network for Smart Grid Refrigerator-   This  Project  research  is  based  on  remotely  monitoring  and  analyzing  the   temperature  of  Refrigerator/Freezer  unit  using  wireless  sensors.    Specifically,  this   portion  of  the  project  was  the  development  and  fabrication  of  wireless  temperature   instrumentation  to  be  placed  in  multiple  locations  in  the  refrigerator  and  freezer   compartments.    This  wireless  data  acquisition  system  allows  minimal  thermal   leakage;  and  data  storage  and  display  remote  to  the  R/F  allows  continuous  and   offsite  monitoring.  In  addition  to  data  acquisition,  the  system  is  a  prototype  for   future  systems  where  the  temperature  sensor(s)  communicates  with  the  demand   management  controller  to  avoid  excessive  temperature  excursions.  
  • 4.   4   Required  Components  of  project-­‐     (1).  MSP430  Microcontroller-­‐     MSP430  is  one  of  the  main  component  of  wireless  sensor  network.  This  is  Mixed  Signal   Processor,  Which  is  ideal  for  battery-­‐powered  measurement  applications.                                                                           Ultra-­‐low  Power-­‐     The   MSP430   architecture   is   designed   specifically   for   ultra-­‐low   power   applications.   Specific  operating  modes  are  implemented  to  reduce  power  consumption  and  extend   battery   life.   The   real-­‐time   clock   mode   uses   as   little   as   0.8µA   and   can   transition   to   industry  leading  250mA  /  MIPS  full-­‐speed  active  mode  in  less  than  1µs.   Other   important   low-­‐power   feature   such   as   zero-­‐power   brown-­‐out   reset   (BOR)   and   extremely  low  pin  leakage  have  enabled  MSP430  customers  to  develop  battery-­‐based   products  that  will  last  for  over  10-­‐years  from  the  original  battery.     The  MSP430  modern  16-­‐bit  RISC  architecture  reduces  code  size  and  allows  advanced   signal  processing  features  not  possible  using  conventional  8-­‐bit  MCUs.        
  • 5.   5   Intelligent  mixed-­‐signal  peripherals  including  10-­‐16-­‐bit  ADC’s,  comparators,  DAC’s,  LCD   drivers   and   supply   voltage   supervisors   support   precision   measurement.   This   allows   applications  to  get  implemented  faster,  using  less  code  and  power  at  lower  cost.   Applications   operating   at   lower   power,   with   smaller   packaging   and   higher-­‐precision   analog  benefit  greatly  from  the  MSP430’s  embedded  emulation.       No   external   emulator   is   required   as   the   device   emulates   itself.   JTAG   is   used   to   communicate   unobtrusively   with   the   MSP430   in   application.   This   means   that   all   development  is  done  under  the  same  condition  that  will  be  seen  in  the  final  product.   Using   embedded   emulation   projects   are   developed   faster,   with   few   errors   and   at   a   lower  cost.                       FLASH 8-60K B RAM 512-10K B POR BOR 8Mhz Basic Clock Watch dog 15-bit RISC CPU 16-bit JTAG/EEM Port3/4 Port5/6 MAB MDB Timer_B7 16-bit Port1/2 with IRQ Comp_A USART1 UART/SPI Timer_A3 16-bit ADC12 200ksps Vref Temp DAC12_0 DAC12_1 DMA SVS USART0 UART/SPI I2C MPY MPYS MAC MACS
  • 6.   6       (2).  CC2500-­‐      The  CC2500  is  a  low-­‐cost  2.4  GHz  transceiver  designed  for  very  low-­‐power   wireless  applications.     The  RF  transceiver  is  integrated  with  a  highly  configurable  baseband  modem.  The   modem  supports  various  modulation  formats  and  has  a  configurable  data  rate  up-­‐ to  500  kBaud.                               Key  Feature  of  CC2500-­‐    High  sensitivity  (–104  dBm  at  2.4  kBaud  1%  packet  error  rate).     Low  current  consumption  (13.3  mA  in  RX,  250  kBaud,  input  well  above  sensitivity   limit).     Programmable  output  power  up  to  +1  dBm.     Excellent  receiver  selectivity  and  blocking  performance.     Programmable  data  rate  from  1.2  to  500  kBaud  .     Frequency  range:  2400  –  2483.5  MHz  
  • 7.   7   (3).  EZ430-­‐RF2500T  Target  Board-­‐   The  eZ430-­‐RF2500  used  as  a  stand-­‐alone  development  tool.  Additionally,  the  eZ430-­‐ RF2500T  target  board  used  to  detached  from  the  debugging  interface  and  integrated   into  another  design  by  removing  the  plastic  enclosure.     The  target  board  features-­‐    Most  of  its  pins  are  easily  accessible.   MSP430F2274  –     1) 32KB  Flash   2) 1KB  RAM   3) USCI  (UART,  2xSPI,  I2C,  IrDA)     4) 10-­‐bit  200  kbps  ADC   5) 2  Op  Amps   CC2500  –     1) 2.4  GHz,  ISM  band  multi-­‐channel  low  power  transceiver   2) 2  LEDs     3) 1  pushbutton   4) Battery  expansion  board  with  2  AAA  batteries        
  • 8.   8   Access  Point  –   There  are  two  main  part  of  RF  wireless  sensor  Network  one  is  programmable  USB   Access  point,  which  is  a  simple  serial  port  device.  In  Access  point  each  circuit  board   holds  a  complete  computer  and  a  2.4  GHz  radio  transceiver.     The  computer  contains  several  analog  and  digital  I/O  channels,  including  10  bit  analog   to  digital  conversion,  two  op-­‐amps,  and  an  interface  to  the  radio  chip.     We  can  program  the  computer  in  C  using  a  very  nice  development  system  included  with   the  kit.  This  also  provides  us  with  the  libraries  needed  to  use  the  radio  to  send  and   receive  simple  messages.  We  can  interact  with  the  computer  via  18  pins,  two  LED’s  and   a  pushbutton.              
  • 9.   9   Program  for  Access  point  –     The  access  point  build  includes  implementation  of  an  unknown  number  of  end  device   peers  in  addition  to  access  point  functionality.  In  this  scenario  all  End  Devices  establish  a   link  to  the  access  point.   The  AP  acts  as  a  data  hub.  All  End  Device  peers  are  on  the  access  point  and  not  on  other   distinct  ED  platforms.  There  is  still  a  limit  to  the  number  of  peers  supported  on  the   access  point  that  is  defined  by  the  macro  NUM_CONNECTIONS.  The  access  point  will   support  NUM_CONNECTIONS  or  fewer  peers  but  the  exact  number  does  not  need  to  be   known  at  build  time.           /*  reserve  space  for  the  maximum  possible  peer  Link  IDs  */     static  linkID_t  sLID[NUM_CONNECTIONS]  =  {0};   static  uint8_t    sNumCurrentPeers  =  0;   /*  callback  handler  */   static  uint8_t  sCB(linkID_t);   /*  received  message  handler  */   static  void  processMessage(linkID_t,  uint8_t  *,  uint8_t);   /*  Frequency  Agility  helper  functions  */   static  void        checkChangeChannel(void);   static  void        changeChannel(void);   /*  work  loop  semaphores  */   static  volatile  uint8_t  sPeerFrameSem  =  0;   static  volatile  uint8_t  sJoinSem  =  0;   static  volatile  uint8_t  sSelfMeasureSem  =  0;   #ifdef  FREQUENCY_AGILITY     /*  BEGIN  interference  detection  support  */     #define  INTERFERNCE_THRESHOLD_DBM  (-­‐70)   #define  SSIZE        25   #define  IN_A_ROW    3   static  int8_t    sSample[SSIZE];  
  • 10.   10   static  uint8_t  sChannel  =  0;   #endif    /*  FREQUENCY_AGILITY  */   /*  blink  LEDs  when  channel  changes...  */   static  volatile  uint8_t  sBlinky  =  0;   //data  for  terminal  output   const  char  splash[]     volatile  int  *  tempOffset  =  (int  *)0x10F4;   __interrupt  void  ADC10_ISR(void);   __interrupt  void  Timer_A  (void);         /*    END  interference  detection  support      */   #define  SPIN_ABOUT_A_QUARTER_SECOND      NWK_DELAY(250)   void  main  (void)   {   bspIState_t  intState;   memset(sSample,  0x0,  sizeof(sSample));     BSP_Init();   BCSCTL3  |=  LFXT1S_2;                                            //  LFXT1  =  VLO   TACCTL0  =  CCIE;                                                      //  TACCR0  interrupt  enabled   TACCR0  =  12000;                                                      //  ~1  second   TACTL  =  TASSEL_1  +  MC_1;                                    //  ACLK,  upmode     COM_Init();     //Transmit  splash  screen  and  network  init  notification     TXString(  (char*)splash,  sizeof  splash);   TXString(  "rnInitializing  Network....",  26  );     SMPL_Init(sCB);    
  • 11.   11   //network  initialized   TXString(  "Donern",  6);     /*  green  and  red  LEDs  on  solid  to  indicate  waiting  for  a  Join.  */     if  (!BSP_LED2_IS_ON())   {   toggleLED(2);   }   if  (!BSP_LED1_IS_ON())   {   toggleLED(1);   }     /*  main  work  loop  */     while  (1)   {     if  (sJoinSem  &&  (sNumCurrentPeers  <  NUM_CONNECTIONS))   {   /*  listen  for  a  new  connection  */   while  (1)   {   if  (SMPL_SUCCESS  ==  SMPL_LinkListen(&sLID[sNumCurrentPeers]))   {   break;   }     /*Implement  fail-­‐to-­‐link  policy  here.  otherwise,  listen  again.  */     }   sNumCurrentPeers++;   BSP_ENTER_CRITICAL_SECTION(intState);   sJoinSem-­‐-­‐;  
  • 12.   12   BSP_EXIT_CRITICAL_SECTION(intState);   }     //if  it  is  time  to  measure  our  own  temperature...   if(sSelfMeasureSem)   {   char  msg  [6];   char  addr[]  =  {"HUB0"};   char  rssi[]  =  {"000"};   int  degC,  volt;   volatile  long  temp;   int  results[2];     ADC10CTL1  =  INCH_10  +  ADC10DIV_4;          //  Temp  Sensor  ADC10CLK/5   ADC10CTL0  =  SREF_1  +  ADC10SHT_3  +  REFON  +  ADC10ON  +  ADC10IE  +  ADC10SR;   for(  degC  =  240;  degC  >  0;  degC-­‐-­‐  );    //  delay  to  allow  reference  to  settle   ADC10CTL0  |=  ENC  +  ADC10SC;                      //  Sampling  and  conversion  start   __bis_SR_register(CPUOFF  +  GIE);            //  LPM0  with  interrupts  enabled   results[0]  =  ADC10MEM;     ADC10CTL0  &=  ~ENC;     ADC10CTL1  =  INCH_11;                                    //  AVcc/2   ADC10CTL0  =  SREF_1  +  ADC10SHT_2  +  REFON  +  ADC10ON  +  ADC10IE  +  REF2_5V;   for(  degC  =  240;  degC  >  0;  degC-­‐-­‐  );    //  delay  to  allow  reference  to  settle   ADC10CTL0  |=  ENC  +  ADC10SC;                      //  Sampling  and  conversion  start   __bis_SR_register(CPUOFF  +  GIE);            //  LPM0  with  interrupts  enabled   results[1]  =  ADC10MEM;   ADC10CTL0  &=  ~ENC;   ADC10CTL0  &=  ~(REFON  +  ADC10ON);            //  turn  off  A/D  to  save  power     //oC  =  ((A10/1024)*1500mV)-­‐986mV)*1/3.55mV  =  A10*423/1024  -­‐  278   //the  temperature  is  transmitted  as  an  integer  where  32.1  =  321   //hence  4230  instead  of  423  
  • 13.   13   temp  =  results[0];   degC  =  (((temp  -­‐  673)  *  4230)  /  1024);   if(  (*tempOffset)  !=  0xFFFF  )   {   degC  +=  (*tempOffset);   }     temp  =  results[1];   volt  =  (temp*25)/512;     msg[0]  =  degC&0xFF;   msg[1]  =  (degC>>8)&0xFF;   msg[2]  =  volt;   transmitDataString(1,  addr,  rssi,  msg  );   BSP_TOGGLE_LED1();   sSelfMeasureSem  =  0;   }     /*  Runs  in  ISR  context.  Reading  the  frame  should  be  done  in  the  */   /*  application  thread  not  in  the  ISR  thread.  */   static  uint8_t  sCB(linkID_t  lid)   {   if  (lid)   {   sPeerFrameSem++;   sBlinky  =  0;   }   else   {   sJoinSem++;   }   /*  leave  frame  to  be  read  by  application.  */   return  0;   }  
  • 14.   14   static  void  processMessage(linkID_t  lid,  uint8_t  *msg,  uint8_t  len)   {   /*  do  something  useful  */   if  (len)   {   toggleLED(*msg);   }   return;   }   static  void  changeChannel(void)   {   #ifdef  FREQUENCY_AGILITY   freqEntry_t  freq;   if  (++sChannel  >=  NWK_FREQ_TBL_SIZE)   {   sChannel  =  0;   }   freq.logicalChan  =  sChannel;   SMPL_Ioctl(IOCTL_OBJ_FREQ,  IOCTL_ACT_SET,  &freq);   BSP_TURN_OFF_LED1();   BSP_TURN_OFF_LED2();   sBlinky  =  1;   #endif   return;   }              
  • 15.   15   END  Device-­‐   The  second  part  is  END  device.  Hardware  circuit  of  both  devices  are  identical  but  they   both  running  on  different  programs.                                                              
  • 16.   16   Compiling  and  Loading  the  Access  Point  code-­‐   To  build  the  executable  for  the  Access  Point  you  start  by  selecting  the  Access  Point  tab   from  the  Workspace  panel  of  the  IAR  Embedded  Workbench  window.   (1). Select the Access Point Tab –   2)  On  the  menu  bar  select  “Project”,  then  “Rebuild  All”.  This  will  recompile  the  project   and  prepare  the  programming  files.  
  • 17.   17   3) The next step is to load the new code into your little Access Point circuit board- To do this just plug the USB stick carrying the AP device into a USB port as before. Now select “Project” on the menu bar, then “Debug”. This will download the new program to the little circuit board and will start the debugger.
  • 18.   18   4). Since we are not interested in running the debugger, once the debugger starts we can just select “Debug” and “Stop Debugging” from the menu bar. Now device is programmed and we can unplug the stick from the USB port.  
  • 19.   19   Program  for  End  Device-­‐   EZ430-­‐RF2500  Temperature  Sensor  End  Device   //  Description:  This  is  the  End  Device  software  for  the  eZ430-­‐2500RF  Temperature   Sensing  //     #define  I_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE   #include  "bsp.h"   #include  "mrfi.h"   #include  "nwk_types.h"   #include  "nwk_api.h"   #include  "bsp_leds.h"   #include  "bsp_buttons.h"   #include  "vlo_rand.h"   #ifndef  APP_AUTO_ACK   #error  ERROR:  Must  define  the  macro  APP_AUTO_ACK  for  this  application.   #endif   void  toggleLED(uint8_t);   static  void  linkTo(void);   static  linkID_t  sLinkID1  =  0;   #define  SPIN_ABOUT_A_SECOND      NWK_DELAY(1000)   #define  SPIN_ABOUT_A_QUARTER_SECOND      NWK_DELAY(250)     /*  How  many  times  to  try  a  Tx  and  miss  an  acknowledge  before  doing  a  scan  */     #define  MISSES_IN_A_ROW    2   void  createRandomAddress(void);     volatile  int  *  tempOffset  =  (int  *)0x10F4;  //  Temperature  offset  set  at  production   char  *  Flash_Addr  =  (char  *)0x10F0;                //  Initialize  radio  address  location   __interrupt  void  ADC10_ISR(void);   __interrupt  void  Timer_A  (void);   /*  work  loop  semaphores  */   static  volatile  uint8_t  sSelfMeasureSem  =  0;   void  main  (void)   {          addr_t  lAddr;            BSP_Init();      if(Flash_Addr[0]  ==  0xFF  &&  Flash_Addr[1]  ==  0xFF  &&    
  • 20.   20            Flash_Addr[2]  ==  0xFF  &&  Flash_Addr[3]  ==  0xFF  )        {          createRandomAddress();  //  set  Random  device  address  at  initial  startup      }      lAddr.addr[0]  =  Flash_Addr[0];      lAddr.addr[1]  =  Flash_Addr[1];      lAddr.addr[2]  =  Flash_Addr[2];      lAddr.addr[3]  =  Flash_Addr[3];      SMPL_Ioctl(IOCTL_OBJ_ADDR,  IOCTL_ACT_SET,  &lAddr);        /*  Keep  trying  to  join  (a  side  effect  of  successful  initialization)  until  successful  .   Toggle  LEDS  to  indicate  that  joining  has  not  occurred*/        while  (SMPL_SUCCESS  !=  SMPL_Init(0))      {          toggleLED(1);          toggleLED(2);          SPIN_ABOUT_A_SECOND;      }        /*  LEDs  on  solid  to  indicate  successful  join.  */        if  (!BSP_LED2_IS_ON())      {          toggleLED(2);      }      if  (!BSP_LED1_IS_ON())      {          toggleLED(1);      }      BCSCTL3  |=  LFXT1S_2;                                            //  LFXT1  =  VLO      TACCTL0  =  CCIE;                                                      //  TACCR0  interrupt  enabled      TACCR0  =  12000;                                                      //  ~  1  sec      TACTL  =  TASSEL_1  +  MC_1;                                    //  ACLK,  upmode                /*  Unconditional  link  to  AP  which  is  listening  due  to  successful  join.*/      linkTo();      while  (1)  ;   }   static  void  linkTo()  
  • 21.   21   {      uint8_t          msg[3];      uint8_t          misses,  done;      /*  Keep  trying  to  link...  */      while  (SMPL_SUCCESS  !=  SMPL_Link(&sLinkID1))      {          toggleLED(1);          toggleLED(2);          SPIN_ABOUT_A_SECOND;      }      /*  Turn  off  LEDs.  */      if  (BSP_LED2_IS_ON())      {          toggleLED(2);      }      if  (BSP_LED1_IS_ON())      {          toggleLED(1);      }      SMPL_Ioctl(  IOCTL_OBJ_RADIO,  IOCTL_ACT_RADIO_SLEEP,  0);      while  (1)      {              __bis_SR_register(LPM3_bits+GIE);    //  LPM3  with  interrupts  enabled                  if  (sSelfMeasureSem)  {              volatile  long  temp;              int  degC,  volt;              int  results[2];                          uint8_t            noAck;              smplStatus_t  rc;                /*  get  radio  ready...awakens  in  idle  state  */                SMPL_Ioctl(  IOCTL_OBJ_RADIO,  IOCTL_ACT_RADIO_AWAKE,  0);                                        ADC10CTL1  =  INCH_10  +  ADC10DIV_4;              //  Temp  Sensor  ADC10CLK/5              ADC10CTL0  =  SREF_1  +  ADC10SHT_3  +  REFON  +  ADC10ON  +  ADC10IE  +  ADC10SR;              for(  degC  =  240;  degC  >  0;  degC-­‐-­‐  );        //  delay  to  allow  reference  to  settle              ADC10CTL0  |=  ENC  +  ADC10SC;                          //  Sampling  and  conversion  start              __bis_SR_register(CPUOFF  +  GIE);                //  LPM0  with  interrupts  enabled  
  • 22.   22              results[0]  =  ADC10MEM;                      ADC10CTL0  &=  ~ENC;                      ADC10CTL1  =  INCH_11;                                          //  AVcc/2              ADC10CTL0  =  SREF_1  +  ADC10SHT_2  +  REFON  +  ADC10ON  +  ADC10IE  +  REF2_5V;              for(  degC  =  240;  degC  >  0;  degC-­‐-­‐  );        //  delay  to  allow  reference  to  settle              ADC10CTL0  |=  ENC  +  ADC10SC;                          //  Sampling  and  conversion  start              __bis_SR_register(CPUOFF  +  GIE);                //  LPM0  with  interrupts  enabled              results[1]  =  ADC10MEM;              ADC10CTL0  &=  ~ENC;              ADC10CTL0  &=  ~(REFON  +  ADC10ON);                //  turn  off  A/D  to  save  power                        //  oC  =  ((A10/1024)*1500mV)-­‐986mV)*1/3.55mV  =  A10*423/1024  -­‐  278              //  the  temperature  is  transmitted  as  an  integer  where  32.1  =  321              //  hence  4230  instead  of  423              temp  =  results[0];              degC  =  ((temp  -­‐  673)  *  4230)  /  1024;              if(  (*tempOffset)  !=  0xFFFF  )              {                  degC  +=  (*tempOffset);                }              /*  message  format,    UB  =  upper  Byte,  LB  =  lower  Byte              -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐              |degC  LB  |  degC  UB  |    volt  LB  |              -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐                    0                  1                    2              */                        temp  =  results[1];              volt  =  (temp*25)/512;              msg[0]  =  degC&0xFF;              msg[1]  =  (degC>>8)&0xFF;              msg[2]  =  volt;                            done  =  0;              while  (!done)              {                  noAck  =  0;                  /*  Try  sending  message  MISSES_IN_A_ROW  times  looking  for  ack  */                  for  (misses=0;  misses  <  MISSES_IN_A_ROW;  ++misses)                  {  
  • 23.   23                      if  (SMPL_SUCCESS  ==  (rc=SMPL_SendOpt(sLinkID1,  msg,  sizeof(msg),   SMPL_TXOPTION_ACKREQ)))                      {     /*  Message  acked.  We're  done.  Toggle  LED  1  to  indicate  ack  received.  */                            toggleLED(1);    //  Toggle  On  LED1                          __delay_cycles(2000);                          toggleLED(1);                          break;                      }                      if  (SMPL_NO_ACK  ==  rc)                      {     /*  Count  ack  failures.  Could  also  fail  because  of  CCA  and  we  don't  want  to  scan  in  this   case.    */                          noAck++;                      }                  }                  if  (MISSES_IN_A_ROW  ==  noAck)                  {                      /*  Message  not  acked.  Toggle  LED  2.  */                      toggleLED(2);    //  Turn  On  LED2                      __delay_cycles(2000);                      toggleLED(2);     #ifdef  FREQUENCY_AGILITY     /*  Assume  we're  on  the  wrong  channel  so  look  for  channel  by  using  the  Ping  to  initiate   a  scan  when  it  gets  no  reply.  With  a  successful  ping  try  sending  the  message  again.   Otherwise,    for  any  error  we  get  we  will  wait  until  the  next  button  press  to  try  again.   */                      if  (SMPL_SUCCESS  !=  SMPL_Ping(sLinkID1))                      {                          done  =  1;                      }   #else                      done  =  1;   #endif    /*  FREQUENCY_AGILITY  */                  }                  else  
  • 24.   24                  {                      /*  Got  the  ack  or  we  don't  care.  We're  done.  */                      done  =  1;                  }              }      /*  radio  back  to  sleep  */                SMPL_Ioctl(  IOCTL_OBJ_RADIO,  IOCTL_ACT_RADIO_SLEEP,  0);          }      }   }   void  toggleLED(uint8_t  which)   {      if  (1  ==  which)      {          BSP_TOGGLE_LED1();      }      else  if  (2  ==  which)      {          BSP_TOGGLE_LED2();      }      return;   }   void  createRandomAddress()   {      unsigned  int  rand,  rand2;      do      {          rand  =  TI_getRandomIntegerFromVLO();        //  first  byte  can  not  be  0x00  of  0xFF      }      while(  (rand  &  0xFF00)==0xFF00  ||  (rand  &  0xFF00)==0x0000  );      rand2  =  TI_getRandomIntegerFromVLO();            BCSCTL1  =  CALBC1_1MHZ;                                        //  Set  DCO  to  1MHz      DCOCTL  =  CALDCO_1MHZ;      FCTL2  =  FWKEY  +  FSSEL0  +  FN1;                          //  MCLK/3  for  Flash  Timing  Generator      FCTL3  =  FWKEY  +  LOCKA;                                        //  Clear  LOCK  &  LOCKA  bits      FCTL1  =  FWKEY  +  WRT;                                            //  Set  WRT  bit  for  write  operation            Flash_Addr[0]=(rand>>8)  &  0xFF;  
  • 25.   25      Flash_Addr[1]=rand  &  0xFF;      Flash_Addr[2]=(rand2>>8)  &  0xFF;        Flash_Addr[3]=rand2  &  0xFF;              #pragma  vector=ADC10_VECTOR   __interrupt  void  ADC10_ISR(void)   {      __bic_SR_register_on_exit(CPUOFF);                //  Clear  CPUOFF  bit  from  0(SR)   }     /*  Timer  A0  interrupt  service  routine*/     #pragma  vector=TIMERA0_VECTOR   __interrupt  void  Timer_A  (void)   {      sSelfMeasureSem  =  1;          __bic_SR_register_on_exit(LPM3_bits);                //  Clear  LPM3  bit  from  0(SR)     }   Compiling and Loading the End Device code- The  process  for  building  the  executable  for  the  End  Device  is  identical  to  the  process   for  the  Access  Point,  the  only  difference  being  that  you  start  by  selecting  the  “End   Device”  tab.          
  • 26.   26   All  of  the  other  steps  are  identical,  except  we  need  to  plug  a  different  little  circuit   board  into  the  USB  stick  before  doing  the  programming  step,  otherwise  we  will  just   end  up  reprogramming  the  Access  Point.  In  other  words,  we  will  need  to  open  up   the  USB  stick  and  remove  the  AP  circuit  board  and  then  attach  the  ED  circuit   board  to  the  USB  programmer.           Temperature  Sensors  Monitoring  Portal-­‐          eZ430-­‐RF2500  is  preloaded  with  a  wireless  temperature  sensor  network  firmware   and  can  be  re-­‐programmed  at  any  time.  This  network  consists  of  an  Access  Point   that  measures  its  own  temperature  and  also  wirelessly  receives  temperature   measurements  from  End  Devices.      End  Devices  measure  their  temperature  once  per  second  and  then  enter  a  low-­‐ power  mode  to  reduce  battery  usage.  The  Access  Point  transmits  all  measured   data  to  the  PC  through  the  UART  backchannel.  The  included  PC  Sensor  Monitor   Visualizer  provides  a  demonstration  of  the  eZ430-­‐RF2500  using  the  Simplicity   protocol  across  a  star  network.  In  the  PC  Sensor  Monitor  Visualizer,  the  center   node  is  the  Access  Point  and  the  attached  bubbles  are  the  End  Devices.  
  • 27.   27          The  PC  application  displays  the  temperature  of  both  the  End  Devices  and  Access   Point.  Additionally,  the  PC  application  is  capable  of  simulating  distance  from  its   access  point  when  the  End  Devices  are  moved  .The  number  of  End  Devices  can  be   expanded  by  adding  more  target  boards  in  the  star  network.                    
  • 28.   28   Wireless  sensor  Network  Diagram-­‐                        
  • 29.   29   Data  Acquisition  system  for  wireless  sensor-­‐     For  data  acquisitions  we  used  real  term  application  .The  real  term  is  a  terminal  program   specially  designed  for  capturing,  controlling  and  debugging  binary  and  other  difficult   data  streams.  It  is  far  better  for  debugging  commas  than  Hyper-­‐terminal.  It  has  no   support  for  dialing  modems.            
  • 30.   30   Process  to  configure  Real  Term  application-­‐     1. Disconnect  all  of  the  ED’s  from  their  battery  packs  so  that  only  the  AP  is  left   active.   2. Close  the  Sensor  Monitor  window.   3. The  AP  looks  like  a  simple  serial  port  device  to  your  computer.  Every  time  it   blinks,  the  AP  is  actually  attempting  to  send  data  to  your  PC.     4. Start  up  Real-­‐term,  which  is  a  terminal  emulator  program  select  the  Port  tab,  then   the  Port  dropdown  menu,  and  select  the  highest  numbered  serial  port  you  see   5. Now  open  the  port  by  clicking  on  the  “Open”  button  twice.  You  should  see  a  new   line  of  data  appearing  every  second  or  so.      
  • 31.   31   Representation  of  Sensors  data-­‐   In  Real  term  serial  capture  program  Every  line  of  data  represents  the  measurements   made  by  the  AP  of  its  own  temperature  and  operating  voltage:  $HUB0,  93.2F,3.5,000,N#       This  is  the  temperature  information  the  Sensor  Monitor  program  displaying  in  the   image.  If  we  power  up  one  of  the  End  devices  we  can  see  data  appearing  in  the  terminal   program  window  at  about  twice  the  rate  as  before.  This  is  because  the  Access  point  is   now  receiving  data  from  the  End  devices  every  second  or  so,  and  it  forwards  this  to  the   PC  in  addition  to  its  own  information.   Power  up  several  more  End  devices  and  see  what  changes  in  the  terminal  window.   The  third  number  in  the  lines  from  the  ED  (057  or  058  in  the  image  above)  is  the   signal  strength  of  the  End  devices  radio  transmission  as  measured  by  the  Access  point.      
  • 32.   32   Customized  program  for  Data  Acquisition  (End  Device)  –            *  BEGHDR   *  NAME:                void  transmit_time_delay(void)   *  DESCRIPTION:  Sets  timer  to  transmit  time  based  on  timer_state   *  INPUTS:            void   *  PROCESSING:    Sets  timer  to  transmit  time,  for  2  min  and  4  min  transmit  times   *                            loop  number  of  30  sec  times  to  make  2  min  and  4  min.   *  OUTPUTS:          void   **************************************************************   void  transmit_time_delay(void)   {      volatile  unsigned  int  i  =  0;      in_delay  =  1;      switch  (timer_state)      {          case  timer_state_1:                                          //  Timer  State  ==  1;  5  Secs              delay(sec5);              in_delay  =  0;              battery_full_timer  +=  sec5;              break;          case  timer_state_2:                                          //  Timer  State  ==  2;  10  Secs              delay(sec10);              in_delay  =  0;              battery_full_timer  +=  sec10;              break;              case  timer_state_3:                                          //  Timer  State  ==  3;  20  Secs              delay(sec20);              in_delay  =  0;              battery_full_timer  +=  sec20;              break;        case  timer_state_4:                                          //  Timer  State  ==  4;  40  Secs              delay(sec40);              in_delay  =  0;  
  • 33.   33              battery_full_timer  +=  sec40;              break;              case  timer_state_5:                                          //  Timer  State  ==  5;  2  mins              while((i++  <  4)  &&  (timer_state  ==  timer_state_5))              {                  delay(sec30_2);                  in_delay  =  0;                  battery_full_timer  +=  sec30_2;              }              break;              case  timer_state_6:                                          //  Timer  State  ==  6;  4  mins              while((i++  <  8)  &&  (timer_state  ==  timer_state_6))              {                  delay(sec30_4);                  in_delay  =  0;                  battery_full_timer  +=  sec30_4;              }              break;          default:              break;      }   }//  void  transmit_time_delay(void)         Initial  steps  of  project  based  on  temperature  analyzing  and  monitoring  using  radio   frequency  sensor.  This  range  is  limited  in  particular  area  so,  we  are  looking  forward  for   IP  Address  based  temperature  monitoring  and  wireless  data  acquisition.   This  project  could  play  a  substantial  part  in  reducing  carbon  emission  not  only  for  RIT,   but  for  the  community  in  general.  
  • 34.   34     References-­‐        Carl  Lundgren  Professor   Manufacturing  &  Mech.  Eng.  Tech./Packaging  Science    Antonio  Mondragon,  Ph.D.  Assistant  Professor    http://www.iar.com/en/Products/IAR-­‐Embedded-­‐Workbench/    http://realterm.sourceforge.net/    www.hep.princeton.edu/~marlow/rrs/Guides/Workbench.pdf    http://www.ti.com/tool/ez430-­‐rf2500-­‐seh    http://www.ti.com/tool/EZ430-­‐RF2500T    http://www.arduino.cc/cgi-­‐bin/yabb2/YaBB.pl?num=1289334133    http://en.wikipedia.org/wiki/Wireless_sensor_network