IoT-Based Solar Panel Temperature Monitoring Using ESP8266 and KiwisIoT

by Varun_Prasad_07 in Circuits > Arduino

53 Views, 0 Favorites, 0 Comments

IoT-Based Solar Panel Temperature Monitoring Using ESP8266 and KiwisIoT

ChatGPT Image Sep 11, 2026, 04_31_49 PM_832x551.png

Solar panels are continuously exposed to sunlight, so their surface temperature can become quite high during the daytime. When the temperature increases, the efficiency of the solar panel can decrease. Monitoring the panel temperature can therefore help identify overheating conditions and support preventive maintenance.

In this project, we will build a simple Solar Panel Temperature Monitoring System using an ESP8266 NodeMCU and a DS18B20 waterproof temperature sensor.

The DS18B20 measures the temperature of the solar panel, while the ESP8266 sends the readings to the KiwisIoT cloud platform through Wi-Fi using MQTT. A local LED is also used as a temperature warning indicator.

The complete system allows us to:

  1. Measure solar panel temperature in real time
  2. Display the temperature on the Serial Monitor
  3. Send temperature data to KiwisIoT
  4. Monitor the temperature remotely through a dashboard
  5. Turn ON an LED when the temperature exceeds the set limit


Supplies


Hardware Components Required

→ 1 × ESP8266 NodeMCU

→ 1 × DS18B20 Waterproof Temperature Sensor

→ 1 × 4.7kΩ Resistor

→ 1 × LED

→ 1 × 220Ω Resistor

→ 1 × Breadboard

→ Jumper Wires – As Required

→ 1 × Micro USB Cable

→ 1 × 5V USB Adapter


Software and Libraries Required

Software

→ Arduino IDE

→ ESP8266 Board Package

→ KiwisIoT Web Dashboard

Libraries

→ ESP8266WiFi – Connects the ESP8266 to a Wi-Fi network.

→ KiwisIoT – Sends sensor data to the KiwisIoT cloud platform.

→ OneWire – Enables communication with the DS18B20 sensor.

→ DallasTemperature – Reads temperature values from the DS18B20 sensor.

Make the Hardware Connections

ds18.jpg
led.png
node mcu_832x551.png

First, connect the DS18B20 temperature sensor and LED to the ESP8266 NodeMCU.

DS18B20 Temperature Sensor

Connect the sensor as follows:

  1. VCC → 3.3V
  2. GND → GND
  3. DATA → D4

The DS18B20 requires a 4.7kΩ pull-up resistor between the DATA pin and 3.3V.

DS18B20 Connection

DS18B20 → ESP8266

VCC → 3.3V

GND → GND

DATA → D4

4.7kΩ resistor → DATA to 3.3V

Place the DS18B20 sensor on the back side of the solar panel so that it can measure the panel temperature.

LED Connection

The LED is used as a local high-temperature indicator.

Connect:

  1. LED Anode (+) → 220Ω resistor → D5
  2. LED Cathode (-) → GND

When the temperature crosses the configured threshold, the ESP8266 turns the LED ON.

Check the Circuit

circuit.png


Before powering the circuit, check all the connections carefully.

The basic working flow is:

Solar Panel → DS18B20 → ESP8266 → Wi-Fi → KiwisIoT

At the same time:

Temperature > Threshold → LED ON

The circuit can be assembled on a breadboard for testing.


Hardware Connections of the Solar Panel Temperature Monitoring System.


Set Up the KiwisIoT Dashboard

add widget_832x551.png
channel config_832x551.png
create a new panel_832x551.png
save panel_832x551.png

Now we need to create a dashboard to display the temperature remotely.

Open the KiwisIoT platform and log in.

Create a new panel/dashboard and copy the generated Topic ID.

The Topic ID will be used in the Arduino program.

For example:

const char* topic = "dash_xxxxxxxxxxxx";

Replace this value with the Topic ID generated for your dashboard.

Add a Temperature Widget

Create a temperature widget such as:

  1. Temperature Gauge
  2. Temperature Display
  3. Numeric Temperature Widget

Configure the widget to receive data from:

Channel 1 → Temperature

The ESP8266 will send the temperature value to Channel 1.

Your dashboard should now be ready to receive the sensor data.

Install Arduino Software and Libraries

We will use the Arduino IDE to program the ESP8266.

Required Board Package

Install the ESP8266 board package using the Arduino Boards Manager.

Select the appropriate ESP8266 NodeMCU board from:

Tools → Board

Required Libraries

Install the following libraries:

  1. ESP8266WiFi
  2. KiwisIoT
  3. OneWire
  4. DallasTemperature

The OneWire library is used for communication with the DS18B20 sensor.

The DallasTemperature library makes it easier to read temperature values from the DS18B20.

Configure Wi-Fi and KiwisIoT

Before uploading the program, change these three values:

const char* ssid = "YOUR_WIFI";
const char* pass = "YOUR_PASSWORD";
const char* topic = "YOUR_TOPIC";

Enter:

  1. Your Wi-Fi name
  2. Your Wi-Fi password
  3. Your KiwisIoT Topic ID

Do not leave the placeholder values unchanged.

Upload the Arduino Code

upload code_832x551.png



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



const char* ssid = "YOUR_WIFI";
const char* pass = "YOUR_PASSWORD";
const char* topic = "YOUR_TOPIC";

KiwisIoT kiwisiot(ssid, pass, topic);



#define ONE_WIRE_BUS D4
#define LED_PIN D5

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

float temperature;

void setup()
{
Serial.begin(115200);

pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);

sensors.begin();
kiwisiot.begin();
}

void loop()
{
kiwisiot.run();

sensors.requestTemperatures();

temperature = sensors.getTempCByIndex(0);

if (temperature > 45)
{
digitalWrite(LED_PIN, HIGH);
}
else
{
digitalWrite(LED_PIN, LOW);
}

// Display temperature on Serial Monitor
Serial.println("----------------------");
Serial.print("Solar Panel Temperature : ");
Serial.print(temperature);
Serial.println(" °C");

// Send temperature to KiwisIoT Channel 1
kiwisiot.send("1", String(temperature));

delay(2000);
}


Upload the Code to ESP8266


Connect the ESP8266 NodeMCU to your computer using a Micro USB cable.

In Arduino IDE:

  1. Select the ESP8266 NodeMCU board.
  2. Select the correct COM/USB port.
  3. Verify the Wi-Fi credentials.
  4. Verify the KiwisIoT Topic ID.
  5. Click Upload.
  6. Wait until the upload is completed.

After uploading, open:

Tools → Serial Monitor

Results and FAQ

output_832x551.png

Result

After uploading the program and connecting the DS18B20 sensor to the solar panel, the system starts measuring the panel temperature.

The ESP8266 NodeMCU reads the temperature from the DS18B20 sensor and sends the data to the KiwisIoT dashboard through Wi-Fi.

The temperature can be viewed in real time on the KiwisIoT temperature widget. The Serial Monitor also displays the current temperature reading.

For example:

Solar Panel Temperature: 42.50 °C

When the temperature rises above the configured threshold of 45°C, the LED turns ON to indicate a high-temperature condition. When the temperature returns to 45°C or below, the LED turns OFF.

The final system provides both local temperature indication using the LED and remote temperature monitoring using KiwisIoT.

Frequently Asked Questions (FAQ)

1. Why is the DS18B20 sensor used in this project?

The DS18B20 is a digital temperature sensor that provides temperature readings with good accuracy and is available in a waterproof probe version, making it suitable for monitoring the temperature near a solar panel.

2. Where should the DS18B20 sensor be placed?

The sensor can be attached to the back surface of the solar panel. Ensure that it is firmly attached and has good thermal contact with the panel surface.

3. Why is a 4.7kΩ resistor required?

The DS18B20 uses a 1-Wire communication interface. A 4.7kΩ pull-up resistor between the DATA line and 3.3V is normally required for reliable communication.

4. Which ESP8266 pin is used for the temperature sensor?

The DS18B20 DATA pin is connected to D4 (GPIO2) of the ESP8266 NodeMCU.

5. Which pin controls the LED?

The LED is connected to D5 (GPIO14) through a 220Ω resistor.

6. At what temperature does the LED turn ON?

In the example program, the LED turns ON when the measured temperature is above 45°C.

if (temperature > 45)
{
digitalWrite(LED_PIN, HIGH);
}

This threshold can be changed according to the requirements of the project.

7. How is the temperature sent to KiwisIoT?

The ESP8266 connects to Wi-Fi and sends the temperature value to KiwisIoT using the configured KiwisIoT topic.

The example program sends the temperature through Channel 1.

8. Can multiple temperature sensors be used?

Yes. The DS18B20 uses the 1-Wire protocol, which supports multiple sensors on the same data bus. The program would need to be modified to identify and read each sensor separately.

9. What happens if the Wi-Fi connection is lost?

The ESP8266 cannot send new temperature readings to the cloud while it is disconnected from Wi-Fi. The local LED and sensor reading can still operate depending on the program's connection-handling logic.

10. Can this project be used for a real solar power plant?

This project is mainly a prototype and monitoring demonstration. For industrial solar installations, additional sensors, protection, weatherproof enclosures, reliable power supplies, data logging, and proper alert/communication systems should be added.

11. Can the temperature threshold be changed?

Yes. Change the value in the condition:

if (temperature > 45)

For example, changing 45 to 50 will make the LED turn ON above 50°C.

12. What can be added to this project in the future?

The system can be expanded by adding:

→ Solar panel voltage monitoring

→ Solar panel current monitoring

→ Power and energy measurement

→ Multiple temperature sensors

→ Historical temperature graphs

→ Cloud-based alerts

→ Mobile monitoring

→ Solar panel efficiency analysis