Wireless Sensor Network (WSN) is an evolving technology enabled by improve- ments in technology. A WSN is a wireless network of nodes that are small in size, and poses challenges like limited power supply and processing power, and lossy radio links. These networks are often used to collect data from sensors at mul- tiple locations. In order to increase lifetime these devices must minimize power consumption. The lossy links between poses challenges that normal computer net- work routing protocols does not solve very well. IPv6 Routing Protocol for Low- Power and Lossy Networks (RPL) is a routing protocol designed specifically for WSN, and is made for communication flows that are normal in WSNs. RPL uses an Objective Function (OF) in order to optimize routes, which enables different optimization objectives.In this thesis a WSN using RPL is implemented and deployed. RPL specifies the use of an OF, which uses metrics in order to fulfill its optimization goals. This thesis implements RPL in TinyOS, an operating system designed specifically for embedded systems like WSNs. This implementation proposes to use LQI, an link quality indicator for 802.15.4 radios which are often used in WSNs, as an initial value to the Estimated Transmission Count (ETX). The initial is an improvement on other implementation using ETX in that it passively estimates an ETX for all nodes. Nodes thus have an indication as to how good the link towards nodes that have not been tested is. This estimation can also be kept up to date for possible parents that are not actively tested. My test shows that proper calculation from LQI to ETX is very important for this to provide good results.The resulting implementation is used in a deployed network consisting of 13 nodes that measure temperature and humidity in the church in Laksevåg. The tested values for the LQI to ETX conversion was made very conservative in order to minimize loss. This resulted in routes where the hop count was very high, compared to routes that were selected with a different calculation, which showed shorter routes in terms of hop, while still providing a high delivery ratio. The LQI to ETX values need to be set correctly in order to provide the wanted routes. This is left for future work.