DHT11 is not reading Temperature and Humidity when Arduino is powered on using DC power Supply (12V)
I am facing one problem. I have code which read temperature and humidity using DHT11 sensor. I uploaded following code using Arduino via USB serial, I can read values of temp, humidity. Values are being read as long as Arduino is connected to same laptop via USB.
TEMPERATURE AND HUMIDITY are being read as 0 when I power on Arduino using DC12v, 700MA adapter.
I want to deploy Arduino with DHT sensors connected with it in Greenhouse to read greenhouse environmental condition but when I power on using DC adapter or battery, it is giving "0" output.
PLEASE HELP TO SOLVE THIS PROBLEM.
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("DHTxx test!");
dht.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
-
is 12v too high for the dht? why not just use 5v if it works?dandavis– dandavis2017年07月13日 17:43:33 +00:00Commented Jul 13, 2017 at 17:43
-
This 9v to 12v dc adapter is not fed to DHT. This adapter is connected to DC adapter jack of Arduino. I am giving 3.3v to 5v to DHT correctly.Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 17:53:01 +00:00Commented Jul 13, 2017 at 17:53
-
where does the 5v come from?dandavis– dandavis2017年07月13日 17:54:56 +00:00Commented Jul 13, 2017 at 17:54
-
I have supplied 3.3v to 5v to DHT from another Arduino which is USB powered from PC. I am using Analog port A1 and DHT library from this link github.com/adafruit/DHT-sensor-library. Is this anything to do with analog port but it reads values when connected to USB ?Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 17:57:46 +00:00Commented Jul 13, 2017 at 17:57
-
any suggestions ?Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 20:40:44 +00:00Commented Jul 13, 2017 at 20:40
1 Answer 1
You haven't really provided enough information to answer. What are you reading the temperatures with. You code just assigns a variable to the readings but does not output that to anything.
I would suggest reading along with this tutorial, for example, and trying out the code they provide: http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-arduino/
-
I am publishing these values via Ethernet to webserver. With USB connected to PC where I have uploaded the code from, it can send proper values of temp, humidity to webserver but when I power on using dc adapter, it just publishes "0" values of both temp and humidity.Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 17:48:12 +00:00Commented Jul 13, 2017 at 17:48
-
I am using Analog port A1 and DHT library from this link github.com/adafruit/DHT-sensor-library. Is this anything to do with analog port but it reads values when connected to USB ?Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 17:56:22 +00:00Commented Jul 13, 2017 at 17:56
-
any suggestions?Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 20:40:55 +00:00Commented Jul 13, 2017 at 20:40
-
When the Arduino runs at 5V, it runs at 5V, no matter where that 5V comes from. The only difference is the voltage regulator. Do you have an Ethernet Shield ? That requires some current. The voltage regulator might get too hot and lower the current. Could you try a 7.5V power supply instead ?Jot– Jot2017年07月13日 21:02:45 +00:00Commented Jul 13, 2017 at 21:02
-
I am using Ethernet Shield and dc adapter i have used is 9v, 750ma. Is this not ok ? and one more problem is that even if I connect USB from another PC, arduino read temp/humid as "0" only.Jyoti Raj Sharma– Jyoti Raj Sharma2017年07月13日 21:49:36 +00:00Commented Jul 13, 2017 at 21:49