To efficiently exploit the broadcast feature of wireless channels, a opportunistic routing protocol based on random linear network coding is proposed for wireless sensor networks. The protocol requires each node except for destination in network to transmit the random linear combination created by all packets in buffer, and confirms the expected number of transmissions according to node's credit value which is computed by a heuristic algorithm. This approach can overcome the shortcomings of instability of wireless channel quality, and use long and unreliable radio links which would not be used by traditional protocols. The experiment results show that the proposed protocol presents significant performance improvements, especially in network throughput and end-to-end delay.