I am having trouble with a DHT22 temperature sensor to work on Arduino Mini Pro

I have tested the sensor on an Arduino Uno and it worked flawlessly, when I tried to get it working on an Arduino Mini Pro, the sensor wasn’t even acknowledged by the board. I think it has to do with electricity going through the sensor but I am not entirely sure. I used a digital pin to supply power to the sensor, and I have another digital pin to read the sensor values, I’m not to sure if I need a seperate power source for the sensor or if there is something wrong with my code. My conclusion is I need an additional power source to run this sensor, but I would like to verify that before I look into it.

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include “DHT.h”

#define DHTPIN 10 // what pin we’re connected to

#define DHTTYPE DHT22 // DHT 22 (AM2302)

const int a = 12; // the number of the LED pin
const int b = 6;
const int c = 13;
const int s = 2;

// Connect pin 1 (on the left) of the sensor to +5V
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor


void setup() {
Serial.println(“DHT test!”);
pinMode(a, OUTPUT);
pinMode(b, OUTPUT);
pinMode(c, OUTPUT);
pinMode(s, OUTPUT);


void loop() {
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds ‘old’ (its a very slow sensor)
digitalWrite(s, HIGH);
float h = dht.readHumidity();
float t = dht.readTemperature();
// float f = t*9/5 + 32; //for Farenheit reading

if(t < 30.50)
digitalWrite(a, HIGH);
else {
digitalWrite(a, LOW);
digitalWrite(b, HIGH);

if(t > 31.20)
digitalWrite(c, HIGH);
digitalWrite(a, LOW);
digitalWrite(b, LOW);
if (isnan(t) || isnan(h)) {
Serial.println(“Failed to read from DHT”);
digitalWrite(c, HIGH);
digitalWrite(a, HIGH);

}else {
Serial.print(“Humidity: “);
Serial.print(” %\t”);
Serial.print(“Temperature: “);

//Serial.println(" *F");


Here is the Circuit Schematics, the LED Grounds are all connected

The DHT-22 needs a max of 2.1mA of current, so driving it from an Arduino output pin should be save.

Wait for a second or so after powering the sensor before you request readings. Maybe this solves your problems.

You haven’t supplied a drawing or photo of your circuit nor a detailed description.

You should have 2 seconds between reads of the sensor , see the datasheet.

furthermore you must do this test

 if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT");

before processing the t and h variables

you just did the other way around.

I used the serial monitor to test it and it gave me garble. I tested the sensor with the serial monitor before and the readings are pretty fast its about once every second with the arduino uno . I am drawing a sketch of my circuit now for review :) and the location of the test shouldn't matter because if it can't read the sensor it would use the test I know it isn't working because the test also turns two of the LEDs on which is only happens if the sensor isn't being recognized

Do you have a pull up resistor on the data line? might help.

alternatively try my DHTlib & examples - http://arduino.cc/playground/Main/DHTLib -

Which Mini Pro? 5V? 3V3? 16MHz? 8MHz?

5V 16mhz and I tried to set the pin10 to input but it didn’t help

I figured out the problem, so it turns out that the FTDI cable that I am using to test out the arduino had a current of 3.3V and DHT requires a minimum of 3.5V, so after freaking out I tried a 9V, I just connected 9V to RAW and it still doesn't work :( I don't understand why it doesn't work and I am really frustrated

Hi Did you ever solve this problem as I have the same issue?

Thanks Steve

You need a pullup resistor of between around 3.3K and 10K on the sensor data line. Without one , it might work , but will be very unreliable.