Arduino CO2 Meter

by AtlasScientific in Circuits > Arduino

3210 Views, 6 Favorites, 0 Comments

Arduino CO2 Meter

main-image.jpg

In this project, we will be making a benchtop-style CO2 meter using the sensor from Atlas Scientific hooked up to an Arduino Uno. The real-time readings in PPM will be shown on a liquid crystal display (LCD). 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.
  • The CO2 sensor is for gaseous CO2 only. Do not submerge!
  • The meter is not waterproof

MATERIALS

PROGRAM

TOOLS

drill press, (1/4", 7/64") drill bits, (1" 1/16") annular cutter, milling machine, (1/8") endmill, solder iron & solder, hand files, Philips-head screwdriver, caliper, ruler, painters tape, sharpie marker

Prepare Enclosure: Opening for the Lcd

Capture.JPG
Capture.JPG
co2-box---top.jpg

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

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.

Prepare Enclosure: Openings for the Arduino's USB and Power Jack

Capture.JPG
co2-box---outside.jpg

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.

Prepare Enclosure: Opening for Co2 Sensor

Capture.JPG
co2-box---outside.jpg

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.

Prepare Enclosure: Holes for Standoffs

co2-box---inside.jpg

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

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

Solder I2C Backpack to Display

Capture.JPG

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

Set CO2 Sensor to I2C Mode

SetCO2 sensor in I2C mode with address 105

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.

Install and Wire Components in the Enclosure

Capture.JPG
Capture.JPG
Capture.JPG
Capture.JPG
Capture.JPG
Capture.JPG
Capture.JPG
Capture.JPG

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.

Don’t unzip it!

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

Install the Adafruit LiquidCrystal 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

d) Compile and flash the code to the Arduino. Once completed you should see the CO2 readings on your serial monitor (be sure to 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

main-image.jpg

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.