Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » IoT Based Solar Power Monitoring System with ESP32
ESP32 Projects IoT Projects

IoT Based Solar Power Monitoring System with ESP32

Mamtaz AlamBy Mamtaz AlamUpdated:March 28, 202412 Comments7 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
IoT Solar Power Monitoring System ESP32
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project we will develop an IoT Based Solar Power Monitoring System using ESP32 WiFi Module. The ESP32 connects to the WiFi Network and uploads the Solar Sensing parameters like Solar Panel Voltage, Temperature, and Light Intensity on Thingspeak Server.

Solar power plants need Solar Panel Monitoring for optimum power output. Solar energy is the future of the energy industry. Countries all around the world are focusing on renewable and clean sources of energy. Sunlight is the most abundant resource available everywhere and each day. We can use Sunlight to generate electricity which is pollution free. There are continuous research and innovations going on to improve the efficiency of solar cells, reduce the cost of manufacturing solar panels and improve power distribution from solar plants. This project is also aimed at innovation to improve the efficiency of solar panels.

IoT Based Solar Power Monitoring System with ESP32 Thingspeak

The project allows the monitoring power output of a solar panel, incident light intensity, and the operating temperature using an ESP32 WiFi + BLE Microcontroller. The Solar Panel and the sensors are precisely connected to the ESP32 controller which supervises the panels and loads. Thus, users can view the voltage, temperature, and Solar Irradiance online from any part of the world.

There are a wide variety of possible uses of this technology, including Solar cities, Smart villages, Microgrids, and Solar street lighting.




Bill of Materials

We need the following components to build an IoT Based Solar Power Monitoring System. You can purchase all the components from Amazon.

S.N.ComponentsQuantityPurchase Link
1ESP32 WiFi Module1Amazon | AliExpress
2Solar Panel (3-25V)1Amazon | AliExpress
3. Voltage Sensor Module1Amazon | AliExpress
4LM35 Temperature Sensor1Amazon | AliExpress
5LDR 1Amazon | AliExpress
616x2 I2C LCD Display 1Amazon | AliExpress
7Resistor 2.2K1Amazon | AliExpress
8Zero PCB/Vero Board1Amazon | AliExpress
9Micro-USB Data Cable1Amazon | AliExpress

0-25V Voltage Sensor Module

The Voltage Sensor Module is a simple but very useful module that uses a potential divider to reduce an input voltage by a factor of 5. The 0-25V Voltage Sensor Module allows you to use the analog input of a microcontroller to monitor voltages much higher than it is capable of sensing.

Voltage Sensor Module

The Voltage Sensor is basically a Voltage Divider consisting of two resistors with resistances of 30KΩ and 7.5KΩ i.e. a 5 to 1 voltage divider. Hence the output voltage is reduced by a factor of 5 for any input voltage. The internal circuit diagram of the Voltage Sensor Module is given below.

For more details on this sensor refer to Voltage Sensor Interfacing guide in one of our previous post.


LM35 Temperature Sensor

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. It has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling.

The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range.

For more info on LM35 Temperature Sensor refer to LM35 Interfacing guide in one of our previous post.



Light Dependent Resistor (LDR)

Light Dependent Resistor or LDR or Photoresistors are electronic components that are often used in electronic circuit designs where it is necessary to detect the presence or the level of light.

LDRs are very different from other forms of resistor like the carbon film resistor, metal oxide film resistor, metal film resistor, and the like that are widely used in other electronic designs. They are specifically designed for their light sensitivity and the change in resistance this causes.


Block Diagram of IoT Solar Power Monitoring System

Let us take a look at a block diagram of IoT Based Solar Power Monitoring System with ESP32. The ESP32 is interfaced with the voltage Sensor, LM-35 temperature sensor, and LDR sensor. These three sensors are used to monitor the power output, temperature, and incident light intensity respectively.

Solar Power Monitoring System Block Diagram

A character LCD is also interfaced with the board for real-time display of the measured parameters. The solar panels are assumed to be installed with internet hotspots at their installation site. The ESP32 not only displays the measured parameters on the LCD screen but also sends the measured values to the Thingsepak cloud server.

The voltage, temperature & light parameters can be monitored in real-time and logged on Thingspeak Server for analytics and performance evaluation.


Circuit: IoT Based Solar Power Monitoring System with ESP32

Let us see the schematic for IoT Based Solar Power Monitoring System with ESP32 WiFi Module.

Circuit IoT Solar Power Monitoring System ESP32

The ESP32 is the main controller for the entire project. There are 3 sensors that directly connect to the GPIO pin of ESP32. The 3 sensors are Voltage Sensor (0-25V), LM35 Temperature Sensor & LDR Sensor.

Connect the input of Voltage Sensor to GPIO14 of ESP32 Board. On the other side of the Voltage, the Sensor connects the Solar Panel with a voltage range between 3V-25V as the voltage sensor’s maximum sensing capacity is 25V only. Similarly, connect the input of the LM35 temperature sensor to the GPIO34 of ESP32. The LDR requires a resistor of 2.2K in series to measure the analog voltage fed to the ESP32 Analog pin. The LDR input pins connect to the GPIO35 of ESP32.

Connect the SDA & SCL pin of I2C LCD Display to GPIO21 & GPIO22 respectively. You can power the LCD Display, & LM35 via 5V pin of ESP32.

Solar Power Monitoring System ESP32



Project PCB Gerber File & PCB Ordering Online

If you don’t want to assemble the circuit on a zero PCB and you want PCB for the project, then here is the PCB for you. I used EasyEDA to design the PCB. The PCB Board for IoT Solar Power Monitoring System looks something like below.

The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from ALLPCB at 1$ only.

Download Gerber File: Solar Power Monitoring System PCB

You can use this Gerber file to order high quality PCB for this project. To do that visit the ALLPCB official website by clicking here: https://www.allpcb.com/.

You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.

After filling all details, select your country and shipping method. Finally you can place the order.

You can assemble the components on the PCB Board.


Setting up Thingspeak Server

ThingSpeak provides very good tool for IoT based projects. By using the ThingSpeak site, we can monitor our data and control our system over the Internet, using the Channels and web pages provided by ThingSpeak. So first you need to sign up for ThingSpeak. So visit https://thingspeak.com and create an account.

Thingspeak Setup

Then create a new channel and create three variables as voltage, temperature & lux.

Then create the API keys. This key is required for programming modifications and receiving data from ESP32 WiFi Module.

Now click on channels so that you can see the online data streaming.


Source Code/Program

The code for IoT Based Solar Power Monitoring System with ESP32 is simple & can be written on Arduino IDE.

The code requires I2C LCD Library for compilation.

From the following lines, you need to change the Thingspeak API Key, WiFi SSID & Password.

1
2
3
String apiKey = "***************";
const char* ssid = "**************";  // Enter your WiFi Network's SSID
const char* pass = "**************";  // Enter your WiFi Network's Password

Now you can upload the following code to ESP32 Board.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#include <WiFi.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
 
const int lm35_pin = 34;
 
const int voltageSensor = 14;
float vOUT = 0.0;
float vIN = 0.0;
float R1 = 30000.0;
float R2 = 7500.0;
int value = 0;
 
 
float RLDR;
float Vout;
float Lux;
 
String apiKey = "***************";
const char* ssid = "**************";  // Enter your WiFi Network's SSID
const char* pass = "**************";  // Enter your WiFi Network's Password
const char* server = "api.thingspeak.com";
 
WiFiClient client;
 
void setup()
{
  Serial.begin(115200);
  lcd.begin();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Welcome To");
  lcd.setCursor(0, 1);
  lcd.print("Our Projects");
  delay(2000);
  lcd.clear();
  Serial.println("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, pass);
 
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(100);
    Serial.print("*");
  }
  Serial.println("");
  Serial.println("WiFi connected");
}
 
void loop()
{
  int temp_adc_val;
  float temp_val;
  float tempF = temp_val * 9 / 5 + 32;
  temp_adc_val = analogRead(lm35_pin); /* Read Temperature */
  temp_val = (temp_adc_val * 4.88);    /* Convert adc value to equivalent voltage */
  temp_val = (temp_val / 10);          /* LM35 gives output of 10mv/°C */
  
  lcd.setCursor(0, 0);
  lcd.print("T:-");
  lcd.print(tempF);
  Serial.print("Temperature = ");
  Serial.print(tempF);
  delay(1000);
 
  value = analogRead(voltageSensor);
  vOUT = (value * 5.0) / 3724.0;
  vIN = vOUT / (R2 / (R1 + R2));
 
  int sensorValue = analogRead(35);
  Vout = (sensorValue * 0.0048828125);
  RLDR = (10000.0 * (3 - Vout)) / Vout;
  Lux = (RLDR / 500);
  lcd.setCursor(10, 0);
  lcd.print("L:");
  lcd.print(Lux);
  delay(1000);
 
  lcd.setCursor(0, 1);
  lcd.print("Solar Volt:");
  lcd.setCursor(12, 1);
  lcd.print(vIN);
 
  if (client.connect(server, 80))
  {
 
    String postStr = apiKey;
    postStr += "&field1=";
    postStr += String(temp_val);
    postStr += "&field2=";
    postStr += String(vIN);
    postStr += "&field3=";
    postStr += String(Lux);
    postStr += "\r\n\r\n\r\n";
 
    client.print("POST /update HTTP/1.1\n");
    delay(100);
    client.print("Host: api.thingspeak.com\n");
    delay(100);
    client.print("Connection: close\n");
    delay(100);
    client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
    delay(100);
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    delay(100);
    client.print("Content-Length: ");
    delay(100);
    client.print(postStr.length());
    delay(100);
    client.print("\n\n");
    delay(100);
    client.print(postStr);
    delay(100);
  }
  client.stop();
  Serial.println("Sending....");
  delay(15000);
}
 
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}




Testing IoT Based Solar Power Monitoring System with ESP32

After uploading code, the ESP32 will connect to the WiFi Network. Then it will establish a connection with Thingspeak Server using the API Key.

At the same time, you can see the Solar Power measuring parameters on the LCD Display.

IoT Solar Power Monitoring System ESP32

To check the proper working of the project, you can take the Solar Panel to a dark room or completely under the sun. There will be massive changes in measuring parameters.

IoT Solar Power Monitoring System ESP32

Similarly, go to the private view of the Thingspeak Server, and you will see the parameters logged in the graphical format along with time intervals.

The data only uploads at an interval of 15 seconds on the Thingspeak Server. You may change the interval to 30 seconds or 1 minute or more according to your requirement.


Video Tutorial & Guide

IoT Based Solar Power Monitoring System with ESP32 & ThingSpeak Server
Watch this video on YouTube.

This project can be modified at the best level using some Solar Charging algorithm called MPPT Charge Controller to increase the efficiency of the Solar Panel output power.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleRaspberry Pi Pico W IoT Weather Station – OpenWeatherMap
Next Article IoT RGB LED Strip Control with Raspberry Pi Pico W & Adafruit IO

Related Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

Updated:June 16, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

Updated:June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

Updated:May 10, 20262K
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

Updated:May 2, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

Updated:April 27, 20261K
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

Updated:April 27, 20262K
View 12 Comments

12 Comments

  1. Diego Martinez on January 7, 2023 8:14 PM

    come posso fare per cambiare i parametri nel codice per leggere la temperatura in C° (celsius) ? grazie
    eccellente progetto 😉

    Reply
  2. Witchdoc on February 13, 2024 11:08 AM

    I’ve got this running on a breadboard but I’ve also purchased 5 PCBs. Could you do a video showing how to assemble the PCB? I’m not clear on how to mount the LCD or the Voltage Sensor.

    Reply
    • Admin on February 13, 2024 11:13 AM

      The LCD and voltage sensor can be connected using any jumper wires.

      Reply
      • Witchdoc on February 13, 2024 2:09 PM

        These components don’t get soldered to the PCB?

  3. Wi on February 16, 2024 5:39 PM

    What does the mapfloat function, at the bottom of the sketch, do? I don’t see it called anywhere in the sketch.

    Reply
  4. Witchdoc on February 16, 2024 5:49 PM

    What does the function mapfloat do? I don’t see it used in the sketch at all. It’s at the bottom of the sketch.

    Reply
    • Admin on February 16, 2024 5:57 PM

      It is used for mapping the float value to convert into percentage.

      Reply
  5. Witchdoc on February 19, 2024 12:16 AM

    On the PCB, why is pin 3 of the LM35 going to pin 13 of the ESP32?

    Reply
  6. Witchdoc on February 25, 2024 1:12 AM

    What program was used to create the gerber files?

    Reply
    • Admin on February 25, 2024 1:12 AM

      Easyeda software

      Reply
  7. Witchdoc on February 26, 2024 12:26 AM

    Would you share the Easyeda schematic that you created the gerber files from?

    Reply
  8. Cesar Walter Gabriel Trombicki on June 19, 2025 11:43 AM

    Excelente proyecto, me encanto !!!

    Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 16, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

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

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.