O'Reilly logo

Practical Internet of Things with JavaScript by Arvind Ravulavaru

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Raspberry Pi and DHT11

Refer to the following table:

Raspberry Pi number - pin name

Sensor name - pin number

3 - GPIO2

DHT11 - Data

 

All grounds and all 3.3V are connected to a common point.

Once we have connected the sensors as shown previously, we will write the code needed to interface with the sensors.

Before we go further, we are going to copy the entire Chapter 2, IoTFW.js - I, and Chapter 3, IoTFW.js - II, code into another folder named chapter4.

The chapter4 folder should look as shown here:

.├── api-engine│ ├── package.json│ └── server├── broker│ ├── certs│ └── index.js├── desktop-app│ ├── app│ ├── freeport.js│ ├── index.css│ ├── index.html│ ├── index.js│ ├── license│ ├── package.json│ ├── readme.md│ └── server.js ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required