IoT Temperature Monitoring Using ESP8266, DS18B20 & KiwisIoT Dashboard

by kggopi666 in Circuits > Sensors

51 Views, 1 Favorites, 0 Comments

IoT Temperature Monitoring Using ESP8266, DS18B20 & KiwisIoT Dashboard

37593b76-e625-44ab-b36b-4d23d3817301.png

Are you looking to build a reliable, real-time IoT temperature monitoring system for your home, greenhouse, or server room? In this Instructable, I will guide you through creating a wireless temperature logger using an ESP8266 (NodeMCU) and a waterproof DS18B20 sensor. Instead of using complex platforms, we will be using the incredibly user-friendly KiwisIoT platform (kiwisiot.in) to visualize our sensor data on a beautiful web dashboard.

This guide is optimized for beginners and answers the most common queries on how to connect a DS18B20 to an ESP8266 and how to display live sensor logs on a cloud UI.

Supplies

Temperature-Sensor-DS18B20.png
51ksg8zcq_l_9bf9cdb1-62ee-4587-9481-cf36e3441a91_1000x.jpg
80_1000x.png
71iRFutvGJL._AC_UF350,350_QL80_.jpg

Hardware Required:

  1. NodeMCU ESP8266 Development Board
  2. DS18B20 Waterproof Temperature Sensor
  3. 4.7k ohm resistor &Jumper Wires
  4. Micro-USB Cable

Software Required:

  1. Arduino IDE 1.8.19 (Highly recommended for its stability and excellent library compatibility).
  2. Internet connection for the ESP8266.
  3. kiwisiot library in arduino libraries

Wiring the ESP8266 and DS18B20

Screenshot 2026-09-11 142333.png

The DS18B20 communicates using the 1-Wire protocol, which requires a pull-up resistor to function correctly

. Connect the components as follows:

  1. DS18B20 RED (VCC) ➔ ESP8266 3.3V
  2. DS18B20 BLACK (GND) ➔ ESP8266 GND
  3. DS18B20 YELLOW/WHITE (Data) ➔ ESP8266 D4 (GPIO2)
  4. 4.7k Resistor ➔ Connect between the 3.3V and Data pins.


Setting Up Arduino IDE 1.8.19 & Installing Libraries

  1. Open Arduino IDE 1.8.19.
  2. Go to File > Preferences and add the ESP8266 board manager URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json
  3. Go to Tools > Board > Boards Manager, search for ESP8266, and install the package.
  4. Next, go to Sketch > Include Library > Manage Libraries and install the following:
  5. OneWire (by Paul Stoffregen)
  6. DallasTemperature (by Miles Burton)
  7. KiwisIoT (Search for KiwisIoT and install the latest version)

Creating a Dashboard on KiwisIoT (kiwisiot.in)

To receive the sensor logs, we need a destination on the cloud.

  1. Visit https://kiwisiot.in and create a free account
  2. Click on Create a New Dashboard.
  3. Add a Gauge Widget or a Line Chart Widget to your UI panel to display the temperature.
  4. Important: Go to your dashboard settings and copy your Dashboard Topic ID (it usually looks like dash_1788004717916)
  5. Note the Channel ID assigned to your widget (usually 1).


The Arduino Code

Copy the code below into your Arduino IDE. Make sure to replace the Wi-Fi credentials and the Dashboard Topic ID with your own.

#include <ESP8266WiFi.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <KiwisIoT.h>

// 1. Enter your Wi-Fi credentials
const char* ssid = "YOUR_WIFI_SSID";
const char* pass = "YOUR_WIFI_PASSWORD";

// 2. Enter your KiwisIoT Dashboard Topic ID (Dash ID)
const char* topic = "YOUR_DASHBOARD_TOPIC_ID";

// DS18B20 Data wire is plugged into pin D4 (GPIO2) on ESP8266
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature
DallasTemperature sensors(&oneWire);

// Initialize KiwisIoT object with SSID, Password, and Dash ID
KiwisIoT kiwisiot(ssid, pass, topic);

void setup() {
Serial.begin(115200);
delay(100);
Serial.println("Starting DS18B20 Temperature Monitor...");
// Start up the DS18B20 library
sensors.begin();
// Connect to Wi-Fi and initialize KiwisIoT MQTT
kiwisiot.begin();
}

void loop() {
// Issue a global temperature request to all devices on the bus
sensors.requestTemperatures();
// Read temperature in Celsius
float tempC = sensors.getTempCByIndex(0);
// Check if reading is valid
if(tempC != DEVICE_DISCONNECTED_C) {
Serial.print("Temperature: ");
Serial.print(tempC);
Serial.println(" °C");
// 3. Send the temperature value to KiwisIoT Channel "1"
kiwisiot.send("1", String(tempC));
} else {
Serial.println("Error: Could not read temperature data. Check wiring!");
}
// Wait 2 seconds before taking the next reading
delay(2000);
}

Uploading and Monitoring Sensor Logs

3310e4d5-bdd7-4cbd-9e89-9330bf8bcc30.png
  1. Connect your ESP8266 to your PC.
  2. In Arduino IDE 1.8.19, go to Tools and select NodeMCU 1.0 (ESP-12E Module).
  3. Select the correct COM Port.
  4. Click Upload.
  5. Once uploaded, open the Serial Monitor (set to 115200 baud). You will see the ESP8266 connect to Wi-Fi and start printing the sensor logs locally.

Displaying Values in KiwiSIoT Panels (UI)

ChatGPT Image Sep 11, 2026, 02_46_07 PM.png

Once the ESP8266 successfully connects, it uses the MQTT protocol to transmit the sensor data directly to the KiwiSIoT cloud platform kiwisiot.in

Refresh your KiwiSIoT web dashboard. The UI panel will instantly reflect the live temperature updates on the gauge or chart you configured! The visual feedback makes it incredibly easy to monitor environmental conditions remotely without writing a single line of frontend web code.

My Experience

I have extensively used Blynk for various IoT projects in the past. Blynk is undoubtedly a powerful platform with a massive community. However, over time, I found its token management, virtual pin assignments, and app-centric UI to be slightly overwhelming for simple monitoring tasks.

Recently, I switched to KiwisIoT, and I must say, KiwisIoT is significantly more user-friendly. Setting up the dash id (Dashboard Topic ID) and mapping widget channels is incredibly intuitive. The web-based UI panels are clean, responsive, and don't require you to keep a mobile app open to view your data. For beginners and developers looking for a quick, frictionless IoT dashboard, KiwiSIoT wins hands down in terms of ease of use!

FAQs

Q: How do I connect a DS18B20 temperature sensor to an ESP8266? A: Connect the Red wire to 3.3V, Black to GND, and the Data (Yellow) wire to GPIO2 (D4). You must place a 4.7k pull-up resistor between the 3.3V and the Data wire.

Q: What is the best IoT dashboard platform for ESP8266 beginners? A: While Blynk is popular, KiwiSIoT (kiwisiot.in) is highly recommended for beginners due to its simple kiwisiot.send() library syntax and highly intuitive web-based dashboard UI.

Q: Why use Arduino IDE 1.8.19 for this project? A: Arduino IDE 1.8.19 is known for its stability and broad compatibility with legacy and modern ESP8266 board managers, ensuring smooth compilation of the OneWire and KiwiSIoT libraries.

Q: How do I fix "Error: Could not read temperature data"? A: This usually happens if the 4.7k pull-up resistor is missing, the wiring is loose, or the DS18B20 sensor is damaged. Double-check your physical connections.