The idea of the Internet of Things (IoT) was developed to im- prove people’s lives by providing diversity range of intercon- nected smart devices and applications in several areas. However, ensuring security in IoT environments remains a critical challenge, primarily due to the various security threats that devices face. While several approaches have been proposed to secure IoT devices, there is always room for improvement. One promising avenue is leveraging machine learning, which has shown its ability to identify patterns even in situations where traditional methods fail. Deep learning, in particular, offers an advanced approach to enhancing IoT security. One transparent option for anomaly-based detection is the utilization of deep learning techniques. This article introduces several approaches based on Recurrent Neural Networks (RNNs) using Long Short-Term Memory (LSTM), Autoencoders, and Multilayer Perceptrons. By harnessing the power of IoT, these anomaly-based Intrusion Detection Systems (IDS) offer the capability to effectively analyze all traffic flowing through the IoT network. The proposed model exhibits the ability to detect any potential intrusions or abnormal traffic behavior. To validate its effectiveness, the model is trained and tested using the NSL-KDD datasets, achieving an impressive accuracy of 97.85