Our modern world is involved with technology and internet more than any time. Internet of things has been invented for the comfort of humans. Smart grid is one of the most highlighted aspects of internet of things. Routing of these networks is a significant point and the aim in this article is to find an algorithm which is based on internet of things routing and it may reduce the path between source and destination to decrease power consumption of nodes. In this paper, we introduce an algorithm which find out the shortest path between source and destination. It notices number of hop and packet delivery rate that each node pass. This shortest path presents packets transfer from source to destination in a way which use the least amount of remaining energy of sensor batteries. This cause to reduce the energy consumption and helps to increase network’s life time. Moreover, we improve the effect of number of hops between source to destination to 33% in minimum and average and also 34% for maximum case. Furthermore, by considering the effect of send and receive between middle nodes minimum state became 17%, average about 41% and maximum case became 42%.
