In current era Wireless Sensor Networks (WSNs) play a vital part in every field of day to day life. This is one of the most popular network technologies for the Internet of Things (IoT). Power efficiency and stability constraint is considered as impediment in the further development of the IoT. One of the efficient solutions is effective routing techniques. This paper proposes an effective cluster based, threshold sensitive routing technique Shortest Distance On-demand Stable Election Protocol (SDOSEP) for IoT based heterogeneous wireless sensor networks. As data transmission between nodes with different routes is one of the most costly operation that affect the performance of the network. This technique chooses cluster head on the basis of total energy of network and selects shortest weighted path for data transmission. The proposed approach exceeds the network lifetime, stability, instability and throughput of the network with existing baseline techniques.