Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Weather & Environmental Monitoring

Thingspeak Weather Dashboard: Upload Sensor Data from ESP32

Thingspeak Weather Dashboard: Upload Sensor Data from ESP32

March 11, 2026 /Posted byJayesh Jain / 0

Building a ThingSpeak weather dashboard with ESP32 and sensor data upload is one of the best ways for Indian makers to visualise and share environmental monitoring data online for free. ThingSpeak is MathWorks’ IoT analytics platform that offers free hosting for up to 8 channels, with MATLAB-powered visualisation and built-in alerts. This tutorial shows you how to connect an ESP32 reading BME280 weather data to ThingSpeak, create live dashboards, and set up email alerts when temperature or humidity crosses critical thresholds.

Table of Contents

  • What is ThingSpeak and Why Use It?
  • Setting Up Your ThingSpeak Channel
  • Hardware Components Required
  • ESP32 Code for ThingSpeak Upload
  • Creating a Weather Dashboard
  • Setting Up ThingTweet and Email Alerts
  • MATLAB Analysis for Weather Data
  • Frequently Asked Questions

What is ThingSpeak and Why Use It?

ThingSpeak (thingspeak.com) is a free IoT platform owned by MathWorks that allows devices to send sensor data over HTTP or MQTT and visualise it on customisable dashboards. Unlike Blynk or Cayenne, ThingSpeak is particularly powerful because of its integrated MATLAB analytics capabilities, allowing you to perform statistical analysis, create MATLAB Visualisations, and run automated analysis scripts on your weather data.

Free tier limitations to be aware of:

  • Maximum 8 channels per account
  • Minimum 15-second interval between data updates
  • 3 million messages per year (approximately 6 messages per minute on average)
  • Data stored indefinitely (previously 60 days; now unlimited for free accounts)

For most Indian hobbyist weather stations logging every minute or every 5 minutes, the free tier is more than adequate.

Recommended: GY-BME280-3.3 Precision Atmospheric Pressure Sensor — The ideal all-in-one sensor for ThingSpeak weather dashboards: temperature, humidity, and pressure in a single compact module.

Setting Up Your ThingSpeak Channel

  1. Go to thingspeak.com and create a free account using your email
  2. Click Channels → New Channel
  3. Name your channel (e.g., “Bangalore Rooftop Weather Station”)
  4. Enable the fields you want to log:
    • Field 1: Temperature (°C)
    • Field 2: Humidity (%)
    • Field 3: Pressure (hPa)
    • Field 4: Heat Index (°C)
  5. Click Save Channel
  6. Note your Channel ID and Write API Key from the API Keys tab

Your Write API Key is a 16-character alphanumeric string like XXXXXXXXXXXXXXXX. Keep this private—anyone with this key can write data to your channel.

Hardware Components Required

  • ESP32 development board
  • BME280 sensor (I2C version)
  • Jumper wires
  • USB power supply or 5V adapter
  • Wi-Fi network with internet access (2.4GHz; ESP32 does not support 5GHz Wi-Fi)
Recommended: Waveshare BME280 Environmental Sensor — Industrial-grade BME280 with high long-term stability, perfect for permanent indoor or outdoor weather monitoring installations.

ESP32 Code for ThingSpeak Upload

Install the following libraries via Arduino IDE Library Manager:

  • Adafruit BME280 Library
  • Adafruit Unified Sensor
  • ThingSpeak (by MathWorks)
#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_BME280.h>
#include "ThingSpeak.h"

// WiFi credentials
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

// ThingSpeak settings
unsigned long channelID = 1234567;  // Replace with your channel ID
const char* writeAPIKey = "XXXXXXXXXXXXXXXX";  // Replace with your Write API Key

Adafruit_BME280 bme;
WiFiClient client;

float calculateHeatIndex(float temp, float humidity) {
  // Steadman's heat index formula
  return -8.78469475556 + 1.61139411 * temp + 2.33854883889 * humidity
         - 0.14611605 * temp * humidity - 0.012308094 * temp * temp
         - 0.016424828 * humidity * humidity + 0.002211732 * temp * temp * humidity
         + 0.00072546 * temp * humidity * humidity
         - 0.000003582 * temp * temp * humidity * humidity;
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  
  if (!bme.begin(0x76)) {
    Serial.println("BME280 not found!");
    while (1);
  }
  
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("nConnected! IP: " + WiFi.localIP().toString());
  
  ThingSpeak.begin(client);
}

void loop() {
  float temp = bme.readTemperature();
  float humidity = bme.readHumidity();
  float pressure = bme.readPressure() / 100.0F;
  float heatIndex = calculateHeatIndex(temp, humidity);
  
  ThingSpeak.setField(1, temp);
  ThingSpeak.setField(2, humidity);
  ThingSpeak.setField(3, pressure);
  ThingSpeak.setField(4, heatIndex);
  
  int responseCode = ThingSpeak.writeFields(channelID, writeAPIKey);
  
  if (responseCode == 200) {
    Serial.printf("Uploaded: T=%.1f°C H=%.1f%% P=%.1fhPa HI=%.1f°Cn",
                  temp, humidity, pressure, heatIndex);
  } else {
    Serial.println("Error: " + String(responseCode));
  }
  
  delay(60000);  // Upload every 60 seconds
}

Creating a Weather Dashboard

ThingSpeak offers several widget types for dashboard creation:

  • Line Chart: Show temperature or humidity trends over time. Go to your channel, click Add Widgets → Chart → select your field. Configure the time range (last hour, day, week) and styling.
  • Gauge: Show current value as a circular gauge. Ideal for humidity (0–100%) and temperature. Set min/max and colour zones for visual alerts.
  • Numeric Display: Show the latest reading as a large number. Good for pressure readings.
  • Maps: Show your station’s location on a map (requires latitude/longitude upload).

To make your dashboard public (shareable), go to Channel Settings → check “Make Public” → save. You can then share the URL thingspeak.com/channels/YOUR_CHANNEL_ID with anyone without them needing a ThingSpeak account.

Setting Up ThingTweet and Email Alerts

ThingSpeak’s React feature runs conditions when data arrives and triggers actions:

  1. Click Apps → React → New React
  2. Set Condition Type: Numeric
  3. Test Frequency: On Data Insertion
  4. Condition: Channel 1234567, Field 1 (Temperature), > 40
  5. Action: ThingHTTP (send to an email webhook) or ThingTweet (post to Twitter)
  6. Options: Run action each time condition is met

For email alerts in India, using ThingHTTP to call an IFTTT webhook connected to Gmail is the most reliable approach, as ThingSpeak’s native email functionality has been inconsistent for some Indian email providers.

MATLAB Analysis for Weather Data

ThingSpeak’s MATLAB integration is its most powerful feature. Create MATLAB Visualisations that run in ThingSpeak’s cloud to analyse your data:

% MATLAB code for ThingSpeak Analysis
% Calculate daily average temperature
channelID = 1234567;
readAPIKey = 'XXXXXXXXXXXXXXXX';

% Read last 7 days of data
[data, time] = thingSpeakRead(channelID, 'Fields', 1, ...
    'DateRange', [datetime('now')-7, datetime('now')], ...
    'ReadKey', readAPIKey);

% Calculate daily averages
dailyAvg = groupsummary(data, time, 'day', 'mean');

% Plot
bar(dailyAvg)
title('Daily Average Temperature (Last 7 Days)')
ylabel('Temperature (°C)')
xlabel('Day')
Recommended: GY-BME280-5V Temperature and Humidity Sensor — Affordable and widely available BME280 module for ThingSpeak weather logging projects; compatible with 5V Arduino boards with no level shifting needed.

Frequently Asked Questions

Why is my ESP32 failing to upload to ThingSpeak intermittently?

The most common causes are: (1) Wi-Fi disconnection—add reconnect logic to your loop; (2) Uploading faster than 15-second minimum interval—ThingSpeak returns error 401 for rate-exceeded uploads; (3) ISP blocking port 80—try using ThingSpeak’s MQTT API on port 1883 instead of HTTP. Also check your router’s DHCP lease—if the ESP32’s IP address changes and it doesn’t reconnect properly, uploads will fail.

Can I access ThingSpeak data in India on a slow connection?

ThingSpeak loads reasonably well on 4G connections but can be slow on 2G/3G. The API itself is lightweight—data upload via HTTP GET or MQTT is just a few hundred bytes. The dashboard web interface may be slow to load on slow connections due to JavaScript charting libraries. Consider using the REST API to fetch data and display it on your own lightweight webpage.

How do I handle Wi-Fi reconnection in ESP32 code?

Add this check at the beginning of your loop: if (WiFi.status() != WL_CONNECTED) { WiFi.reconnect(); delay(5000); return; }. For more robust reconnection, use WiFi.setAutoReconnect(true) in setup(). In areas with frequent power outages common in rural India, also configure the ESP32 to save Wi-Fi credentials in NVS (non-volatile storage) so it reconnects automatically after power restoration.

Is there a free alternative to ThingSpeak for IoT weather dashboards?

Yes, several alternatives exist: Grafana Cloud (free tier with generous limits), InfluxDB Cloud (free tier), Adafruit IO (10 feeds free), and Node-RED with a self-hosted dashboard. For Indian makers wanting to self-host to avoid international data upload latency, running InfluxDB + Grafana on an old Android phone or Raspberry Pi is a popular approach that gives you unlimited data storage and zero recurring cost.

How do I add multiple ESP32 weather stations to one ThingSpeak account?

Create a separate channel for each station. ThingSpeak allows 8 channels on the free tier. Each ESP32 uses its own Write API Key (from its respective channel’s API Keys tab). Use MATLAB Analysis to merge data from multiple channels for comparative dashboards. If you need more than 8 channels, consider upgrading to ThingSpeak Commercial or migrating to InfluxDB which has no channel limits.

Shop ESP32 & Weather Sensors at Zbotic →

Tags: BME280, ESP32, iot, MQTT, thingspeak, weather dashboard
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Pressure Transmitter Calibrati...
blog pressure transmitter calibration 4 20ma zero and span 598088
blog gold vs hasl vs enig pcb finish which should you choose 598107
Gold vs HASL vs ENIG PCB Finis...

Related posts

Svg%3E
Read more

Climate Education Kit: Build and Learn About Weather

April 1, 2026 0
Table of Contents Weather Education in Indian Schools Designing a STEM Weather Kit Sensor Experiments for Students Curriculum-Aligned Activities Arduino... Continue reading
Svg%3E
Read more

Citizen Science Weather: Contribute Data to IITM Pune

April 1, 2026 0
Table of Contents Citizen Science Weather in India Data Quality Standards for Contribution Setting Up a WMO-Compatible Station Calibration and... Continue reading
Svg%3E
Read more

Weather Station Network: Multiple Stations with Gateway

April 1, 2026 0
Table of Contents Why Build a Weather Station Network LoRa Communication for Sensor Nodes Gateway Design with Raspberry Pi Sensor... Continue reading
Svg%3E
Read more

Cyclone Tracker Display: Real-Time IMD Data on Screen

April 1, 2026 0
Table of Contents Cyclone Tracking in India IMD Cyclone Data Sources ESP32 and TFT Display Setup Fetching and Parsing Cyclone... Continue reading
Svg%3E
Read more

Monsoon Onset Predictor: Historical Data Analysis India

April 1, 2026 0
Table of Contents Understanding Monsoon Onset in India Key Indicators for Monsoon Prediction Sensor Package for Monsoon Monitoring Collecting Baseline... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now