The Internet of Things (IoT) concept increases the spectrum demands of mobile users in wireless communications because of the intensive and heterogeneous structure of IoT. Various devices are joining IoT networks every day, and spectrum scarcity may be a crucial issue for IoT environments in the near future. Cognitive radio (CR) is capable of sensing and detecting spectrum holes. With the aim of CR, more powerful IoT devices will be constructed in such crowded wireless environments. Also, dynamic and ad-hoc CR networks have not a fixed base station. Therefore, CR capable IoT (CR-based IoT) device approach with routing capabilities will be a solution for future IoT environments. In this study, spectrum aware Ad hoc on-demand distance vector routing protocol is proposed for CR-based IoT devices in IoT environments. For the performance analysis of the proposed method, various network scenarios with different idle probability have been performed and throughput and delay results for different offered loads have been analyzed.