Energy conservation is one of the most critical problems in Internet of Things (IoT). It can be achieved in several ways, one of which is to select the optimal route for data transfer. IPv6 Routing Protocol for Low Power and Lossy Networks (RPL) is a standardized routing protocol for IoT. The RPL changes its path frequently while transmitting the data from source to the destination, due to high data traffic in dense networks. Hence, it creates data traffic across the nodes in the networks. To solve this issue, we propose Energy and Delay Aware Data aggregation in Routing Protocol (EDADA-RPL) for IoT. It has two processes, namely parent selection and data aggregation. The process of parent selection uses routing metric residual energy (RER) to choose the best possible parent for data transmission. The data aggregation process uses the compressed sensing (CS) theory in the parent node to combine data packets from the child nodes. Finally, the aggregated data transmits from a downward parent to the sink. The sink node collects all the aggregated data and it performs the reconstruction operation to get the original data of the participant node. The simulation is carried out using the Contiki COOJA simulator. EDADA-RPL’s performance is compared to RPL and LA-RPL. The EDADA-RPL offers good performance in terms of network lifetime, delay, and packet delivery ratio.