The earth’s Atmospheric CO2 level is increasing year over year. The global average atmospheric carbon dioxide in 2019 was 409.8 parts per million and it was 411.3 ppm in October 2020. Carbon dioxide is a key greenhouse gas and responsible for about three-quarters of human emissions. So CO2 level monitoring has gained importance.
Wiring Diagram
For the first CO2 activity, we are only using the A0 signal pin. Let's wire it up.
The Base Code
We are going to start simple. We are not going to calibrate it and just take its preprocessed output data and display it to the serial monitor. Type up and send out this code after you wire up your sensor to the board. After you upload it, open up the serial monitor.
It should have outputs like this.
Did it work? If it did, save your code.
Outputting Readings to OLED
Wire up the OLED with the gas sensor. Below is how to wire that if you forgot. Change the code to below and see if you can get the readings from the sensor to get sent to the OLED.
The Wiring. 1) GND to GND 2) VCC to 5 V 3) SCL to pin A5 4) SDA to pin A4