Connect Raspberry Pi 3 to DHT11 Sensor and Upload Data to ThingsIo.ai Cloud
The goal of this tutorial is to guide you through capturing temperature and humidity data with a DHT11 sensor on a Raspberry Pi 3 and sending it to the ThingsIo.ai cloud platform for storage and visualization.
Overview
This step‑by‑step guide covers hardware setup, Raspberry Pi configuration, ThingsIo.ai account creation, code deployment, and data visualization. Whether you’re a hobbyist or a professional IoT developer, the instructions are clear, concise, and based on proven best practices.
Hardware Requirements
- Raspberry Pi 3 Model B
- Micro‑SD card (8–16 GB)
- DHT11 temperature & humidity sensor
- HDMI cable, Ethernet cable (optional Wi‑Fi)
- Power supply (5 V 2.5 A)
- USB cable for remote access (optional)
Software and Tools
- Raspberry Pi OS (Raspbian Stretch with Desktop) – download link
- SD card formatter – guide
- Win32 Disk Imager (Windows)
- Advanced IP Scanner, Putty, VNC Viewer, XLaunch/Xming (Windows)
- Git, WiringPi (Raspberry Pi)
Part I: Raspberry Pi Setup
- Format the SD card using the SD card formatter and flash the Raspbian image with Win32 Disk Imager.
- Create an empty file named
ssh(no extension) on the boot partition to enable SSH. - Create
wpa_supplicant.confwith your Wi‑Fi credentials: - Insert the SD card, power on the Pi, and locate its IP address using Advanced IP Scanner (
168.0.1‑254or192.168.137.1‑254). - SSH into the Pi with Putty: username
pi, passwordraspberry. - Enable SSH and install VNC:
- Start the VNC server and connect via VNC Viewer from your Windows machine.
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR_SSID"
psk="YOUR_PASSWORD"
}
sudo raspi-config
# Navigate to Interface Options → SSH → Enable
sudo apt-get update && sudo apt-get install tightvncserver
Part II: ThingsIo.ai Cloud Setup
- Register at ThingsIo.ai and verify your email.
- Log in to your dashboard and create a new project.
- Within the project, add a new device to obtain a Device ID.
- Navigate to Sample Device Code → Raspberry Pi to copy the provided Python script.
- Upload the script to the Pi (e.g.,
device.py) and run it to send a trial data packet.
Part III: Wiring and Code Configuration
- Install WiringPi on the Pi:
- Open the script in your preferred editor (Geany, Nano, etc.). Ensure the GPIO pin assignment matches your DHT11 connection.
- Modify the code to reference your Device ID and ThingsIo.ai endpoint.
- Run the script and confirm data appears in the ThingsIo.ai dashboard.
sudo apt-get update
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi
Part IV: Visualizing Data on ThingsIo.ai
- In the device dashboard, enable special parameters (e.g., temperature, humidity).
- Create graphs: select parameters, preview, and save.
- Configure device location if required.
- Use the real‑time chart to monitor sensor readings instantly.
With this setup, your Raspberry Pi continuously streams temperature and humidity data to the ThingsIo.ai cloud, where you can analyze trends, set alerts, and integrate with other services.
Further Resources
For deeper exploration, consult the official Raspberry Pi documentation, DHT11 datasheet, and ThingsIo.ai developer guides.
Manufacturing process
- Build a Raspberry Pi Temperature Logger with a $5 I2C Sensor
- Build a Raspberry Pi Weather Station that Emails Daily Weather Data
- Beginner IoT Tutorial: Streaming Temperature Data from a Raspberry Pi
- Connecting HC‑SR04 Ultrasonic Sensor to Raspberry Pi 3 – A Complete Guide
- Control an LED with a PIR Motion Sensor on Raspberry Pi
- Build a Low‑Cost Raspberry Pi Soil Moisture Sensor for Smart Irrigation
- Build Your First IoT Project with Raspberry Pi, DHT11, and ThingSpeak
- Build a Raspberry Pi Home Temperature Monitor with MCP9808, InfluxDB & Grafana
- Send Adafruit 10DOF IMU Data from Raspberry Pi 2 to Azure Event Hubs with Windows 10 IoT Core
- Build a Windows IoT Core Rover with Raspberry Pi 2 – Beginner to Advanced Guide