SEN0219 CO2 Recommendations and Usage

userHead jose.filipe.domingues 2017-05-10 17:51:51 2689 Views1 Replies

I've just got the CO2 sensor and I would like to understand if someone has any recommendations. I am struggling to understand if values I'm getting are valid and get consistant values.

I'm using:
- Arduino UNO (A0)
- Arduino MEGA (A0)

Test Environment:
- Indoor, living room
- Small (1m3) DIY Indoor Greenhouse

Test Results:
1. I've started by testing sensor with code provided in product wiki, using Arduino UNO R3. When it was turned on, I was getting values in the region of 400/450ppm. That seemed fine, as that seems to be value for CO2. Then, after a while (I am assuming after it pre-heated) I started getting values in the region of 1100ppm. After Googling, that seemed also valid because they were saying indoor CO2 values are between 1000-1200ppm.

2. Then I've tested it with Arduino Mega inside the greenhouse. I would expect lower values because plants consuming CO2, but because I opened the greenhouse and air from living room got in, I would expect values to start in the region og 1100ppm and then slowly reduce in time. However, I was getting values in the region of 1650ppm, which don't make any sense. After 1 hour, values remained the same, and I've put the sensor outside the greenhouse, and values remained in the region of 1650ppm.

3. This morning I've tested back in Arduino UNO, got 450m ppm after turning it on, and back to 950ppm after a few meetings (after pre-heating).

Potential Causes:
The code used in Arduino Mega, which game me inconsistent results is a complex one, with several other sensors: temperature, humidity, soil humidity, wifi-shield, sd-shield. I don't think that should interfere because I used exactly the same code excerpt, but I will check tonight.


Q1. The greenhouse has a LED growing light, which also emits wave lengths in infrared region. Could this light mess with sensor readings?

Q2. Does it make any difference if sensor is horizontal, vertical, or on its side? I was using it vertically.

Q3. Does the frequency (delay) of reading the sensor have any impact? In the base code the reading is every 100ms. I've changed it to be every 10 seconds. Does this have any impact?

Thanks in advance for helping.
2017-05-11 05:59:43 I finally made it working consistently. Here are my notes for anyone interested:

1. The infrared LED light does not seem to interfere with the reading.

2. The position, vertical, side, also does not seem to interfere with the reading.

3. As described in other similar post about the sensor, it initiates with readings around 450ppm, and then after 3 to 4 minutes, it raises up to 950ppm, which is the concentration in my room.

4. The issue with not working with Arduino Mega was the fact that I use a 12V to 5V voltage converter. The Arduino internal voltage (5V) actually reads arroung 4.8V. The converted voltage is precisely 5V. I believe this difference in the input for the sensor does seem to make a difference in the sensor readings, up to 100ppm when warming up, and then up to 200ppm or 300ppm after warming up. I found this to be unexpected, because the sensor should operate up to 5.5V, but maybe this makes a difference in the calibration of the device. At the end the readings using the Arduino internal voltage looked more valid.

5. I also found to be a big margin between readings. For this reason I have developed a short algorithm that stores some configurable number of consecutive readings and then calculates the mean value. Then excludes values above and below a (configurable) 5% of the mean, and then recalculates the mean. I'm sure there are better statistics algorithms that one can apply but this was easy and quick to implement, and perception of readings greatly improved.

5A. I noticed that the frequency of the reading 25ms to 1s, does not make a considerable difference. Obviously consecutive readings with the 25ms delay are more similar, but I also found quite big error values as this time gap.

5B. Finally, as previously described is a similar post, I did notice that it takes about 10 seconds for the readings to change when we for example blow at the sensor. However, it takes a lot of time for it to go back to original values. One potential way to do this is to reset the sensor. One can have a switch to turn it off and then on. You will require 3-4 minutes for heating again, but the readings should be precise again after that.

I will continue my tests and will update if I find anything that might be useful for beginners.
userHeadPic jose.filipe.domingues