How to Build a DIY CO2 Meter with Arduino

co2-meter-arduino

Share This Post

Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on email

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!

Subscribe To Our Newsletter

Get product updates and learn from the best!

More To Explore

how-does-conductivity-affect-water-quality
Blog

How Does Conductivity Affect Water Quality?

Conductivity is a vital parameter when determining water quality. As salinity and temperature increase, conductivity also increases, which can have a negative effect on the quality of water. This is because the higher the conductivity, the higher amount of impurities (dissolved substances, chemicals, and minerals) are in the water. Conductivity is one of the most

how-do-conductivity-meters-work
Blog

How Do Conductivity Meters Work?

A conductivity meter is an essential measuring tool for a range of applications and industries. When the probe (attached to the conductivity meter) is inserted into the solution, an electrical current flows between the electrons inside the probe which reads the electrical current, providing a conductance value.  Electrical Conductivity or (EC) measures the ability of

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.