Big Data 11 min read

Build a Raspberry Pi Temp‑Humidity Dashboard Using Alibaba Cloud Big Data

This guide walks through creating a home temperature‑humidity monitoring system with a Raspberry Pi and DHT11 sensor, collecting data via JavaScript, sending it to Alibaba Cloud SLS, processing it through DataWorks and MaxCompute, and visualizing the results in QuickBI dashboards.

Alibaba Terminal Technology
Alibaba Terminal Technology
Alibaba Terminal Technology
Build a Raspberry Pi Temp‑Humidity Dashboard Using Alibaba Cloud Big Data

During the hot summer, the author decided to use a Raspberry Pi to collect temperature and humidity data, process it with big‑data tools, and generate visual reports for the home.

Big data processing workflow overview

Data generation: Business systems produce large amounts of data and logs.

Data collection & storage: Use DataWorks integration to sync various sources to MaxCompute.

Data analysis & processing: Perform offline ETL in MaxCompute or real‑time processing with Flink and Hologres.

Data application: Visualize and share results via reports.

1. Data Generation

The Raspberry Pi connects to a DHT11 temperature‑humidity sensor, reads data every 2 seconds with JavaScript, and reports it to Alibaba Cloud SLS for storage.

What is Raspberry Pi

A credit‑card‑sized ARM‑based single‑board computer with GPIO pins for hardware interaction.

What is GPIO programming

General‑purpose I/O pins can be configured as input or output to communicate with external devices.

DHT11 sensor

The sensor measures humidity (20‑90%) and temperature (0‑50 °C) with a sampling period of at least 1 second.

Data collection and reporting

Connecting the sensor’s data pin to GPIO 21, the following JavaScript code reads the values using the read method from the node-dht-sensor library:

const sensor = require("node-dht-sensor");
const SENSOR_TYPE = 11; // DHT11
const GPIO_PIN = 21; // GPIO pin number
sensor.read(SENSOR_TYPE, GPIO_PIN, function (err, temperature, humidity) {
    if (!err) {
        console.log("temperature", temperature, "humidity", humidity);
    }
});

Data is then reported to SLS every 2 seconds:

const sensor = require("node-dht-sensor");
const SLS = require("./sls"); // simple wrapper for SLS SDK
const projectName = "custom";
const logStoreName = "custom";
const reporter = new SLS(projectName);
const SENSOR_TYPE = 11;
const GPIO_PIN = 21;
setInterval(() => {
    sensor.read(SENSOR_TYPE, GPIO_PIN, function (err, temperature, humidity) {
        if (!err) {
            reporter.put(logStoreName, { temperature, humidity });
        }
    });
}, 2000);

Run the script continuously with pm2:

$ pm2 start dht11.js

2. Data Collection & Storage

The goal is to sync SLS logs to MaxCompute every 5 minutes for near‑real‑time analysis. Steps include creating an ODS table (named with the ods_ prefix), using the data integration tool to sync logs, mapping the receive time field __receive_time__, scheduling the task with time parameters, and verifying the data via a temporary query tool.

3. Data Analysis & Processing

In DataWorks, build the data‑warehouse layers according to standard practices:

ODS layer – raw 1:1 data from SLS.

DWD layer – cleaned data with timestamps converted and comfort flag added.

DWS layer – aggregated views for the latest hour (per‑minute) and daily (per‑hour) summaries.

ADS layer – business‑oriented results such as daily comfort rate.

Desired output metrics:

Temperature‑humidity per minute for the last hour.

Temperature‑humidity per hour with comfort assessment.

Daily comfort rate.

Personal definitions (for reference): Comfort zone: temperature 22‑26 °C, humidity 40‑70 %. Comfort rate = (comfortable hours / total recorded hours) × 100 %.

4. Data Application

Connect MaxCompute to QuickBI, create a data source, then a dataset to adjust field names and formats, and finally build a dashboard with appropriate charts and filters.

5. Conclusion

By collecting temperature and humidity data and visualizing it, the dormant Raspberry Pi gains new life, demonstrating that big‑data processing is accessible to everyday users. The article encourages readers to experiment with data collection and analysis in their own environments.

big dataIoTDataWorksAlibaba Cloudraspberry-piDHT11QuickBI
Alibaba Terminal Technology
Written by

Alibaba Terminal Technology

Official public account of Alibaba Terminal

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.