Good health and well-being are primary goals within the list of Sustainable Development Goals (SDGs) proposed by the United Nations (UN) in 2015. New technologies, such as Internet of Things (IoT) and Cloud Computing, can aid to achieve that goal by enabling people to improve their lifestyles and have a more healthy and comfortable life. Pollution monitoring is especially important in order to avoid exposure to fine particles and to control the impact of human activity on the natural environment. Some of the sources of hazardous gas emissions can be found indoors. For instance, carbon monoxide (CO), which is considered a silent killer because it can cause death, is emitted by water heaters and heaters that rely on fossil fuels. Existing solutions for indoor pollution monitoring suffer from some drawbacks that make their implementation impossible for households with limited financial resources. This paper presents the development of IdeAir, a low-cost IoT-based air quality monitoring system that aims to reduce the disadvantages of existing systems. IdeAir was designed as a proof of concept to capture and determine the concentrations of harmful gases in indoor environments and, depending on their concentration levels, issue alarms and notifications, turn on the fan, and/or open the door. It has been developed following the Test-Driven Development Methodology for IoT-based Systems (TDDM4IoTS), which, together with the tool (based on this methodology) used for the automation of the development of IoT-based systems, has facilitated the work of the developers. Preliminary results on the functioning of IdeAir show a high level of acceptance by potential users.