MQ2 and PIC16F877A

Thread Starter

12610

Joined Nov 15, 2011
3
Hi! Im having trouble in interfacing the mq2 sensor with pic16f877a.. because our original schematic diagram has an A/D converter. Since we changed PIC16f84 to PIC16F877A, we're having trouble on how to interface the MQ2 sensor with PIC16f877A.. Help me guys please..

Thanks..
 

t06afre

Joined May 11, 2009
5,934
Then you ask questions in this forum. It is very important to provide information like links to data sheet and any code schematics you may have. Also a short description on what you have done so far. And why and how you struggle. First then we will be able to help.
 
Last edited:

Thread Starter

12610

Joined Nov 15, 2011
3
im sorry for the incomplete information..
here is the original diagram http://www.google.com.ph/imgres?q=gas+sensor+in+proteus&um=1&hl=tl&sa=N&biw=1366&bih=607&tbm=isch&tbnid=fU5XX5jn7QVe8M:&imgrefurl=http://www.edaboard.com/thread162312.html&docid=lQpfuMdTjGuAiM&imgurl=http://images.elektroda.net/65_1262804551.jpg&w=675&h=512&ei=7lHCTriaMeiQiQefjbnrDQ&zoom=1&iact=rc&dur=653&sig=100192089466315077405&page=1&tbnh=135&tbnw=175&start=0&ndsp=22&ved=1t:429,r:14,s:0&tx=115&ty=57

as you can see, it has an a/d converter which is the TLC548 here is the data sheet http://www.datasheetcatalog.com/datasheets_pdf/T/L/C/5/TLC548.shtml

and since TLC548 is not available here in our country, i decided to change the pic from pic16f84 to pic18f877a. because the pic has already built in a/d converter. bbut how are we suppose to interface the MQ2 sensor to pic 16f877a?
 

t06afre

Joined May 11, 2009
5,934
As I understand the data sheet. This sensor is resestive. And may have a resistance in range 3KΩ-30KΩ depending on gas type and concentration? A typical circuit will be like fig 2 in the data sheet. Using a 5KΩ resistor as load resistance. And measure the voltage changes over the latter resistor
 

John P

Joined Oct 14, 2008
1,834
It looks pretty trivial. +5, Gnd, a resistor, output to the processor. One snag I can think of though, is that the output impedance of the sensor, which is determined by the combination of the sensor itself and the external load resistor, might be too high for the processor's A/D. In that case you'd need a buffer amplifier.
 
Top