title: Power DHT11 with pin out Wemos D1 R1
body: <p>I am trying to run a DHT11 sensor from my Wemos D1 R1.  I have the ground connected to ground and the sensor connected to D2 pin with a resister between sensor and power line.  I have tried to connect the power to the D3 pin and setting the pinMode(D3,OUTPUT);and digitalWrite(D3,HIGH);, but the sensor isn't recognized.  If I connect the power to the 3.3v output pin on the Wemos it works fine.  I am plugging the Wemos into my computer's USB.  Can someone tell my why the Wemos isn't being powered up by the D3 pin.  Do I need to connect 9v to the Wemos instead of the computer power?  Not a big deal but would be nice to understand why and to hook it up to another power pin. 
  This is my code that activates the pins and turns on the power to the D3 pin.<a href="https://i.stack.imgur.com/LnVpQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LnVpQ.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/y3UkY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y3UkY.png" alt="enter image description here"></a></p>
  
  <pre><code>#include &lt;DHTesp.h&gt;
  
  DHTesp dht;
  
  pinMode(D3,OUTPUT);//make pin D3 a power outlet for 3.3v
  
  void setup() {
  
  
      Serial.begin(115200);
      dht.setup(D2, DHTesp::DHT11);
  
  digitalWrite(D3,HIGH);//make pin D3 hot
  }
  
  
  void loop() {
  
  
    delay(8000);
  
      float t = dht.getTemperature();
      float f = (t*1.8) + 32;
  
      if (isnan(t))
    {
      Serial.println("Failed to read from DHT2 sensor!"); **//when the sensor is powered by pin D3 this shows up but when powered by 3.3v it does get the sensor amount**
      return;
    }
      Serial.print(", \"maintemp\": ");
      Serial.print(f);
      Serial.print("}\n");
  
  delay(2000);
  }
  </code></pre>