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
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:
- Measure solar panel temperature in real time
- Display the temperature on the Serial Monitor
- Send temperature data to KiwisIoT
- Monitor the temperature remotely through a dashboard
- 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
First, connect the DS18B20 temperature sensor and LED to the ESP8266 NodeMCU.
DS18B20 Temperature Sensor
Connect the sensor as follows:
- VCC → 3.3V
- GND → GND
- 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:
- LED Anode (+) → 220Ω resistor → D5
- LED Cathode (-) → GND
When the temperature crosses the configured threshold, the ESP8266 turns the LED ON.
Check the Circuit
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
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:
Replace this value with the Topic ID generated for your dashboard.
Add a Temperature Widget
Create a temperature widget such as:
- Temperature Gauge
- Temperature Display
- 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:
- ESP8266WiFi
- KiwisIoT
- OneWire
- 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:
Enter:
- Your Wi-Fi name
- Your Wi-Fi password
- Your KiwisIoT Topic ID
Do not leave the placeholder values unchanged.
Upload the Arduino Code
Upload the Code to ESP8266
Connect the ESP8266 NodeMCU to your computer using a Micro USB cable.
In Arduino IDE:
- Select the ESP8266 NodeMCU board.
- Select the correct COM/USB port.
- Verify the Wi-Fi credentials.
- Verify the KiwisIoT Topic ID.
- Click Upload.
- Wait until the upload is completed.
After uploading, open:
Tools → Serial Monitor
Results and FAQ
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.
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:
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