Monitoring the climate from a remote dashboard

Today, most smart homes are connected to the Internet, and this allows the user to monitor their home. In this section, we are going to learn how to monitor your climate remotely. First, we are simply going to add a sensor to our Raspberry Pi Zero and monitor the measurements from a cloud dashboard. Let's see how it works.

The following image shows the final connections:

Monitoring the climate from a remote dashboard

Exploring the sensor test

var sensorLib = require('node-dht-sensor'), 
var sensor = { 
    initialize: function () { 
        return sensorLib.initialize(11, 4); 
    }, 
    read: function () { 
        var readout = sensorLib.read(); 
        console.log('Temperature: ' + readout.temperature.toFixed(2) + 'C, ' + 
            'humidity: ' + readout.humidity.toFixed(2) + '%'), 
        setTimeout(function () { 
            sensor.read(); 
        }, 2000); 
    } 
}; 
 
if (sensor.initialize()) { 
    sensor.read(); 
} else { 
    console.warn('Failed to initialize sensor'), 
} 

Configuring the remote dashboard (Dweet.io)

We need to go to http://freeboard.io and create an account:

Configuring the remote dashboard (Dweet.io)

Now, we create a new dashboard to control the sensor:

Configuring the remote dashboard (Dweet.io)

Add a new data source with the following parameters:

Configuring the remote dashboard (Dweet.io)

Create a new pane inside the dashboard and also create a Gauge widget for the temperature:

Configuring the remote dashboard (Dweet.io)

We will then immediately see the temperature in the interface:

Configuring the remote dashboard (Dweet.io)

We do the same with the Humidity:

Configuring the remote dashboard (Dweet.io)

We should see the final result:

Configuring the remote dashboard (Dweet.io)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.200.35