Design of an Intelligent Solar Panel Cleaning System Based on NB-IoT

As a key alternative to fossil fuels, solar energy has gained increasing attention. With the rapid expansion of the photovoltaic industry, large-scale solar panel arrays are deployed in remote areas, where dust accumulation on solar panel surfaces significantly reduces energy conversion efficiency and shortens equipment lifespan. Traditional cleaning methods rely on periodic manual intervention, which is inefficient and costly. To address these challenges, this paper presents a novel intelligent solar panel cleaning system that leverages NB-IoT (Narrowband Internet of Things) technology for real-time monitoring, automated cleaning, and remote cloud-based control. The system integrates a custom-designed hardware platform with a software framework that enables data acquisition, cleaning decision-making, and wireless communication. Experimental results from a field test over nine months demonstrate that the proposed system improves overall solar panel power generation efficiency by up to 17.7% in certain months, with a cumulative increase of 9.6% compared to conventional fixed installations. This solution offers a cost-effective and scalable approach for small to medium-sized solar panel installations, enhancing both energy yield and operational intelligence.

1. System Architecture

The intelligent solar panel cleaning system consists of two primary components: the cleaning control host (embedded hardware) and the upper computer monitoring software (cloud platform). The cleaning control host collects light intensity signals and solar panel power generation data to assess the level of dust contamination on the solar panel surface. Based on the degree of pollution, the system autonomously decides whether to initiate the cleaning process. During operation, the host transmits real-time data—including light intensity, power output, cleaning position, and its own power supply status—to a cloud platform via an NB-IoT wireless module. The upper computer (PC or mobile terminal) accesses the cloud data to monitor cleaning progress, battery level, and fault conditions. It can also send remote control commands to the cleaning device. The overall system framework is illustrated conceptually below.

2. Hardware Design of the Intelligent Solar Panel Cleaning System

The host hardware is built around a STM32F103C8T6 microcontroller, which serves as the central processing unit. Key peripheral circuits include: a MAX44009 ambient light sensor, a photovoltaic (PV) power monitoring circuit, limit switch interfaces, a motor driver (MPC17529), an NB86-G NB-IoT communication module, and a serial touch screen for local human-machine interaction. The entire system is powered by a dedicated small solar panel.

2.1 Main Control Module

The STM32F103C8T6 microcontroller is a 32-bit ARM Cortex-M3 processor running at up to 72 MHz. It features multiple USART, SPI, I2C, and CAN interfaces, allowing easy expansion. The debugging interface uses SWD (Serial Wire Debug) with two signals (SWDIO and SWCLK). An external 8 MHz crystal provides the main clock, and a 32.768 kHz low-speed crystal is used for real-time clock management. The MCU resource allocation is summarized in Table 1.

Table 1: MCU Resource Allocation for Solar Panel Cleaning System
Peripheral Pin/Interface Function
I2C1 PB6 (SCL), PB7 (SDA) MAX44009 light sensor
USART2 PA2 (TX), PA3 (RX) NB-IoT module (NB86-G)
USART1 PA9 (TX), PA10 (RX) Serial touch screen
ADC1 (IN0) PA0 Solar panel voltage measurement
ADC1 (IN1) PA1 Solar panel current measurement
GPIO (Input) PB0–PB3 Limit switches (4 positions)
Timer1 (PWM) PA8, PA9, PA10 Motor speed control (3 motors)

2.2 Light Intensity Sensing Module

We use the MAX44009 ambient light sensor from Maxim Integrated. This digital sensor offers a 22-bit dynamic range with a minimum resolution of 0.045 lux and a maximum measurable intensity of 188,000 lux. It communicates via the I2C bus and includes an on-chip optical filter to block UV and IR interference. The sensor reading is used to compute the ratio of actual solar panel output voltage to the expected output under clean conditions at the same light level. This ratio indicates the degree of dust coverage. The circuit connections are straightforward: VCC to 3.3V, GND to ground, SCL and SDA to the MCU I2C lines, and the INT pin to a GPIO for interrupt-driven reading.

2.3 Motor Driver Module

The cleaning mechanism includes three DC motors: one for horizontal traversal, one for vertical movement, and one for the rotating brush. Two MPC17529 dual H-bridge motor driver ICs are used. Each IC can independently control two motors with bidirectional drive and PWM speed control. The MCU outputs control signals to set direction (logic level) and speed (PWM duty cycle). Table 2 summarizes the motor control logic.

Table 2: Motor Control Signal Mapping
Motor Driver IC IN1 Pin IN2 Pin PWM Pin Direction (IN1,IN2)
Horizontal U1 (MPC17529) PA8 PA9 PA10 (Timer1 CH1) Forward: (1,0); Reverse: (0,1)
Vertical U1 (MPC17529) PB4 PB5 PA11 (Timer1 CH2) Forward: (1,0); Reverse: (0,1)
Brush U2 (MPC17529) PB6 PB7 PA12 (Timer1 CH3) Forward: (1,0); Reverse: (0,1)

2.4 NB-IoT Communication Module

We employ the NB86-G module (based on the Boudica 150 chipset) from Lierda. This module complies with 3GPP R13/R14 and supports multiple bands (Band 5, Band 8, Band 28). It connects to the STM32 via USART2. The AT command set is used to configure network parameters, establish connection to the IoT cloud platform, and send data packets. The circuit includes a SIM card holder, an antenna interface, and level-shifting resistors since the module operates at 3.3V logic. The key AT commands used are:

  • AT+NRB – Reset the module.
  • AT+CGATT=1 – Attach to the network.
  • AT+NBAND=5 – Set frequency band (example).
  • AT+NMGS=<len>,<data> – Send data to the cloud.

The module transmits a JSON-like payload containing the device ID, timestamp, light intensity (lux), solar panel voltage (V), current (A), calculated dust factor, and cleaning status.

2.5 Limit Switch Design

To prevent the cleaning mechanism from overrunning the edges of the solar panel array, four mechanical limit switches are installed at the four boundaries (top, bottom, left, right). When the carriage contacts a switch, the MCU detects a digital low (or high) signal and immediately reverses the corresponding motor direction. The limit switch signals are debounced in software with a 20 ms timer. The cleaning path is a raster scan: horizontal step, vertical sweep, then next horizontal step, until all switches are triggered and the device returns to the home position.

3. Software Design of the Intelligent Solar Panel Cleaning System

3.1 Overall Software Structure

The firmware is developed using the Keil MDK environment with the µC/OS-II real-time operating system. Five tasks are created:

  • Task1: Data Acquisition – Reads light intensity and PV power data every 100 ms.
  • Task2: Limit Switch Monitoring – Polls limit switches every 50 ms.
  • Task3: Motor Control – Updates motor PWM and direction based on cleaning state machine.
  • Task4: HMI Interface – Refreshes the serial touch screen with status information.
  • Task5: NB-IoT Communication – Sends and receives data packets every 30 seconds.

The main program initializes the microcontroller peripherals, creates tasks, and starts the OS scheduler. The cleaning logic is implemented as a state machine with states: IDLE, CLEANING, PAUSED, FAULT, and RETURN_TO_HOME.

3.2 Data Acquisition Software

The MAX44009 is read over I2C using a simulated master mode. The sensor provides two registers: one for the exponent and one for the mantissa. The light intensity in lux is calculated as:

$$ L = 0.045 \times 2^{E} \times M $$

where \(E\) is the exponent (bits 7:4 of the upper register) and \(M\) is the mantissa (bits 7:0 of the lower register combined with bits 3:0 of the upper register). The code snippet for reading is:

uint32_t Max44009_ReadLigth(void) {
    uint8_t readData_L = 0, readData_H = 0;
    uint8_t luxExponent = 0, luxMantissa = 0;
    uint32_t lightIntensity = 0;
    IIC_Write(MAX44009_ADDR, &MAX44009_REG_L, 1);
    IIC_Read(MAX44009_ADDR, &readData_L, 1);
    IIC_Write(MAX44009_ADDR, &MAX44009_REG_H, 1);
    IIC_Read(MAX44009_ADDR, &readData_H, 1);
    luxExponent = (readData_H >> 4) & 0x0F;
    luxMantissa = ((readData_H << 4) | (readData_L >> 4)) & 0xFF;
    lightIntensity = (uint32_t)(pow(2, (double)luxExponent) * luxMantissa * 0.045);
    return lightIntensity;
}

The solar panel voltage and current are sampled by the built-in 12-bit ADC. The raw ADC values are converted to actual voltage using a voltage divider ratio of 10:1 (since the maximum panel voltage is about 50V, stepped down to 5V max, then further scaled to 0–2.5V using an op-amp). The conversion formula is:

$$ V_{panel} = \frac{ADC\_value \times 2.5}{4095} \times 10 $$

Similarly, current is measured via a shunt resistor (0.1 Ω) and an instrumentation amplifier with gain of 50, giving:

$$ I_{panel} = \frac{ADC\_value \times 2.5}{4095 \times 0.1 \times 50} $$

3.3 Cleaning Motion Control

The cleaning path algorithm is a raster scan. The state machine transitions are:

  • IDLE: Wait for start command (either automatic based on dust level or manual from cloud).
  • CLEANING: Move horizontally one brush width (e.g., 30 cm), then sweep vertically from top to bottom while brush rotates. When bottom limit switch is triggered, reverse vertical direction and sweep upward. Continue until the rightmost limit switch is triggered.
  • RETURN_TO_HOME: Reverse horizontal motor to move back to the leftmost limit switch, then stop.

The PWM duty cycle for the brush motor is fixed at 80% for optimal cleaning, while the traverse motors use 50% duty for smooth motion. The motor control task updates the driver registers every 10 ms.

3.4 NB-IoT Communication Protocol

The data packet sent to the cloud follows a simple JSON structure:

{
  "deviceId": "SPC001",
  "timestamp": 1621234567,
  "light_lux": 85000,
  "panel_voltage": 48.2,
  "panel_current": 5.3,
  "dust_factor": 0.92,
  "cleaning_status": "CLEANING",
  "battery_voltage": 12.1
}

The dust factor is defined as the ratio of measured power output to the expected power output under the same light intensity for a clean solar panel. Let \(P_{actual} = V_{panel} \times I_{panel}\). The expected power for a clean panel under given light \(L\) is obtained from a pre-calibrated lookup table. Then:

$$ Dust\_Factor = \frac{P_{actual}}{P_{expected}(L)} $$

When Dust_Factor drops below a configurable threshold (e.g., 0.85), the system automatically initiates cleaning. The cloud platform also allows manual override. The NB-IoT module sends the packet every 30 seconds during operation and every 10 minutes when idle to save power.

4. Experimental Results and Data Analysis

We conducted a field test on an 8 kW fixed photovoltaic array located at a test site with identical orientation, tilt angle, and environmental conditions. Two sets of solar panels were compared: one without any cleaning system (conventional) and the other equipped with the proposed intelligent cleaning system. The test ran from July 2020 to March 2021, covering varying seasons and weather patterns. Table 3 summarizes the monthly energy generation data.

Table 3: Monthly Energy Generation Comparison (kWh)
Month Without Cleaning (kWh) With Cleaning (kWh) Increase (kWh) Efficiency Improvement (%)
Jul 2020 620 645 25 4.0%
Aug 2020 931 975 44 4.7%
Sep 2020 865 919 54 6.3%
Oct 2020 521 560 39 7.5%
Nov 2020 523 569 46 10.4%
Dec 2020 535 592 57 10.7%
Jan 2021 668 744 76 11.4%
Feb 2021 669 788 119 17.7%
Mar 2021 722 843 121 16.7%
Total 6054 6635 591 9.6%

The data clearly show that during the first two months, the difference was small (4–4.7%). As dust accumulated on the conventional solar panels, their efficiency degraded significantly—by November, the monthly improvement reached 10.4%, and by February 2021, it peaked at 17.7%. Over the entire nine-month period, the cleaned solar panels produced 591 kWh more energy, representing a 9.6% cumulative efficiency gain. This validates that the intelligent cleaning system effectively maintains high solar panel performance.

Figure 2 (conceptual) shows a sample cloud monitoring dashboard displaying live data from the test site. The dashboard includes real-time charts for light intensity, panel voltage, current, and dust factor history. Remote control buttons allow operators to start/stop cleaning or set thresholds.

5. Conclusion

This paper presents a comprehensive design of an intelligent solar panel cleaning system based on NB-IoT technology. The system integrates a STM32-based controller, a MAX44009 light sensor, MPC17529 motor drivers, and an NB86-G NB-IoT module to realize automatic dust detection, cleaning, and remote monitoring. The hardware design is modular and cost-effective. The software architecture uses a real-time operating system to manage multiple tasks efficiently. Field test results over nine months demonstrate that the system improves solar panel power generation by up to 17.7% monthly, with a cumulative increase of 9.6%. The solution meets the requirements of small to medium-scale solar panel installations, reduces manual maintenance costs, and enhances overall energy yield. Future work will focus on optimizing cleaning path algorithms using machine learning for predictive dust accumulation, and integrating edge AI for on-board decision making.

Scroll to Top