hello,
when i check with gas sensor MQ-135 it is working fine. it gives 0v and when gas detects it will give 5V but when i interfaced with AT89S52 it is giving 2.4 v when not detcts and give high when detcts. how to solve it ..Please suggest me....
MQ-135 is the naked sensor without any electronics. To clarify the problem, you should show your circuit. It may be the case, that you just forgot to connect a load resistor to the sensor output/ADC input. Consult the datasheet for details.
Although a buffer may be reasonable, the sensor should basically work with a 10K load resistor.
P.S.: The sensor output is an analog signal. AT89S52 hasn't analog inputs, so you should think about using an external ADC.
MQ135 is a sensor with analog o/p you cannot connect it directly to the controller so you will require an external ADC or you can make a simple comparator circuit using op amp and give the digital o/p to the controller
Thinking about the problem again, I realized, that the said 2.4V is most likely generated by the the AT89S52 I/O pull-up resistors, so you actually already have a load resistor. By changing to port 0 inputs, the problem can be solved.
If you are satisfied with a pure digital alarm function, you can adjust RL to get a specific threshold. The threshold won't be tightly specified, but the sensor sensitivity is neither.
thanks for the help guys...
it worked as it was heating i connected to another supply and considering only output pin but didnt made common ground so it was giving problems .when i connected a heat sink and gave from same source..it works fine..
Thanks Alot