Close Menu
Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
Circuit of Things Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc
Hire us
Circuit of Things
Home»ESP8266 Projects»NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform
ESP8266 Projects

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

Sai Preetham KoyyalaBy Sai Preetham KoyyalaMay 4, 2026No Comments2 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Share
Facebook Twitter LinkedIn Pinterest Email
Contents
  • Introduction
  • Components Needed
  • Step 1: Create ThingSpeak Channel
  • Install Libraries
  • The Code
  • Viewing Your Dashboard
  • Conclusion

Introduction

ThingSpeak is a free IoT analytics platform by MathWorks that lets you collect, visualize, and analyze sensor data from your microcontrollers. In this tutorial, we connect an ESP8266 NodeMCU to ThingSpeak and create a live temperature and humidity dashboard visible from anywhere in the world.

Components Needed

  • ESP8266 NodeMCU
  • DHT11 or DHT22 sensor
  • Free ThingSpeak account (thingspeak.com)

Step 1: Create ThingSpeak Channel

  1. Sign up at thingspeak.com.
  2. Click New Channel and create two fields: Field 1 = Temperature, Field 2 = Humidity.
  3. Save and note your Write API Key from the API Keys tab.

Install Libraries

Install ThingSpeak by MathWorks and DHT sensor library by Adafruit via the Library Manager.

The Code

#include <ESP8266WiFi.h>
#include <ThingSpeak.h>
#include <DHT.h>
#define DHTPIN D4
#define DHTTYPE DHT11
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
const char* apiKey = "YOUR_THINGSPEAK_WRITE_API_KEY";
unsigned long channelID = 1234567; // Your channel ID
WiFiClient client;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
  ThingSpeak.begin(client);
  Serial.println("Connected!");
}
void loop() {
  float t = dht.readTemperature();
  float h = dht.readHumidity();
  if (!isnan(t) && !isnan(h)) {
    ThingSpeak.setField(1, t);
    ThingSpeak.setField(2, h);
    int code = ThingSpeak.writeFields(channelID, apiKey);
    Serial.println(code == 200 ? "Data sent!" : "Error: " + String(code));
  }
  delay(20000); // ThingSpeak requires min 15s between updates
}

Viewing Your Dashboard

Go to your ThingSpeak channel and click the Private View tab. You will see beautiful auto-updating charts for temperature and humidity!

Conclusion

ThingSpeak is one of the fastest ways to get an IoT cloud dashboard up and running. With its built-in MATLAB analytics, you can also set alerts, perform calculations, and export data for machine learning projects.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleESP32 Firebase Realtime Database: Send and Receive Data from the Cloud
Next Article Relay Module with Arduino: Control High Voltage Appliances Safely
Sai Preetham Koyyala
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

Hello, I am Sai Preetham Koyyala. I'm an electronics engineer by profession, a DIY enthusiast by passion. ESP32 and Arduino are the main topics of my work.

Related Posts

ESP32 Projects

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026
ESP8266 Projects

ESP8266 NodeMCU Web Server: Control LEDs from Any Browser

May 4, 2026
ESP32 Projects

ESP32 MQTT Tutorial: Publish and Subscribe with HiveMQ

May 4, 2026
Add A Comment
Leave A Reply Cancel Reply


KSP Electronics
✓ Trusted Store
Everything for Your
Next IoT Build
Boards, sensors, modules & kits delivered fast across India.
ESP32 Arduino Sensors Modules DIY Kits
500+
Products
Fast
Delivery
★★★★★
Rated
🛒 Shop Now →
kspelectronics.in
💻
● Available for Projects
Hire Me for
IoT Projects
ESP32, LoRaWAN, cloud dashboards & custom hardware — end-to-end IoT solutions for your needs.
ESP32 LoRaWAN MQTT Arduino Cloud PCB Design
3+
Yrs Exp
20+
Projects
★★★★★
Rated
💬 Chat on WhatsApp
View services →
Top Posts

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Follow Us
  • Telegram

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Most Popular

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Our Picks

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

May 4, 2026

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

© 2026 Circuit of Things. All Rights Reserved. Built with ❤️ for the Maker Community.

  • About
  • Privacy
X (Twitter) Instagram YouTube WhatsApp
  • Book an Appointment
  • My Bookings
  • Support Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

Type above and press Enter to search. Press Esc to cancel.