# CO2 Sensor on MG811 via Digital OUT?

Hi ALL!

it have AOUT and DOUT, need help with connecting via DOUT to my arduino mega, should i connect it to Digital pins directly or TX pins? Another question is how to work from IDE , i mean , can somebody help with sketch?

When i connected by example, from somewhere in the Internet via analog, it returns a value from 70 to 80 while breathe exhaling, I read something about the influence of voltage, sensor heating, also some physical constants of the Faraday number to calculate CO2 in ppm, but have not figured out. can anyone explain how to achieve the normal data from the sensor in ppm, and how often they can i get from it (for ex. every min or several or m.b. less), the best course with digital.

Upd: i can use also analog, but i have wire about 10 meters from arduino to sensor, is it ok?

http://www.dfrobot.com/image/data/SEN0159/CO2b%20MG811%20datasheet.pdf Datasheet says 30..50mV out (curves indicates 300..500??) for 10m cable. Use TP (network cable) or coax check for noise.. and ff possible, add an amplifier at sensor point.

Exactly! I'm using a network cable. I believe that what I get from an analog input value is not ppm, and some intermediate value of which can be obtained ppm, right?

I am a complete noob in electronics (pardon =),

knut_ny: Datasheet says 30..50mV out (curves indicates 300..500??)

How can i indicate curves at home?

upd: from analog input arduino retreving value from ~70 to ~90, what is it? what for there DOUT?

value from ~70 to ~90,

If ref. voltage is 5V...: 70/1023 of 5V -> 0.34V compare with datasheet graphs. adjust for temp and humidity. .. looks like U're near something..

The digital out will give a digital 0 or 1. There is a comparator onboard - u can select switcing level by adjusting the potensiometer (so it may not be very interesting if the ppm-reading is whats wanted)