I use a Esp8266 microcontroller reading a MH-Z14A NDIR CO2 sensor [1] and a Laser PM2.5 HM3301 from grove [2]. Pretty easy to code up in C. Once tge sensors data is read, the esp sends the it over the MQTT protocol on wifi to home assistant which puts them in SQL db and does plots and stuff.
[1] https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh...
[2] https://www.seeedstudio.com/Grove-Laser-PM2-5-Sensor-HM3301....