Now search for Adafruit GFX and install the Adafruit GFX library by Adafruit. For that, open the Arduino IDE and go to Sketch > Include Library > Manage Libraries. These libraries can be downloaded from the Library Manager in the Arduino IDE and install it from there.
#Dfrobot gravity circuit code
The code uses the Adafruit_GFX, and Adafruit_SSD1306 libraries. Here we are explaining some important parts of the code. The complete code for this Gravity Infrared CO2 Sensor with Arduino project is given at the end of the document. The connections are shown in the below table:Īfter connecting the hardware according to the circuit diagram, it should look something like below:Īrduino Code to Measure CO2 Concentration Since the OLED Display module uses SPI communication, we have established an SPI communication between the OLED module and Arduino Nano.
The Signal (Analog Out) pin of the CO2 sensor is connected to the A0 pin of Arduino Nano. Infrared CO2 Sensor and OLED Display module both are powered with +5V and GND. The circuit is very simple as we are only connecting Gravity Infrared CO2 Sensor and OLED Display module with Arduino Nano. Circuit DiagramĬircuit Diagram for interfacing Gravity Analog Infrared CO2 Sensor with Arduino is given below: Learn more about OLED and its interfacing with different microcontrollers by following the link.
Useful when more than one module is used under SPI protocol
Used for both I2C and SPIĭata pin of the module. We have already covered OLED and its types in detail in the previous article.Īcts as the clock pin. The pins and its functions are explained in the table below: It can work on three different communications Protocols: SPI 3 Wire mode, SPI four-wire mode, and I2C mode. OLEDs are using the same technology as televisions, but have fewer pixels than in most of our TVs.įor this project, we are using a Monochrome 7-pin SSD1306 0.96” OLED display. A bright light is produced when an electric current is applied to these films.
#Dfrobot gravity circuit series
OLED (Organic Light-Emitting Diodes) is a self light-emitting technology, constructed by placing a series of organic thin films between two conductors. Operating Humidity: 0 ~ 95% RH (no condensation).Infrared CO2 Sensor Specifications & Features: The below figure and table shows the pin assignments for the Infrared CO2 Sensor: This Infrared CO2 Sensor can be used in HVAC, indoor air quality monitoring, industrial process, and security protection monitoring, agriculture, and animal husbandry production process monitoring.Īs mentioned earlier, the Infrared CO2 Sensor comes with a 3-pin connector. The effective measuring range of this sensor is from 0 to 5000ppm with an accuracy of ± 50ppm + 3%. It integrates temperature compensation and supports DAC output. This sensor is based on non-dispersive infrared (NDIR) technology and has good selectivity and oxygen-free dependency. Gravity Infrared CO2 Sensor V1.1 is the latest high-precision analog infrared CO2 sensor released by DFRobot. You can also check our previous projects where we used the MQ135 Gas sensor, Sharp GP2Y1014AU0F Sensor, and Nova PM Sensor SDS011 to build an air quality monitor. It measures the CO2 content in the range of 0 to 5000 ppm. Gravity Infrared CO2 Sensor is a high precision analog CO2 sensor. In this tutorial, we are going to interface the Gravity Infrared CO2 Sensor with Arduino to measure the CO2 concentration in PPM. There are many air quality measuring devices installed on roads to tell the CO2 level, but we can also build a DIY CO2 measuring device and can install it in our area. This rising level of CO2 has affected the environment badly and led us to face the situation like climate change and global warming. This means that in one million particles of air, there are 385 particles of carbon dioxide. According to the NOAA report, the ozone CO2 concentration has reached 0.0385 percent (385 ppm) and it is the highest amount in 2.1 million years. The increasing concentration of carbon dioxide in the air has become a serious problem now.