Air pollution causes problems such as global warming, acid rain and cardiovascular/respiratory diseases; according to the World Health Organization, an estimated 4 to 9 million deaths occur annually due to the impact of poor air quality. It is important to deploy monitoring systems that notify the citizens about potential health risks. So, we proposed a network architecture to monitor the air quality in educational buildings that integrates WSN and IoT. To that end, we designed and built an air quality monitoring device; subsequently, we implemented a WSN that collects the air quality data and aggregates these information at the sink. Next, we employed MQTT to send the data from the sink to the end-user through a cloud platform. In addition, the WSN applied duty cycle control to extend its lifetime. Our results showed that there is a trade-off between coverage and latency/percentage of packet lost/RSSI; besides, the average AQMD lifetime was 184 minutes before the battery depleted.