Temp, Humidity CO2 sensor and library.

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 :-(

which pin I could check for analog voltage?

according to - http://www.gassensing.co.uk/wp-content/uploads/2013/02/COZIR_-WideRange_-Datasheet_GSS.pdf -

pin 9 is analogue

I receive nothing :-(

A voltmeter should be able to detect a signal from the TX pin of the sensor.

this is the way to connect serial devices. sensor TX --> Arduino RX senosr RX <-- Arduino TX

(disclaimer, I don't have this sensor myself)

Hi robtillaart,

I connected the sensor as you hint, with 5v instead of 3.3v and it works correctely.


Good to hear that!

If you have remarks wrt the lib please post it in this thread that might be things missing, buggy, etc ;)