Title: Sensor Node Architecture
1Sensor Node Architecture
- The sensor nodes are the building blocks of WSNs.
- Each sensor node consists of 6 functional blocks
- CPU - the core of the node
- MEMORY SPACE to store the application program
and data - POWER SUPPLY provides energy for functioning
- RADIO TRANSCEIVER receives/transmits data and
keeps the node connected to the network. - ANTENNA
- SENSOR(s) - to get measurements from the
environment.
2Sensor Node Development
- Over the last 10 years many sensor nodes
platforms developed by companies and research
groups. - Targeted key features
- Increased CPU processing power (e.g. useful for
digital signal processing) - Increased memory size
- Improved radio reliability
- Security (e.g. channel encryption and nodes
authentication) - Dynamic multiple operational modes (e.g.
minimized power consumption in idle mode, but
also possibility of faster and more powerful
computation when needed) - Small dimensions and compact packaging
3Sensor Node Development
Intel Mote
MicaZ
Mica2
XYZ Node
4Sensinode Architecture
BUS CONNECTOR
LEDs
EXTERNAL CONNECTOR
CLOCK
CPU
FLASH
RADIO
ANTENNA
5Sensinode Architecture
- CPU MSP430F1611 by Texas Instruments
- Ultra-low power consumption 330 mA at 1 MHz
stand-by 1.1 mA - 16-bit RISC (Reduced Instruction Set Computer)
architecture - RISC small and highly-optimized set of
instructions - 16 bit Arithmetic Logic Unit (ALU) for shift,
swap, operations, bit manipulation and bit test
operations in a single cycle - 16 integrated registers for reduced instruction
execution time (register-to-register operation
time 1 cycle) - 1 active mode 5 software selectable low-power
modes of operation - Interrupt event to wake up the CPU from a
low-power mode ? interrupt service program ?
restore the low power mode - Difference clocks active/disabled, crystal
oscillator going/stopped - Integrated 10 kB RAM 256 kB FLASH memory
- 12 bit A/D converter
6CPU Registers
- Program counter
- indicates where the computer is in its
instruction sequence (address of the next
instruction to be executed). It is automatically
incremented at each instruction cycle ( ?
instructions retrieved sequentially from memory).
Certain instructions, such as branches and
subroutine calls and returns, interrupt this
sequence by placing a new value in the program
counter. - Stack pointer
- points to the most recently referenced location
on the stack when the stack has a size of zero,
the stack pointer points to the origin of the
stack - Status register
- collection of flag bits (e.g. zero, parity,
overflow, negative) - Constant generator
- provides access to 6 commonly used constant
values without requiring an additional operand
Program Counter
Stack Pointer
Status Register
Constant Generator
General-Purpose Register 1
General-Purpose Register 2
General-Purpose Register 12
712-bit A/D Converter
- 12 bit A/D CONVERTER
- Normally, 2 B needed to store a sample (4 bit
unused)
X X X X 0 1 1 0
1 0 1 1 0 1 1 1
- 1 B can be enough (application-dependent)
- One must chose which bits bring more information
- 8 most significant
- ? Works well for large scale variations
- ? Lost of resolution in small scale variations
- 8 least significant
- ? High resolution in small scale variations
- ? Saturation problem
8Sensinode Architecture
- MEMORY
- 10 kB RAM 256 kB FLASH memory integrated in the
CPU - RAM (Random Access Memory)
- Stored data can be accessed in any order ? any
piece of data can be accessed in a constant time,
regardless of its physical location and whether
or not it is related to the previous accessed
piece of data - Volatile memory (no power ? information lost)
- FLASH
- Used to store the executable files of the
application - Slower data access speed than RAM
- High resistance to extreme conditions
(temperature, pressure) and to kinetic shocks ?
suitable for embedded devices - Non-volatile memory (no power ? information kept)
- 4 Mb ( 500 kB) external serial FLASH
- Can be used to store measurements data
- Sequential data access
- Sector writing (up to 256 B) in 1.5 ms, sector
erase (512 Kb) in 2 s, total erase (4 Mb) in 5 s.
9Serial FLASH Operations vs. Power Consumption
power consumption
Writing
Reading
Access
time
10Block-wise Serial FLASH Writing
The peaks of power consumption caused by
block-writings in the FLASH memory are observable
also in the collected samples as periodic noise
11Sensinode Architecture
- RADIO CC2420 RF transceiver by Texas Instruments
- ZigBee radio, based on the IEEE 802.15.4 standard
for low-rate wireless personal area networks
(LR-WPANs) - Compared to Bluetooth, simpler software and 50
power consumption - Frequency range 2400 2483.5 MHz
- Data rate 250 kbps (theoretical!)
- Modulation DSSS (Direct Sequence Spread
Spectrum) and 0-QPSK with half sine pulse shaping - Current consumption RX 18.8 mA, TX 17.4 mA
- Approximately 4 ms setup time in ON/OFF switching
- 128 B FIFO receive and transmit buffers
- Header takes about 40 B ? payload ? 80 B
- Digital RSSI (Radio Signal Strength Indicator)
- 802.15.4 MAC security
- Encryption process of transforming the
information using an algorithm to make it
unreadable to anyone except those possessing the
key - Authentication confirms that the packet comes
from an authorized node
12Sensinode Architecture
External Connector used to connect sensors to
the sensor node
Pin1-2
Pin1-2
Top view
Side view
13Starting an Application
- main() function in main.c performs the
initializations - int main (void)
-
- LED_INIT() / Initializes the leds /
- if (bus_init() pdFALSE)
- debug_init(115200) / Initializes the debug
window / - stack_init() / Initializes NanoStack /
- / Creates the tasks/
- xTaskCreate(My_Task,MY_TASK",256,NULL,(tskIDLE_P
RIORITY1),NULL) - vTaskStartScheduler() / Starts the scheduler
/ - return 0
14Application Task
- The execution continues in the created task (or
in the task with the highest priority, if
multiple tasks were created) - The application task runs in an endless for loop
- When the task is sleeping, the scheduler can
handle other tasks - Sleeping occurs when blocking on a queue or
semaphore, or by calling vTaskDelay() or
vTaskDelayUntil()
15NanoStack Radio Communications
- NanoStack radio communications are specified in
socket.c - buffer.h needed to handle the content of the
transmitted packets - socket_t Radio_Socket 0 / Socket declaration
/ - buffer_t Packet_Buffer / Buffer declaration /
- define MY_PORT 10 / Ports definition /
- / Address declaration /
- sockaddr_t BroadcastAdd
- ADDR_802_15_4_PAN_LONG / Address type /,
- 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF , /
Destination address / - MY_PORT / Destination port /
- RT_Socket socket(MODULE_CUDP,0) / Socket
creation / - socket_bind(Radio_Socket, BroadcastAdd) /
Socket bind /
16NanoStack Radio Communications
- Packet_Buffer socket_buffer_get(Radio_Socket)
/ Allocate a buffer to the socket / - socket_sendto(Radio_Socket,BroadcastAdd,Packet_Bu
ffer) / Packet transmission / - Receive_Buffer socket_read(Radio_Socket,2000)
/ Packet reception / -
- Once received data are handled, buffer must be
freed - socket_buffer_free(Receive_Buffer) / Free the
buffer / - Receive_Buffer 0 / Set the pointer to 0 /
17NanoStack Radio Communications
- Other useful radio functions
- rf_power_set (new_power) / Set transmitting
power ( 0,100) / - rf_channel_set (channel) / Set the radio
channel (11,26) / - rf_rx_disable () / Turn off the radio /
- rf_rx_enable () / Turn on the radio /
- rf_set_address (address) / Set MAC address of
the node / - rf_analyze_rssi () / Get the RSSI (in dBm) /