Modulating the operating temperature of metal-oxide (MOX) chemical sensors gives rise to gas-specific signatures that provide a wealth of analytical information. In most cases, the operating temperature is modulated according to a standard waveform (e.g., ramp, sine wave). A few studies have approached the optimization of temperature profiles systematically, but these optimizations are performed offline and cannot adapt to changes in the environment. Here, we present an "active perception" strategy based on Partially Observable Markov Decision Processes (POMDP) that allows the temperature program to be optimized in real time, as the sensor reacts to its environment. We characterize the method on a ternary classification problem using a simulated sensor model subjected to additive Gaussian noise, and compare it against two "passive" approaches, a naive Bayes classifier and a nearest neighbor classifier. Finally, we validate the method in real time using a Taguchi sensor exposed to three volatile compounds. Our results show that the POMDP outperforms both passive approaches and provides a strategy to balance classification performance and sensing costs.