Air quality monitoring is a very important aspect of providing safe indoor conditions, and carbon dioxide (CO2) is one of the pollutants that most affects people’s health. An automatic system able to accurately forecast CO2concentration can prevent a sudden rise in CO2levels through appropriate control of heating, ventilation and air-conditioning (HVAC) systems, avoiding energy waste and ensuring people’s comfort. There are several works in the literature dedicated to air quality assessment and control of HVAC systems; the performance maximisation of such systems is typically achieved using a significant amount of data collected over a long period of time (even months) to train the algorithm. This can be costly and may not respond to a real scenario where the habits of the house occupants or the environment conditions may change over time. To address this problem, an adaptive hardware–software platform was developed, following the IoT paradigm, with a high level of accuracy in forecasting CO2trends by analysing only a limited window of recent data. The system was tested considering a real case study in a residential room used for smart working and physical exercise; the parameters analysed were the occupants’ physical activity, temperature, humidity and CO2in the room. Three deep-learning algorithms were evaluated, and the best result was obtained with the Long Short-Term Memory network, which features a Root Mean Square Error of about 10 ppm with a training period of 10 days.