Interfacing a CO2 sensor with the Pico
In this section, we will discuss interfacing the CO2 sensor with the Raspberry Pi Pico. This section is meant for those who don't have access to a local data source for air quality. The SCD30 sensor has a measurement range of 400–10,000 ppm. We chose this sensor because it comes with an onboard temperature sensor that provides temperature compensation to the CO2 concentration calculation. The datasheet for the sensor is available from here: https://bit.ly/3tyJZ9C. We will measure the CO2 concentration and publish it to ThingSpeak, a service we discussed in Chapter 4, Fun with Gardening!. This will enable us to share a public dashboard of the local air quality levels.
If you have access to a public data source, you are welcome to skip this section and move to the next section where we test the motors.
We are assuming that you have installed the required libraries to communicate with the sensor using the instructions from earlier...