Indoor air pollution has been an important health problem in the modern world. Prolonged exposure to indoor air pollutants causes adverse effects on human health. This paper presents the design and development of a low-cost Internet of Things (IoT)-based real-time indoor air quality monitoring and alerting system using ESP32 microcontroller. The designed device utilizes the SEN54 sensor from Sensirion to measure particulate matter (PM 2.5 and PM 10), volatile organic component (VOC) index, temperature and humidity, and the SCD40 sensor to measure carbon dioxide. Linear interpolation is used in the microcontroller to compute the air quality index (AQI) based on the measured concentrations of PM 2.5 and PM 10. The moving average filtering is applied to reduce the effect of short-term fluctuations in the measured values of particulate matters in the computation of AQI. An OLED display module (SSD 1306) is attached to the ESP32 to show the measured parameters and status of AQI. HTTP protocol is used to send collected data from the sensors and calculated AQI from the air quality monitoring device to ThingSpeak cloud platform wirelessly. The ThingSpeak IoT cloud platform provided real-time visualization of sensor data anywhere and at any time for users. An intelligent alert mechanism and automatic ventilation control are developed. The rate of audible alarm changes with the pollution concentration invites the immediate attention of the occupant. The result indicated elevated pollutant concentrations during cooking in the kitchen of a residential house, and the use of an alert mechanism and ventilation control management was able to reduce the concentration of pollutants. The developed device provided a practical and affordable solution for real-time air quality monitoring in indoor environments.