LinkitONE and DHT11

Intro: LinkitONE and DHT11

Hi guys!

Here I will show you how to interface a DHT11 to a LinkitONE board.

Step 1: Parts Needed

You will need-

1 x LinkitONE

1 x DHT11

Step 2: Connect the DHT Sensor

Connect your DHT sensor.

Connect it to the 9th pin of your LinkitONE as we are using I2C protocol to transfer data.

Step 3: Connect USB

Connect the LinkitONE's USB to your PC.

Step 4: Code

Now we will write this code to our IDE.

#include "DHT.h"

#define DHTPIN 9

DHT dht(9, DHT11);

void setup() {

Serial.begin(9600);

dht.begin();

}

void loop() {

int ttmp = dht.readTemperature();

Serial.print("Temperature: is ");

Serial.print(ttmp);

Serial.println(" *C");

}

Step 5: Open Serial Monitor

Now open serial monitor from the board menu in IDE.

Share

    Recommendations

    • Furniture Contest 2018

      Furniture Contest 2018
    • Fix It! Contest

      Fix It! Contest
    • Metalworking Contest

      Metalworking Contest

    Discussions