How to Build a DIY CO2 Meter with Arduino

co2-meter-arduino

Share This Post

In this tutorial, we will show you how to make a benchtop-style CO2 meter using our EZO-CO2™ Embedded Carbon Dioxide Sensor connected to an Arduino Uno. The real-time readings will be shown on a liquid crystal display (LCD) in PPM. Both the sensor and display are connected to the Arduino via I2C.

Note

This device was developed and tested using a Windows computer. It was not tested on Mac.
This CO2 sensor is for gaseous CO2 only, do not submerge!

Necessary items

Before we begin have the following items readily available

Hand tools and fabrication machines used

Below is a list of tools we used for this tutorial. You do not need to have ALL these tools, although they will greatly speed up the process.

  • Drill press
  • (1/4″, 7/64″) drill bits
  • (1″ 1/16″) annular cutter
  • Milling machine
  • (1/8″) endmill
  • Solder iron & solder
  • Hand files
  • Phillips-head screwdriver
  • Caliper
  • Ruler
  • Painters tape
  • Sharpie marker

1. Prepare the enclosure

Safety: Remember to take care when handling tools/machinery and to wear proper safety gear such as goggles, gloves, and respirators.

Opening for the LCD

a) The LCD is placed in the top portion of the enclosure. Cover the surface with painters tape and center a (71 x 24mm) rectangle on it.

b) Using a 1/8″ endmill, cut just on the inside of the drawn rectangle as close to the line as possible.

c) With a hand file, remove the excess material and shape the opening to the required size.

Openings for the Arduino’s USB and power jack

a) Cover one of the long sides on the bottom portion of the enclosure with painters tape. Mark off the locations for the USB and power jack.

b) With the 1/8″ endmill, cut within the outline of the two rectangles.

c) Use a hand file to remove the excess material and shape the opening to the required size.

Opening for CO2 sensor

a) On the same side as the Arduino ports, mark off the spot for the CO2 sensor and drill a (1/4″) pilot hole.

b) Using a (1″ 1/16″) annular cutter, cut the hole for the CO2 sensor.

Holes for standoffs

a) Mark the locations for the three 11mm standoffs.

b) Use a (7/64″) drill bit to bore the holes.

Now that the enclosure is complete, let’s move on to the

2. Solder I2C backpack to display

Since the I2C backpack is a separate component, solder it onto the pins of the LCD as shown below.

3. Set CO2 sensor to I2C mode

By default, the CO2 sensor comes in UART mode. You will need to set it to I2C mode at the default address of 105 for this project.

Refer to the datasheet on how to change modes.

4. Install and wire components in the enclosure

a) Attach the three 11mm standoffs.

b) Mount the Arduino into place and secure it to standoffs with screws.

c) Add the sensor bridge and secure it with a screw.

d) Connect the sensor bridge to the Arduino using the male-to-male jumper wires as shown in the wiring diagram.

e) Next, install the CO2 sensor using a (3/4″ NPT) locknut and O-ring and plug the data cable into the sensor bridge. Be sure to align the white and blue wires of the data cable with the corresponding labels on the bridge.

f) Insert the LCD into the enclosure’s cover. (You can use some hot glue to help hold it in place).

g) Connect the LCD to the sensor bridge using the male to female jumper wires following the wiring diagram.

h) Using the A – B male/male USB cable, connect the Arduino Uno to your computer and open the Arduino IDE software. It’s time to get the code onto the Arduino.

Make sure your Arduino IDE libraries are up to date

Add the EZO I2C library

To download the Ezo_I2c library file, click HERE.
Click on the green “Code” button, then click “Download Zip” as shown in the image below

*Don’t unzip this file!

Import the.ZIP file to your Arduino IDE. To import the.ZIP file go to Sketch > Include Library > Add.ZIP Library

Install the Adafruit Liquid Crystal library

In the IDE go to Sketch > Include Library > Manage Libraries

Lookup “Adafruit LiquidCrystal” in the search bar of the Library Manager

Click on Install


Flash Arduino with the code

a) Open the code by going to File > Examples > EZO_I2C_lib-master > Examples > Projects > arduino_co2_meter

b) Set the target CPU to flash: Tools > Board > Arduino AVR Boards > Arduino Uno

c) Select the port to which your Arduino is connected: Tools > Port > COM “X”
(comport address will change from user to user)

d) Compile and flash the code to the Arduino. Once completed you should see the CO2 readings on your serial monitor (append carriage return only and set the baud rate to 9600) as well as the LCD. Adjust the screen contrast of the display as needed using the nob on the i2c backpack.

Finalize Assembly

a) Unplug the device from your computer and screw the top and bottom portions of the enclosure together to complete the assembly.

b) You can now power the meter with an external 12V barrel jack supply. Congratulations, you now have a benchtop Co2 Meter ready to go!

Products used in this tutorial

Subscribe To Our Newsletter

Get product updates and learn from the best!

More To Explore

how-to-calibrate-conductivity-meter
Blog

How To Calibrate Your Conductivity Meter

A conductivity meter calibration typically involves rinsing the probe, immersing it in standard solutions of known conductivity, adjusting the meter readings to match the standards,

stormwater-monitoring
Blog

Stormwater Monitoring Parameters

Stormwater monitoring shows urban runoff’s hidden impact. It involves measuring turbidity, pH, dissolved oxygen, nutrients, and pollutants like heavy metals, oils, and bacteria. This data

Want to learn more about our products?

Scroll to Top

To track your order please enter your Order ID in the box below and press the "Track" button. This was given to you on your receipt and in the confirmation email you should have received.