Introduction: Indoor Hand-held Co2 Detector (for Covid-19 Purpose)

About: Howdy, we are application engineers in Seeed. Sharing projects with the maker community is awesome. Hope you like it XD Seeed is the IoT hardware enabler providing services that empower IoT developers to swift…

Project Background

Most transmissions of coronavirus occur indoors, the majority of those cases are caused by the inhalation of particles containing the virus. The best way to prevent the spread of the virus into the home or workplace is to keep infected people out. However, about 40% of cases are asymptomatic, and these asymptomatic infected people can still spread the virus to others, which is difficult to avoid.

Shelly L. Miller, a professor of mechanical engineering at the University of Colorado Boulder, recently published an article on the Popular Science website, which is about the best way to reduce the risk of indoor infections;

Getting fresh air

Monitoring carbon dioxide concentrations, and using air purifiers. Fresh air The safest indoor space, according to Miller, is one in which there is a constant supply of outdoor air replenished to replace the dirty air inside.

In commercial buildings, outside air is usually imported through heating, ventilation, and air conditioning systems. In homes, outside air can enter through open doors, windows, and various gaps.

In short, the fresher the outside air into the room, the better. The introduction of such air can dilute all indoor pollutants, such as viruses, and reduce human contact with viruses. Environmental engineers use the air replacement rate to quantify how much outside air enters the room.

Although the specific replacement rate depends on the number of people and the room size, most experts believe the ideal condition is about six air exchanges per hour for a 100 square foot room with three or four people present (about 9 square meters).

During the global pandemic of infectious diseases, the replacement frequency should be higher. A 2016 study showed that nine air exchanges per hour reduced the spread of severe acute respiratory syndrome (SARS), Middle East respiratory syndrome (MERS), and H1N1 influenza in hospitals.

However, many buildings in the US, especially in school, do not reach the recommended air exchange rate. Fortunately, it is not difficult to import more outside air into the building. To begin with, keep doors and windows open is a good way. Furthermore, placing an electric fan at the top of a window can increase air exchange a lot. And in buildings without operable windows, one can modify the mechanical ventilation system to bring more outdoor air indoors. But in any room, the more people in the room, the faster the air should change.

Monitoring air circulation using CO2 concentration

How do people know there is enough air exchange in their rooms? There is a simple way to make that determination. Every time we exhale, we release carbon dioxide into the air. Since coronaviruses are most often spread by breathing, coughing, or talking, carbon dioxide concentration can be used to see if a room is filled with the potentially infectious exhaled breath. The carbon dioxide concentration allows us to estimate if enough fresh air is coming into the room.

The outdoor CO2 concentration is only slightly above 400 ppm, and the CO2 concentration in a well-ventilated room is about 800 ppm. If the ppm of a room is higher than that, then the room may need more ventilation. A researcher reported last year that ventilation problems impacted an outbreak of tuberculosis transmission within Taipei University. Many rooms on campus were inadequately ventilated, with carbon dioxide levels exceeding 3,000 ppm, and the outbreak was subsequently brought under control when engineers improved air circulation and reduced carbon dioxide levels to less than 600 ppm.

Since coronaviruses are airborne, a higher concentration of carbon dioxide in the room may mean a greater chance of spreading the virus if an infected person is indoors. Based on the above research, Miller recommends keeping the carbon dioxide concentration below 600 ppm so that we can effectively control the large spread of the outbreak. We will use the existing electronic module to make an instrument that assists us to monitor the indoor CO2 concentration, you can customize the alarm message, and even determine whether to open the windows and doors for ventilation automatically based on the current CO2 concentration. Of course, you can also buy CO2 detectors, just make sure they are accurate within 50 ppm.

Step 1: Preparation

Before we start, we have to prepare some electronic modules and devices we needed:

  • Grove - Carbon dioxide and temperature and humidity sensors (link)
  • Seeeduino XIAO Expansion board (link)
  • Seeeduino XIAO (link)
  • 3.7V Lithium Battery
  • 300mm*300mm*3mm basswood board (quantity: 1)
  • M3*60 double-end stud (quantity: 4)
  • M3*20 double-end stud (quantity: 6)
  • fM2*60 double-end stud(quantity: 5)
  • M3 screws (5mm≤length≤10mm) (quantity: 20)
  • M2 screws (5mm≤length≤10mm) (quantity: 10)
  • screwdriver
  • double-sided glue

Step 2: Hardware

Connect the CO2 sensor to the IIC port of the Seeeduino XIAO Expansion board, plug Seeeduino XIAO into the expansion board. Burn the program provided by the attachment. Then you can see the current temperature, humidity, and concentration of CO2 for the current environment on the screen. If the current concentration of CO2 is greater than 800 ppm, the instrument will start to alarm until the concentration is less than 800 ppm.

Step 3: Software

Connect Seeeduino XIAO to a computer by a type-c cable, then the yellow LED of power should light up.

Now, open the Arduino IDE and add the Seeeduino to Arduino IDE: Click "Files" > "Preferences", fill the "Boards Manager" URL with the following link:

https : //

Click "Tools" > "Board" > "Boards Manager", search for keywords: "Seeeduino XIAO". You will see "Seeed SAMD Boards", install it.

After installed the boards, click "Tools" > "Board", find "Seeeduino XIAO M0" and select it. Now, you have set up the Seeeduino XIAO Arduino IDE board.

Now open the program provided by the attachment. Download the library files according to the two links in the program.

Then click "Sketch" > "Include Library" > "Add .ZIP Library".

Select the zip file you just downloaded. If the library was installed correctly, you will see "Library added to the libraries. Check "include library" menu" in the notification window. This means that the library has been installed correctly.
From "Tools" select serial ports for the Arduino development board. Serial ports menu. This could be COM3 or a higher version (COM1 and COM2 are usually reserved for hardware serial ports). To find out the answer, we can disconnect the Arduino development board and reopen the menu. The disappeared row should be the Arduino development board. Reconnect the board and select that serial port.

Now, click the "upload" button in the environment. Wait for some seconds, a message "Upload completed" will be shown on the status bar if the upload succeeds.

A few seconds after the uploading completed, you should be able to see some data on the screen. Congratulations! You have launched and run the program. If you encounter any problems, please do not hesitate to submit the issue to our forum.

Note: When measuring the ambient carbon dioxide concentration, please keep each measurement time up to 10 seconds and take the average value for multiple measurements. This will give a more accurate value.

In addition to the provided program, you can also customize new program logic and functions, such as starting to push the signal to the phone in real-time via the wireless module when the concentration is greater than a certain value, or automatically opening doors and windows by directly accessing a relay, etc. I am very looking forward to your custom settings.

Some references you may need:


Step 4: Structure

Let's switch to the structure part of this project. Since we are considering a portable hand-held device, we decided to make a infrared-temperature-gun-like shell for it.

You can find the blueprint I used in the attachment and use a laser engraving machine to engrave the wood panels to get the parts. Then assemble the parts in order.

In addition to pictures, a video is also available to watch to see how to assemble.

If everything goes well, congratulations! You just get a hand-held device for detecting CO2 concentration. You are welcome to optimize this project, please share your results with me if you wish.