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 ...

Get Practical Internet of Things with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.