03-15-2023, 01:55 AM
we have tested , no problem with hardware. i think you can check your source code.
here is our test code work with DHT11 sensor.
here is our test code work with DHT11 sensor.
Code:
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
#include <DHT.h>
#define output1 4
#define input1 36
DHT dht13(13, 11);
void setup() {
Serial.begin(9600);
dht13.begin();
pinMode(output1,OUTPUT);
pinMode(input1,INPUT);
}
void loop() {
Serial.println(dht13.readTemperature());
delay(1000);
if (digitalRead(input1)==0 && digitalRead(output1)==0){digitalWrite(output1,1);
//delay(100);
}
else if(digitalRead(input1)==1 && digitalRead(output1)==1){digitalWrite(output1,0);
//delay(100);
}// end loop()
}