Pages: [1] 2   Go Down
Author Topic: INTERFACING NDIR CO2 MODULE WITH ARDUINO  (Read 3564 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good day everyone!
Has anyone tried interfacing an NDIR CO2 module to arduino?

I'm trying to use a Telaire T6004 CO2 module that I ordered from the net. I want to get analog values so that I could make a monitoring system. WHAT PINS SHOULD I USE? Is the method of getting values from this sensor similar with a simple voltage divider using potentiometer? Im new with arduino but I need to learn it quickly. I would be grateful if someone would help me in understanding the requirements in order to communicate this NDIR CO2 module with arduino. Attached is a product description of the module.

Also, i have seen a youtube video that was using the same sensor module, and it made me realize that it could really be possible, unfortunately, there was no clear description on how he was able to interface and code it with his arduino.

Here's the youtube link that I saw:

* Telaire 6004 from all elex.pdf (78.51 KB - downloaded 35 times.)
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

From the datasheet it looks to me that the AVOUT pin provides 0 to 4V depending on the level of CO2. So you could connect that pin directly to an analog input. The only other pins I think you need to connect are +5V and ground.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay thank u sir.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12465
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet can be found at: ....?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How can I calculate PPM. If my analog output voltage is 0-4V? and the sensitivity of the CO2 sensor is 0-2000PPM? Pls help!
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How can I calculate PPM. If my analog output voltage is 0-4V? and the sensitivity of the CO2 sensor is 0-2000PPM? Pls help!

If 0V is 0ppm and 4V is 2000ppm and the device is linear and you are using the standard 5V analog reference, then:

  ppm = (analog_reading * 2000 * 5)/(1024 * 4)

You'll need to use unsigned long arithmetic to avoid overflow, e.g. this code:

Code:
  unsigned int ppm = ((unsigned long)analogRead(pin) * 2500)/1024;
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank u so much sir. How about if 0ppm is 1V and 2000ppm is 4V? how is that calculated?
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet can be found at: ....?
http://www.telaire.com/oem/oem_stand.htm
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank u so much sir. How about if 0ppm is 1V and 2000ppm is 4V? how is that calculated?

ppm = (analog_reading * 3000 * 5)/(1024 * 4) - 1000

However, if your 5V supply (the default analog reference) is not very accurate then you will have a significant zero error. If the sensor has a digital output, it would be better to use that.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


However, if your 5V supply (the default analog reference) is not very accurate then you will have a significant zero error. If the sensor has a digital output, it would be better to use that.

Yes sir, the sensor has a digital output. What exactly is the difference in measurements if I use the digital or analog? And how is it done?
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes sir, the sensor has a digital output. What exactly is the difference in measurements if I use the digital or analog? And how is it done?
The device seems to have analogue, serial and SPI interfaces. The data sheet says...
Quote
SPI/Microwire or UART @9600 baud
(Please call for detailed protocol specification)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
The LORD is my strength and my shield.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes sir, the sensor has a digital output. What exactly is the difference in measurements if I use the digital or analog? And how is it done?
The device seems to have analogue, serial and SPI interfaces. The data sheet says...
Quote
SPI/Microwire or UART @9600 baud
(Please call for detailed protocol specification)


Yes, its on the data sheet. I just don't know how to use it yet. I would like to know how accurate is the digital output than the analog.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reading serial would be relatively easy so just setup a test bench where your reading the analogue pin and serial data as close to the same time as possible and compare the results over the range your looking for. You will then know how good your analogue calculations are.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Riva. I can see the spi pins marked in the documentation. Can you tell me which pin is the analog. Is it pin 4? Thanks.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Riva. I can see the spi pins marked in the documentation. Can you tell me which pin is the analog. Is it pin 4? Thanks.
Assuming your device is the same as this http://www.telaire.com/pdf/datasheets/module6004a.pdf then the datasheet shows pin 4 is the analogue out. FYI pin 10 is TX and pin 11 is RX and the data sheet says 9600 boud if you want to compare to serial. To read SPI your probably going to have to ask the manufactures as you will need register information to do this.


* NDIR Pinout.jpg (22.86 KB, 341x309 - viewed 33 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Pages: [1] 2   Go Up
Jump to: