Solar Power Monitoring Device Using ESP32, DC Current and Voltage Sensors for Online Monitoring

Solar Power Monitoring Device Using ESP32, DC Current and Voltage Sensors for Online Monitoring

As the demand for renewable energy grows, solar power systems are becoming more widespread. However, maintaining optimal performance and ensuring the system's efficiency requires monitoring key parameters like voltage, current, and power output. With the advancements in IoT technology, it’s now possible to build a Solar Power Monitoring Device using an ESP32 microcontroller, DC current and voltage sensors, and online monitoring capabilities. This article outlines how to design and implement such a system, providing real-time data access and system control remotely.

Why Monitor Solar Power Systems?

Monitoring solar power systems offers several benefits:

  1. Optimize Performance: Monitoring helps to ensure that the system is working at maximum efficiency.
  2. Prevent Failures: Real-time monitoring allows for early detection of issues such as poor connections, faulty wiring, or malfunctioning panels.
  3. Track Power Generation: It enables you to track the amount of power generated daily, weekly, or monthly, ensuring you’re getting the most from your system.
  4. Remote Control: With IoT integration, the system can be accessed remotely, allowing you to monitor and control your solar setup from anywhere.

Components Required

Here’s what you’ll need to build the Solar Power Monitoring Device:

  • ESP32 Microcontroller: A powerful and versatile microcontroller with built-in Wi-Fi and Bluetooth for IoT functionality.
  • DC Voltage Sensor: A sensor to measure the voltage from the solar panels or battery.
    • Example: Voltage Divider Circuit (or INA219 for both voltage and current measurement)
  • DC Current Sensor: A sensor to measure the current flowing from the solar panel or battery.
    • Example: ACS712 Current Sensor or INA219
  • LCD Display (Optional): To locally display real-time voltage, current, and power.
  • Wi-Fi Module (ESP32’s built-in): For sending data to a cloud platform for remote monitoring.
  • Cloud IoT Platform: To monitor and analyze data remotely (e.g., Blynk, ThingSpeak, Firebase, or custom server).
  • Power Supply: 5V power supply for the ESP32 and sensors.
  • Jumper Wires: For making connections.
  • PCB (Optional): For a cleaner, more professional build.

Working Principle

The Solar Power Monitoring Device measures the voltage and current coming from the solar panel or battery using sensors connected to the ESP32. The ESP32 then processes the sensor data and calculates the power output of the solar system. The processed data is displayed on an LCD screen (optional) for local monitoring and is sent over Wi-Fi to a cloud platform for remote monitoring and data logging.

Key Features:

  • Real-time Voltage and Current Measurement: Accurate tracking of the solar panel’s output.
  • Power Calculation: Using the formula:
    Power (W)=Voltage (V)×Current (A)\text{Power (W)} = \text{Voltage (V)} \times \text{Current (A)}
  • Online Monitoring: Via Wi-Fi, data is sent to a cloud platform for remote access and historical analysis.
  • Alerts and Notifications: Users can set up notifications when voltage or current drops below or exceeds certain thresholds.
  • Historical Data Analysis: The system can track solar performance over time, providing insights for maintenance and optimization.

Schematic Diagram

Below is a basic schematic diagram showing the connections between the ESP32, current and voltage sensors, and the solar system.

Key Connections:

  • Voltage Sensor: Connect the voltage sensor across the terminals of the solar panel or battery to measure the DC voltage. If using a voltage divider, ensure the resistor values are appropriate for the voltage range.
  • Current Sensor: The current sensor should be placed in series with the solar panel’s positive output to measure the current flowing to the load or battery.
  • ESP32: The sensors connect to the ESP32’s analog input pins (e.g., GPIO34 for voltage and GPIO35 for current).
  • Wi-Fi: The ESP32’s built-in Wi-Fi module connects to your home network or a mobile hotspot to send data to a cloud platform.

Software and Code

The software consists of three main parts:

  1. Reading Sensor Data: Measuring the voltage and current using the sensors.
  2. Power Calculation: Calculating the solar power output based on the sensor data.
  3. Online Monitoring: Sending data to the cloud for remote monitoring.

Step 1: Sensor Data Acquisition

#define VOLTAGE_SENSOR_PIN 34 // Example pin for voltage sensor
#define CURRENT_SENSOR_PIN 35 // Example pin for current sensor
float voltage = 0.0;
float current = 0.0;

void setup()
{
Serial.begin(115200);
pinMode(VOLTAGE_SENSOR_PIN, INPUT);
pinMode(CURRENT_SENSOR_PIN, INPUT);
// Wi-Fi setup here (for cloud communication)
}
void loop()
{
voltage = analogRead(VOLTAGE_SENSOR_PIN) * (reference_voltage / ADC_resolution) * voltage_scale_factor;
current = analogRead(CURRENT_SENSOR_PIN) * (reference_voltage / ADC_resolution) * current_scale_factor;
float power = voltage * current;
Serial.print("Voltage: ");
Serial.println(voltage);
Serial.print("Current: ");
Serial.println(current);
Serial.print("Power: ");
Serial.println(power);
// Send data to cloud platform (via Wi-Fi)
delay(2000); // Wait for 2 seconds before next reading
}

In this example, replace voltage_scale_factor and current_scale_factor with values determined by the specific sensors you are using.

Step 2: Cloud Platform Integration

To send the sensor data to the cloud, you can use platforms like Blynk. For example, if using Blynk:

#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "YourBlynkAuthToken"; // Blynk Auth Token
char ssid[] = "YourWiFiSSID"; // Wi-Fi SSID
char pass[] = "YourWiFiPassword"; // Wi-Fi Password

void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
// Send sensor data to Blynk app
Blynk.virtualWrite(V1, voltage);
Blynk.virtualWrite(V2, current);
Blynk.virtualWrite(V3, power);
Blynk.run();
}

In the Blynk app, you can create virtual pins (V1, V2, V3) to display voltage, current, and power in real-time.

Step 3: Power Calculation

The power generated by the solar panel can be calculated using the formula:

xmlns="http://www.w3.org/1998/Math/MathML">Power (W)=Voltage (V)×Current (A)\text{Power (W)} = \text{Voltage (V)} \times \text{Current (A)}

The ESP32 reads the voltage and current values, computes the power, and sends this data to the cloud for monitoring.

Online Monitoring Platforms

There are various cloud platforms available for monitoring your solar system. Here are a few examples:

1. Blynk

Blynk provides a user-friendly app interface that allows you to monitor the solar system from your smartphone. You can visualize real-time data, create graphs, and set up notifications.

Advantages of the Solar Power Monitoring System

  1. Real-time Monitoring: Continuous tracking of solar performance ensures immediate detection of any issues.
  2. Remote Access: Data can be accessed from anywhere via the cloud platform.
  3. Scalable: The system can be expanded to monitor multiple solar panels or arrays.
  4. Cost-effective: Using an ESP32 and affordable sensors keeps the system within budget.
  5. Custom Alerts: Set alerts for when the system underperforms, allowing for immediate maintenance.

Conclusion

Building a Solar Power Monitoring Device using ESP32, DC voltage and current sensors, and cloud connectivity provides an efficient and affordable way to keep track of your solar system’s performance. With this device, you can optimize power generation, detect issues early, and ensure that your solar panels are working at maximum efficiency.

The device not only offers local data visualization through an optional LCD display but also provides remote monitoring and historical data analysis through online platforms like Blynk, ThingSpeak, or Firebase. This ensures that your solar investment delivers the best possible returns while contributing to a sustainable, clean energy future.

Share:

No comments: