## 3 Design of a Wireless Sensor Network for a Power Quality Monitoring System
### Design of Data Forwarding Protocol  
Since not every transformer is placed within the communication range of the monitoring center, data cannot be sent directly. Instead, it has to hop its way towards the monitoring center using other transformers as intermediate hops. In EDS, all pole transformers can be data sources, while the monitoring center alone is a data sink. In addition, the network topology in EDS is stationary. We design the data forwarding protocol for the collection subsystem. Since multi-hop and many-to-one nature of data flows, we come up with a new tree-based data forwarding protocol for delivery of the power quality information from each pole transformer (hereafter, we will use the term 'node') to a monitoring center. One of cost factors in constructing the least cost path from a node to the substation is the number of hops between the node and the substation. At the network initialization stage, the substation floods a PROBE message over the entire network so that each node in the network can infer the minimum number of hops from the substation to itself. Thereafter, the substation floods a PROBE message periodically so that nodes can update their hop distance from the substation. The path cost is used in constructing the tree branch between the substation and one node. The substation starts the tree construction procedure by sending a PROBE message to its neighboring nodes via one-hop flooding. In the PROBE message, the path cost from the substation to the node having sent the message is recorded. When a node receives a PROBE message, it compares  
\begin{table} \begin{tabular}{|c|c|c|c|c|} \hline Item & ID & Temp & Hz & V\({}_{\text{RMS}}\) \\ Byte & 2 & 1 & 1 & 2 \\ \hline Item & I\({}_{\text{RMS}}\) & V\({}_{\text{DC}}\) & I\({}_{\text{DC}}\) & PF \\ Byte & 2 & 2 & 2 & 1 \\ \hline Item & V\({}_{\text{THD}}\) & I\({}_{\text{THD}}\) & V\({}_{\text{CF}}\) & I\({}_{\text{CF}}\) \\ Byte & 1 & 1 & 1 & 1 \\ \hline Item & V\({}_{\text{HF}}\)Noise & I\({}_{\text{HF}}\)Noise & Event TY & Event TM \\ Byte & 1 & 1 & 1 & 2 \\ \hline Item & Event VAL & \multicolumn{2}{c|}{HAR 0-21} & SPR \\ Byte & 2 & 22 & 4 \\ \hline \end{tabular}   
* ID: identifier of a pole transformer PF: power factor Temp: the temperature of a pole transformer Hz: frequency V\({}_{\text{RMS}}\): RMS value of voltage I\({}_{\text{RMS}}\): RMS value of current V\({}_{\text{DC}}\): DC offset voltage I\({}_{\text{DC}}\): dc offset current V\({}_{\text{THD}}\): voltage total harmonic distortion I\({}_{\text{THD}}\): current total harmonic distortion V\({}_{\text{CF}}\): voltage crest factor I\({}_{\text{CF}}\): current crest factor V\({}_{\text{HF}}\)Noise: voltage high frequency noise I\({}_{\text{HF}}\)Noise: current high frequency noise Event TY: event type Event TM:  
the path cost stored in the message with its path cost. If the path cost maintained locally at the node is less than that in the PROBE message, the node ignores the message. Otherwise, the node updates its path cost and configures the node having sent the PROBE message as its parent node. Once the node newly determines its parent node, it sends a PROBE message with updated path cost to its neighboring nodes via the one-hop flooding. This process continues until the node which has no child node receives a PROBE message. Each node on the tree maintains the soft states on its parent node and child nodes in its forwarding table. A node periodically sends a HELLO message including its parent node ID to its neighboring node as its heartbeat. When a node receives a HELLO message, it checks whether the sender of the message is one of the parent node and child nodes. If it is, the node having received the message updates the soft state on the node having sent. Otherwise, if the node having received the HELLO message is the parent node of the node having sent, it adds the node having sent to a list of its child nodes. Figure 5: Tree construction procedure.