I tried to only run these two so here is the code. basically only dht and mq3 .
If I run it at a low enough frequency (like 2 sec) then the spike won't happen. That seems (pure guess) like to be the refresh rate of the dht sensor.
#include "DHT.h"
#define buttonPIN 3
#define MQ3PIN 3
#define DHTPIN 2 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
float count = 0;
float timeinterval = .5;//in seconds
int buttonState = 0;
float MQ3reading;
void setup() {
pinMode(buttonPIN, INPUT);
Serial.begin(9600);
dht.begin();
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
if (buttonState == HIGH) {
count=0;
}
MQ3reading = analogRead(MQ3PIN);
Serial.print(count);
Serial.print(' ');
Serial.print(h);
Serial.print(' ');
Serial.print(t);
Serial.print(' ');
Serial.print(MQ3reading);
Serial.print('\n');
count=count+timeinterval;
delay(timeinterval*1000);//interval
}