• No results found

Synchronization in flat mesh topology

6 IMPLEMENTATIONS

6.3 Software development

6.3.3 Synchronization in flat mesh topology

In a flat mesh wireless network, all nodes can function as routers and they must be able to receive message frames from a random node in the neighbourhood. However, it takes a lot of power to be in the receive state, and the battery powered node cannot be in the receive state all the time. The alternation of a long low-power sleep state and a short high-power receiving/transmitting state is carried out by common synchronization. The synchronization and optimization of the duty cycle are the most accurate functions in wireless communication and this determines the lifetime of the battery-powered wireless nodes. Synchronization must be hardware-based to function properly. At Seinäjoki University of Applied Sciences, the nRF24L01 transceiver chip was used, which is smart enough and simple to use. Time-critical optimization uses the device-dependent functions of the nRF24L01 transceiver and the ATtiny84 controller.

There are many ways to synchronize different size networks. In advanced wireless networks such as TUTWSN, the network is divided into clusters and the cluster head node controls the synchronization of the cluster. The cluster head must be synchronized with other cluster heads as well as communicate with them and this takes more power. Therefore, the role of the cluster head is taken in turns inside

the cluster, and thus the power consumption is balanced (Hämäläinen & Hännikäinen, 2007).

In the ZigBee standard, the synchronization problem is solved by using higher power FFD (Full Function Device) nodes to control the synchronization of low- power RFD (Reduced Function Device) nodes. The RFD nodes cannot communicate with each other and cannot function as routers.

If you wanted to have global synchronization in a large wireless network, it is almost impossible to have the same synchronic time on different sides of the network. Although synchronization is needed between neighbours with sufficient accuracy, global synchronization can creep on different sides of the network. Another problem is the source of synchronization time. This can be solved by time priority based on the ID-code. For example, the time counter value of one single node is replaced by the time value of a node having a lower ID-number; the time values of nodes with higher ID-numbers are rejected.

To get results in synchronization, the possibilities of the transceiver and controller chips were tested first. A 32.768 kHz clock crystal was used to have an accurate and ultra-low-power time counter in the controller. The interface between the controller and transceiver is based on a SPI (Serial Peripheral Interface), so the data rate is also quite low. The active RF period must be very short, so it cannot include SPI data transfer of the message payload. The transceiver has a FIFO (First In First Out) buffer for three messages when receiving data, so the active period includes only three windows for communicating. However, the number of possible neighbours can be a lot more,. Therefore, five active periods in a round robin sequence was chosen to communicate with a maximum of 15 neighbours. The communication of one active period includes the following phases:

x Ultra low-power standby period when only the time counter functions. x The time counter awakes the controller to initiate a time for the transmit

phase, based on the tour number if it fits this active period. The software executes a low speed and low power routine to load the transmitted payload into the transceiver buffer.

x The high-power receiving state starts, including three windows to accept received messages.

x If transmit time matches, the transceiver is activated to send the message, and then it turns again into the receiving state.

x If messages are received, they stay in the FIFO buffer in the transceiver without software operations.

x After the time of three message windows, the high-power receiving state of the transceiver is turned into the power-down state.

x The controller loads possible received messages.

x The controller updates the time counter based on synchronization rules and checks its tour number.

x The controller executes the application software, for example positioning. x The controller goes into the ultra-low-power state.

The power consumption of a single active period is presented in Figure 35. With this method, it is possible that two neighbours have the same tour number and they do not receive any messages from each other. The method is corrected by a randomly based silent period when it is time to transmit a message. During the silent period, the node with the same tour number has a possibility to transmit its message. So the tour number conflict is detected and the tour number can be redefined.

Figure 35. Power consumption of a single active period

In a high-density network, the number of neighbours can be more than 15, but this can be decreased by decreasing the transmitter power of the radio transceiver, and thus the range is reduced. This result complicates the positioning, because the ranges in the calculations cannot be fixed as suggested above. In distance measuring, the multi-hops must be replaced by cumulative range distance.

Related documents