«Carles Gómez Josep Paradells José E. Caballero Edita: Fundación Vodafone España Autores: Carles Gómez Montenegro* Universitat Politècnica de ...»
Clocks are required by the MCU and the radio part. The clock rate used by the MCU is proportional to the processing power obtained, but at the same time affects to the power consumption. Increasing the clock rate results in an increase of processing capacity and power consumption. This represents a dilemma since increasing processing and reducing power consumption are objectives for the sensor node designers. The approach adopted to solve this compromise is to distinguish between active and low power modes and to use different clocks in each state. In active state, a high rate clock allows processing quickly, while in low power state a low rate clock is used. This clock can be provided by the IC itself or by an external clock. The first option offers a bad accuracy so the second one should be used when synchronisation is required. This clock, used in low power mode, usually has a frequency of 32.768 kHz11.
This frequency is used since if applied to a 15 bits counter it reaches the maximum value each second.
184.108.40.206. Operation modes As it has been said previously, MCUs used in sensor nodes have different operation modes, from an active mode, with a fully operational MCU and low power mode. The last mode has also some sub-modes that depend on the manufacturer. The different modes are obtained by switching off different parts of the MCU, such as parts of the RAM memory, timers or interruptions and using different clocks. For example, it is quite common to lose part of the RAM memory content or to keep only one active timer, certain interruptions and input lines. In low power mode it is possible to be in doze, sleep and hibernate. The exact operation sub-modes depend on the manufacturers and the exact MCU model. With all these options, a duty cycle can be implemented whereby the MCU is in low power mode most of the time, and either awakes periodically or when an external event to the MCU is produced. The resulting power consumption result is tens of microAmperes in sleep mode and several milliAmperes when it is fully active.
220.127.116.11. Inputs and outputs
MCU offers some lines to inputs or outputs that can be configured through programming. As these lines can be used for different purposes, they are called General Purpose Input/Output (GPIO). It is even possible to configure them as interruption inputs or as a Direct Memory Access (DMA).
Output signals are limited by the supply voltage, but some of them accept 5-Volt TTL levels as inputs without being damaged.
It is quite common that sensor nodes have several analog to digital converters that can be multiplexed in different channels. One of these channels is devoted to the battery voltage monitoring to anticipate any problem with the power source. The minimum sampling rate is in the range of 20 ms and provides 12 bits per sample, with an effective number of bits from 8 to 9 due to the noise level of the input signal.
Digital to analog conversion is also provided with similar parameters, in terms of response time and precision to the ones encountered in the ADC
18.104.22.168. Serial interfaces Most peripherals that can be connected to a MCU use serial interfaces.
There are simple serial ports such as Universal Asynchronous Receiver/Transmitter (UART) and others that can be multiplexed, such as the Inter-Integrated Circuit (I2C) bus or the Serial Peripheral Interface (SPI) bus.
The I2C bus uses only two bidirectional lines and the ground. One line is for the clock and the other one is for data. Each device has a unique address of 7 bits. As some of the addresses are reserved, it is possible to have one master and up to 112 slaves. The master sends the clock and the address of the slave. It offers transfer rates up to
The SPI bus follows also a master-slave approach. The MCU has the role of a master and the devices connected to it are the slaves. The interface has four lines: one is the serial clock given by the master, two lines are used for full duplex bit transmission and another one is used by the master to select the slave. If several SPI ports are defined, the clock and the transmission lines can be used by all the ports and only an individual selected line is needed (see Fig. 5.1).
MCU has several timers to generate timed events. They are based on a counter that is increased/decreased each clock tick. In some MCUs, timers can be used even in sleep mode to trigger the wake-up of the device.
22.214.171.124. Interruptions Interruptions are notifications such as an input line transition or a timer reaching a certain value, that should be treated immediately as soon as possible the processor stops doing the current task. Interruptions should be a short task that requires a quick response. Interruptions can be used to perform periodic operations (e.g. triggered by a timer) or to treat an event (e.g.
triggered by an input line).
A reset is a basic operation intended to bring the system to a totally known state. It corresponds to an initial state. A reset can be generated by a specific line, which is called a hard reset, or as a result of some special event, which is known as software reset. There is a special timer, known as watchdog timer, which is intended to remove the processor from a blocked state.
If the watchdog timer reaches a limit value, a reset is generated. The application running on the MCU should update the watchdog timer in order to avoid reaching the limit. If the application is blocked, the timer is not updated and a reset is generated for bringing the system to an initial state.
It is also possible to generate a reset if the MCU suspects it has corrupted information. For example, a short decrease in the source voltage may not generate a reset of the system but it may result in an unpredictable alteration of the memory. In this case, if the program continues it can produce incorrect results. To avoid this problem, some MCUs have a facility know as brown-out detector that in case of a voltage decrease can generate auto
matically an MCU reset. This brings the MCU to an initial state avoiding the possible danger of this supply voltage change.
5.1.2. Memory The system requires memory to store programs and variables. Memory can be located inside the MCU and it can also be added externally. The system requires a ROM memory where the basic instructions are loaded. ROM usually stores the interruption handler and a boot loader. In some designs, which provide the transceiver and the processor in the same chip or package, the ROM contains also the communication protocols and an Application Programming Interface (API) to facilitate the access to the network from the programmed applications. In some systems, this memory can be replaced or complemented with a flash or Electrically-Erasable Programmable Read-Only Memory (EEPROM) that allows storing the application program and volatile variables. Working with flash memory is slow and requires significant power when writing data (even the total number of writing operations is limited). The amount of flash memory provided can be up to 256 kB.
Usually, when the system starts, it executes an application called boot loader, that has the code stored at the ROM. This application loads the user programmed code from the flash memory to the RAM memory. Once this is done, the user application is executed from the RAM. The flash memory is not used during the application execution. The amount of RAM memory varies significantly between MCUs. The minimum RAM size that can be found in present systems is 1 kB, and the maximum one is 128 kB. Some manufacturers offer the same basic designs with different amounts of RAM memory.
It is also common to find models with a small memory inside the MCU to store configuration variables such as the node address or a security key.
These variables are not changed when the developer updates the flash memory. This approach is called One Time Programmable (OTP) memory.
External memory, such as flash memory, can be connected and mapped onto the address and data buses, but it is more common to use a serial port.
This option simplifies the PCB layout and reduces the number of pins of the MCU.
5.1.3. Radio transceiver It has been assumed that the sensor node accounts with wireless communication capabilities. Most of the information presented in this chapter holds as well with a wired connection, but a wireless connection is the most common and flexible way of operation for sensor nodes. There are different usable frequency bands, such as the usually known as 433 MHz, 868 MHz, 915 MHz and 2.4 GHz (see chapter 3, section 3.2). With the aim to obtain a small and cheap sensor node, radio transceivers are mostly integrated in an IC. To justify the costs of IC development, the solutions are oriented either towards a standardised solution such as IEEE 802.15.4 or Bluetooth Low Energy, or towards a general purpose ones that can be customised, such as the family of nRF products from Nordic Semiconductor .
126.96.36.199. IEEE 802.15.4 transceivers
At present, the radio interface that is attracting more interest in terms of number of alternatives is the IEEE 802.15.4. Most of the manufacturers focus on the 2.4 GHz band, but there are also products for the 868 MHz, 915 MHz and even the new 780 MHz band, available in China. Manufacturers of IEEE 802.15.4 transceivers are, for example Chipcon, Atmel, Freescale or Radiopulse .
The transceiver implements the radio interface and some functions required by the MAC such as the encryption and the CRC computation. The rest of the MAC functionality, such as ACK generation and the access algorithm are commonly implemented by the MCU, which is controlling the transceiver.
188.8.131.52. General purpose transceivers
There are a number of transceiver chips in the market that are able to implement a specific radio interface. These devices permit to build simple radio interfaces used by proprietary solutions. The low power RF products from Texas Instruments  or the nRF series from Nordic Semiconductors  are good examples. In general, these types of
devices are divided in sub-GHz products (315, 433, 868, 915 MHz bands) and the ones covering the 2.4 GHz band. They offer different modulations (FSK, GFSK, MSK, ASK and OOK) and different channels, in terms of both location in the band and widths. They incorporate common mechanisms such as radio channel sensing, RSSI measure of the received signal, synchronization word detecting, address check, and automatic CRC generation and verification.
The radio transceivers offer maximum transmitted powers from 0 dBm to 20 dBm. It is quite common to use an external power amplifier to reach the high range of the transmitted power. The power consumption is related with the transmitted power, for example, a 0 dBm transmission may require a current of 27 mA, while at 20 dBm the consumption reaches 150 mA. The voltage used varies between 1.8 V and
The antenna is the most important passive element in a wireless sensor node. The key parameters for an antenna design are the frequency of operation and bandwidth, the radiation pattern, the antenna gain and radiation efficiency, the radiation resistance 12 and the antenna size . The antenna gain is an indication of the performance of the antenna radiation compared to an isotropic antenna. The radiation pattern provides information on the transmitted power in each direction in the space. A simple antenna presents regularities that can be used to represent the radiation pattern in one or two planes. For example, the three-dimensional radiation pattern of a dipole antenna can be represented by its corresponding radiation patterns in the vertical plane and in the horizontal plane as shown in Fig. 5.2.
Also it is common to refer to the antenna impedance. The resistance is the part of the impedance that produces radiated power.
The polarisation is also a performance parameter used in the characterization of the antenna and it is recommended that the transmitter and receiver antennas have the same polarisation. However, the polarisation of the radio signal is distorted due to propagation in a multipath environment, due mainly to multiple reflections, like for example an indoor signal propagation scenario. At the receiver, a mixture of the two possible polarisations is received making the polarisation of the receiver antenna not so relevant. In order to maximise the power transfer, and the transmitted power in consequence, the resistance at the emitter and the antenna should be matched.
The antenna size is related to the wavelength of the RF signal transmitted. A size equal to half the wavelength is the optimum one since it offers good radiation and small size. It is possible to reduce this size using different dielectric materials (different from the air) and folding the antenna, but performance may decrease.
184.108.40.206. Dipole based antennas
There are different types of antennas, but most of them are based on the dipole antenna concept. A dipole is a straight piece of wire cut in the centre and fed with a balanced transmission line13. For a 2.4 GHz the half wavelength dipole measures 6 cm and presents a resistance close to 73 Ohms. It is possiA balance line has two conductors, with equal currents in opposite directions, such as a twisted pair cable.
ble to use a monopole antenna that consists in replacing one part of the dipole by an infinite ground plane that ideally mirrors the monopole offering a virtual dipole. This type of antenna reduces the resistance by one half and the antenna becomes unbalanced14, also referred as single-ended antenna. The most common implementation is a whip antenna (see Fig. 5.3) mounted in a metallic structure that acts as a ground plane (the PCB or the metal case).
Resistance may be affected by the changes in the geometry. Some additional modifications can be introduced as in the case of an inverted F-antenna (see Fig. 5.5).
An unbalance line has just one conductor and one ground, such as a coaxial cable.