R
R
Rishat Sultanov2017-08-24 19:36:51
Arduino
Rishat Sultanov, 2017-08-24 19:36:51

Why does the temperature change its value if we connect the MQ-4 sensor?

Arduino sketch:

int sensorPin = 0; 
int Gas = 1;

void setup()
{
  Serial.begin(115200);  
                       
}
 
void loop()                     
{

 int reading = analogRead(sensorPin); 
 

 float voltage = reading * 5.0;
 voltage /= 1024.0; 
 
 
 // now print out the temperature
 int temperatureC = (voltage - 0.5) * 100 ;  
 Serial.println(temperatureC);
 Serial.println(analogRead(Gas));
 delay(1000);                                     //waiting a second
}

TMP 36 GZ - on A0 + 3.3V and GND.
MQ-4 - on A1 + 5V and GND.
When I give power to the MQ-4, the temperature sensor starts to run and show the wrong results
. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kisaa, 2017-08-25
@kisaa

Maybe that the MQ-4 has a built-in heater that changes the temperature, including next to it? And judging by the sketch, you use the mode with the heater constantly on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question