The spectrum sensing is a major significant task in cognitive radio networks (CRNs) to avoid the unacceptable interference to primary users (PUs). Here, the threshold value determines the effectiveness of spectrum sensing and regarded as a sensing system. The fixed threshold used by the current energy detection‐based spectrum sensing (SS) techniques does not provide sufficient safety for the main users. The threshold is determined by lowering the complete probability of decision error in addition to these guidelines. Therefore, an energy detection using nonparametric amplitude quantization optimized with arithmetic optimization algorithm for enhanced spectrum sensing in CRNs (ED‐NAQ‐AOA‐SS CRN) is proposed in this paper to acquire the ideal threshold for decreasing the total error probability. The proposed method achieves greater probability of detection of 99.67%, 98.38%, 92.34%, and 97.45%, lower settling time of 98.33%, 89.34%, 83.12%, and 88.96%, and lower error rate of 93.15%, 91.25%, 79.90%, and 92.88% compared with existing techniques, like intelligent spectrum sharing and sensing in CRN with adaptive rider optimization algorithm (AROA), a novel technique for spectrum sensing in CRN utilizing fractional gray wolf optimization with the cuckoo search optimization (GWOCS), and adaptive neuro‐fuzzy inference scheme depending on cooperative spectrum sensing optimization in CRNs (ANFIS).