A wireless sensor network (WSN) has achieved significant importance in tracking different physical or environmental conditions using wireless sensor nodes. Such types of networks are used in various applications including smart cities, smart building, military target tracking and surveillance, natural disaster relief, and smart homes. However, the limited power capacity of sensor nodes is considered a major issue that hampers the performance of a WSN. A plethora of research has been conducted to reduce the energy consumption of sensor nodes in traditional WSN, however the limited functional capability of such networks is the main constraint in designing sophisticated and dynamic solutions. Given this, software defined networking (SDN) has revolutionized traditional networks by providing a programmable and flexible framework. Therefore, SDN concepts can be utilized in designing energy-efficient WSN solutions. In this paper, we exploit SDN capabilities to conserve energy consumption in a traditional WSN. To achieve this, an energy-aware multihop routing protocol (named EASDN) is proposed for software defined wireless sensor network (SDWSN). The proposed protocol is evaluated in a real environment. For this purpose, a test bed is developed using Raspberry Pi. The experimental results show that the proposed algorithm exhibits promising results in terms of network lifetime, average energy consumption, the packet delivery ratio, and average delay in comparison to an existing energy efficient routing protocol for SDWSN and a traditional source routing algorithm.