Temp, Humidity CO2 sensor and library.

I was interested in this sensor so I contacted GSS which relayed my request to their North American partner, AirTest Technologies. I was very impressed with the quick response time and they promptly provided me with information on their products.

For my purposes, the Corzir-A (Ambient) with a range of 0-2000 ppm is perfect. It also has optional temperature and humidity sensors. The part number for that combination is COZIR-A-2000-X-H and I'm told it's $183.

How does that compare to other CO2 sensors? It's definitely more than I was hoping to spend, but at the same time it may be worth the price if it simplifies my project.

Hi Gaines, I havent tested the cozir against any other Co2 sensor but it seems accurate enough, I usually calibrate via fresh air and that gives me a ball park figure for what Im using the sensor for, it certainly responds very well if the house has been empty all day and someone comes in it will pick up that very quickly. $183 is not a bad price, and its all in one, so no need for many libs, wires etc.

The only drawback from an arduino point of view is the sensor communicates through serial which makes the process a bit more difficult getting the data you want, it would have been nice to have a digital version, 3 pins and just asks the sensor for the values but this limits its application I suppose because GSS also supply a usb cable that fits directly to the sensor and can run via their software without the need for any dev board.

I do think its something GSS should consider, getting rid of the serial and going digital might lower the cost. Getting rid of streaming mode is another thing Id like to see, its a pain in the @$$. :)


Hi DirtGambit,

Can you determine the presence of someone with the sensor? detecting an intruder? how fast? Would be a nice new application !

Oh yeah for sure as long as it wasnt really time critical, it stays between 390 - 420ppm (+-10ppm) all day, within 5 minutes of someone coming into the livingroom it will quite happily go up to 550ppm especially if you go near the sensor, I had some friends round one night, 4 people in a smallish living room, I was shocked to see 1500ppm on the graph.

A few years ago there was a study into co2 concentration in old schools, the average co2 during school time was > 2000ppm in some of them, in this case peaks were found at 3500ppm (I read a study once that had peaks of 4500ppm), a few schools had really good results but they were still > 1200ppm and had very good ventilation.


5 minutes seems rather long, but in those 5 minutes it goes from ~400-550 so it rises ~30ppm/minute. That means that one could detect it within 60 seconds that the CO2 level has rissen, and if well positioned maybe within 30 seconds. WHat is the minimum time you can detect in your graphs? If it is within 1 minute it would be great (OK depends on size of the room etc.

Do you see the same change in temperature - gues not- and humidity - could be? Humans exhale water and CO2 (they are reverse trees :) so those two should change significantly from some average value.

Ideas pop in my mind, like counting people by means of their CO2 output. Fun!

At the top of this post there is a second photo. What is it? An enclosure for the sensor and antenna?

Also, Cozir mentions the sensor has a light sensor? Is it an LDR? Does anyone know?



Does anyone know?

You could contact the manufacturer … IIRC from the datasheet not all models support this (not sure)

I asked for ldr functionality in my sensor and was told it wasn't being supported anymore, the datasheets haven't been updated to reflect this. The ldr was an optional extra, so at order time you are just told the ldr isn't available. I liked the idea of an ldr, but i think these sensors are being targeted to the commercial sector (handheld devices) where an ldr might not be as useful as opposed to the arduino/electronics community where having one sensor do many things is desirable depending on what you are making. ldrs are 10 a penny so just hook one up along side the cozir, thats what i did.

The enclosure is from proto-pic.co.uk, it was lying around so i put it together and the antenna is connected to a bluesmurf module, it has a decent range with the antenna.

Does the cozir sensor still has a connector for the LDR?

This is disappointing. I thought I had found a sensor that would do so much. I am wondering if there are any with all four sensors as Cozir has stated in the documentation.

I would like to create a sensor module that will sense C02, temperature, humidity, light and motion and connect them all to an xbee network to stream on the Internet.

Is PIR a good sensor for motion? What is a good precision LDR?

I plan to place these modules on each floor of my home to detect variations in temperature and humidity, alert on C02 and motion, and adjust an LED to shed light in the room as it is needed.



I dont know rob, I havent opened the sensor to find out, also i dont know if they have altered the firmware of sensor to stop outputting null values if the sensor has no ldr fitted, the sensors output is always rh,Temp,unfiltered co2, filtered co2.

badwheels thats quite a demand from any all in one sensor, the cozir does most of what you need, if you were to have all those separate you would have quite a breadboard and be in wire/lib hell, your project sounds cool though good luck.

Hi all, Does anyone have an idea where to get COZIR.h library ?

yes. the lib is attached on the first post (it includes the .h file)

latest version I have is 1.03 - see attachment - but it is a long time since I edited in it. there may be some work in progress on some points in it.
Note that the calibration functions must be used careful and do not use them if you don’t understand their impact.

#all disclaimers apply :wink:

If you have comments remarks let us know.

cozir 1.03.zip (3.02 KB)

the attachment returns Error 503 Service Unavailable

Do you have code that works on an arm nxp lpc1769 ?

My CO2 readings seem high what’s the best way to calibrate this device. I only have outside air to calibrate against.

many thanks

Just calibrate via fresh air which gives a value of about 380, maybe your in an area of high co2, I have a main road next to my house with a lot of traffic and average values were 420-450, are your values wildly out of range?

What program did you use to display the graphs of the temperature, humidity, co2?


I'm using a COZIR™ Wide Range Sensor, http://www.gassensing.co.uk/wp-content/uploads/2013/02/COZIR_-WideRange_-Datasheet_GSS.pdf, and I tried to use the cozir.h library as mentioned in the first post, but without success. Must I observe some particular attention? I'm tryng it with only usb cable attached to my Arduino UNO, perhaps I need an external 12V input for Arduino? I need only 3.3v to power the sensor.

I receive nothing from sensor, all zeroed values...

I tried also the sample from Cozir for this sensor to read byte-to-byte from serial but I receive only 255 and never 0x0A for end transmission.

please help me thx.


One often occuring problem with rs322 devices is that rx and tx need to be reversed. Did you try that?

Furthermore the sensor high bit is only 3.3Volt. The UNO needs at least 4.5 volt to recognize it as a HIGH signal. Check this with a voltmeter. You might need a 3.3<->5 voltage converter for this.

Furthermore you could check if the analog out gives a (changing) voltage. Can you check?

Hi robtillaart

which pin I could check for analog voltage?

I have an external max3232 interface, which pins I must connect? I found that:

sensor tx: t1n sensor rx: r1out arduino tx: r1n arduino rx: t1out

it's correct? I receive nothing :-(