The pervasive growth of Internet of Things (IoT) gadgets has exacerbated vulnerability of the network in that it necessitates real-time intrusion detection systems (IDS) that can function under rigid limits of computation. The standard methods of deep learning cannot be used in edge devices with limited resources, yet they are still accurate. In this paper, it is suggested that a lightweight ensemble machine learning model can be applied to the efficient intrusion detection of IoT devices by combining the Logistic Regression, the Random Forest, and the Gradient Boosting model with adaptive weight optimization. The feature selection based on mutual information is used to trim the set of features to 15 items and still achieve 98.3 percent of discriminative power to allow sub-10 milliseconds inferences. The framework assessed on NSL-KDD and TON IoT datasets can label the data with a 97.8% accuracy, a decrease in false positive by 26 percent and a generalization improvement of 1.4 percent. Training on regular CPUs only takes less than three minutes and thus can be deployed quickly and can be updated rapidly on edge gateways. These findings illustrate the possibility of scalable, energy efficient, and real time cybersecurity of IoT networks using the framework.