Introduction: Solar Panel Monitoring Using Particle Photon
Solar energy is the future of energy industry. The countries all around the world are focusing towards renewable and clean sources of energy. The sunlight is the most abundant resource available everywhere and each day. By generating energy using sunlight, the electricity generation can be done without any pollution. There are continuous research and innovations going on to improve the efficiency of solar cells, reduce cost of manufacturing solar panels and improving power distribution from solar plants.
The aim of the project is to improve the efficiency of solar panels. The project is designed to supervise solar photovoltaic power generation to enhance the performance, monitoring and maintenance of the solar plant. With advancement of technologies the cost of renewable energy equipment is going down globally encouraging large scale solar photovoltaic installations. This massive scale of solar photovoltaic deployment requires sophisticated systems for automation of the plant monitoring remotely using web based interfaces as majority of them are installed in inaccessible locations and therefore are easy to be monitored from a dedicated location. The project allows monitoring power output of a solar panel, incident light intensity and the operating temperature.
In this project, the particle photon is interfaced with the voltage output pin of the solar panel, LM-35 temperature sensor and LDR sensor to monitor the power output, temperature and the incident light intensity respectively. A character LCD is also interfaced to the particle photon for real time display of the measured parameters. The Photon not only displays the measured parameters on the LCD screen, but also sends the measured values to the cloud server. For viewing the real-time data and logs sent by the board, the user needs to log in to the registered account from the Particle's official website.
Step 1: Component Required
- Particle Photon $ 20
- 16x2 LCD $3
- Solar plate $ 4
- LM-35 temperature sensor $2
- LDR $1
- Breadboard $4
- Jumper wires $3
The overall cost of the hardware is around $40 dollars.
Note:- Solar plate price may varies according to requirement.
Step 2: Hardware
1. Particle Photon
Photon is a popular IoT board available from the Particle platform. The board houses STM32F205 120Mhz ARM Cortex M3 microcontroller and has 1 MB flash memory, 128 Kb RAM and 18 mixed signal general purpose input output (GPIO) pins with advanced peripherals. The module has on-board Cypress BCM43362 Wi-Fi chip for Wi-Fi connectivity and Single band 2.4GHz IEEE 802.11b/g/n for Bluetooth. The board comes equipped with 2 SPI, one I2S, one I2C, one CAN and one USB interface.
It should be noted that 3V3 is a filtered output used for analog sensors. This pin is the output of the on-board regulator and is internally connected to the VDD of the Wi-Fi module. When powering the Photon via VIN or the USB port, this pin will output a voltage of 3.3VDC. This pin can also be used to power the Photon directly (max input 3.3VDC). When used as an output, the max load on 3V3 is 100mA. The PWM signals have a resolution of 8-bit and run on a frequency of 500 Hz.
2. 16X2 Character LCD
The 16X2 LCD display is used to display the values of the measured parameters. It is connected to the Particle Photon by connecting its data pins D4 to D7 to the pins D0 to D3 of the Particle board. The E and RS pins of the LCD are connected to pins D5 and D6 of the Particle board respectively. The R/W pin of the LCD is grounded.
3. LDR sensor(Photoresistor)
LDR or light dependent resistor is also known as photo resistor, photocell, photoconductor.It is a one type of resistor whose resistance varies depending on the amount of light falling on its surface. When the light falls on the resistor, then the resistance changes. These resistors are often used in many circuits where it is required to sense the presence of light. These resistors have a variety of functions and resistance. For instance, when the LDR is in darkness, then it can be used to turn ON a light or to turn OFF a light when it is in the light. A typical light dependent resistor has a resistance in the darkness of 1MOhm, and in the brightness a resistance of a couple of KOhm.
Working Principle of LDR
This resistor works on the principle of photo conductivity. It is nothing but, when the light falls on its surface, then the material conductivity reduces and also the electrons in the valence band of the device are excited to the conduction band. These photons in the incident light must have energy greater than the band gap of the semiconductor material.This makes the electrons to jump from the valence band to conduction.These devices depend on the light, when light falls on the LDR then the resistance decreases, and increases in the dark.When a LDR is kept in the dark place, its resistance is high and, when the LDR is kept in the light its resistance will decrease. The LDR sensor is used to measure the incident light intensity. Light intensity is expressed in Lux. The sensor is connected to the A2 pin of Particle Photon. The sensor is connected in a potential divider circuit. The LDR provides an analog voltage which is converted to digital reading by the in-built ADC.
4.LM-35 Temperature sensor
LM35 is a precision IC temperature sensor with its output proportional to the temperature (in oC). The operating temperature range is from -55°C to 150°C. The output voltage varies by 10mV in response to every oC rise/fall in ambient temperature, i.e., its scale factor is 0.01V/ oC. The sensor has three pins - VCC, Analogout and Ground. The Aout pin of the LM35 is connected to Analog input pin A0 of the particle photon. The VCC and ground are connected to common VCC and Ground.
- Calibrated directly in Degree Celsius (Centigrade)
- Linear at 10.0 mV/°C scale factor
0.5°C accuracy guarantee-able (at a25°C)
Rated for full -55°C to a 150°C range
Operates from 4 to 30 volts
Less than 60 mA current drain
Low self-heating, 0.08°C instill air
Non-linearity only 0.25°C typical
Low impedance output, 0.1Ωfor 1 mA load
Solar panels are devices that convert light into electricity. They got the name "solar" panels from the word 'Sol' used by astronomers to reference the sun and the sunlight. These are also called photovoltaic panels where Photovoltaic means "light-electricity". The phenomenon of converting the solar energy to electric energy is called photovoltaic effect. This effect generates the voltage and current at the output on the exposure of solar energy. A 3 Volts Solar panel is used in the project. A solar panel consists of several solar cell or photovoltaic diodes. These solar cells are P-N junction diode and they can generate an electric signal in presence of solar light. On exposure to the sunlight, this solar panel generates a DC voltage output of 3.3 V at its terminals. This panel can have maximum output power of 0.72 Watt and minimum output power of 0.6 Watt. Its maximum charging current is 220 mA and minimum charging current is 200 mA. The panel has two terminals - VCC and Ground. The voltage output is drawn from the VCC pin. The voltage output pin is connected to analog input pin A1 of the Particle Photon for measurement of the output power from the solar panel.
Step 3: Software
Particle web IDE
For writing the program code for any Photon, developer needs to create an account on Particle website and register the Photon board with his user account. The program code then can be written on Web IDE at the Particle's website and transferred to a registered photon over the internet. If the selected Particle board, Photon here, is switched on and connected to cloud service of the Particle, the code is burnt to the selected board over the air via internet connection and the board starts operating according to the transferred code. For controlling board over the internet, a web page is designed which uses Ajax and Jquery to send data to the board using HTTP POST method. The web page identifies the board by a device ID and connects to the Particle's Cloud Service through an access token.
How to connect photon with Internet
1. Power your device
- Plug the USB cable into your power source.
- As soon as it is plugged in, the RGB LED on your device should begin blinking blue.If your device is not blinking blue, hold down the SETUP button.If your device is not blinking at all, or if the LED is burning a dull orange color, it may not be getting enough power. Try changing your power source or USB cable.
2. Connect your Photon to the Internet
There are two ways either you use web application or mobile app
a. Using web application
- Step 1 Go to setup.particle.io
- Step 2 Click on setup a Photon
- Step 3 After clicking on NEXT, you should be presented with a file (photonsetup.html)
- Step 4 Open the file.
- Step 5 After opening the file connect your PC to the Photon, by connecting to the network named PHOTON.
- Step 6 Configure your Wi-Fi credentials.Note: If you mistyped your credentials, the Photon will blink dark blue or green. You have to go through the process again (by refreshing the page or clicking on the retry process part)
- Step 7 Rename your device. You will also see a confirmation if the device was claimed or not.
b. Using smartphone
- Open the app on your phone. Log in or sign up for an account with Particle if you don't have one.
- After login, press the plus icon and select the device you'd like to add. Then follow the instructions on the screen to connect your device to Wi-Fi.
If this is your Photon's first time connecting, it will blink purple for a few minutes as it downloads updates. It may take 6-12 minutes for the updates to complete, depending on your internet connection, with the Photon restarting a few times in the process. Do not restart or unplug your Photon during this time. If you do, you may need to follow this guide to fix your device.
Once you have connected your device, it has learned that network. Your device can store up to five networks. To add a new network after your initial setup, you'd put your device into Listening Mode again and proceed as above. If you feel like your device has too many networks on it, you can wipe your device's memory of any Wi-Fi networks it has learned. You can do so by continuing to hold the setup button for 10 seconds until the RGB LED flashes blue quickly, signaling that all profiles have been deleted.
- Cyan, your Photon is connected to the Internet.
- Magenta, it is currently loading an app or updating its firmware. This state is triggered by a firmware update or by flashing code from the Web IDE or Desktop IDE. You might see this mode when you connect your Photon to the cloud for the first time.
- Green, it is trying to connect to the internet.
- White, the Wi-Fi module is off.
Particle Build is an Integrated Development Environment, or IDE that means that you can do software development in an easy-to-use application, which just so happens to run in your web browser.
- To open build, login to your particle account and then click on build as shown in image.
Once you clicked you will see console like this.
To create a new create app, click on create new app.
To include library in program, go to libraries section, search for liquidcrystal.Then select an app in which you want to add library. In my case it is solarpanelmonitoring.
To verify the program. Click on verify.
To upload the code, click on flash but before doing that select a device.If you have more than one device you have to make sure that you have selected which of your devices to flash code to. Click on the "Devices" icon at the bottom left side of the navigation pane, then when you hover over device name the star will appear on the left. Click on it to set the device you had like to update (it won't be visible if you have only one device). Once you have selected a device, the star associated with it will turn yellow. (If you only have one device, there is no need to select it, you can continue.
Step 4: How the Circuit Works
In the circuit, 6 GPIO pins of the module are used to interface the character LCD and three analog input pins are used to interface LM-35 temperature sensor, Solar Panel and the LDR sensor.
Once the circuit is assembled, it is ready to deploy along with the solar panel. While the solar panel keeps generating electricity, the attached to the device. The device is powered from the mains supply that is managing the other performance enhance equipment as well. Once the device is powered on, some initial messages are flashed on its LCD display indicating the intent of the application. The power output of the panel, temperature and the incident light intensity are measured by the Voltage Output pin of the solar panel, LM-35 temperature sensor and the LDR sensor respectively. The Voltage Output pin of the solar panel, LM-35 temperature sensor and the LDR sensor are connected to the analog input pins A1, A0 and A2 of the Particle Photon.
The respective parameters are measured by sensing the analog voltage at the respective pins. The analog voltage sensed at the respective pins is converted to digital values using in-built ADC channels. The Particle Photon has 12-bit ADC channels. So the digitized values can range from 0 to 4095. Here, it is assumed that the resistive network interfacing LDR sensor with the controller pin is calibrated to indicate light intensity by direct proportionality.
The LM-35 IC does not require any external calibration or trimming to provide typical accuracies of ±0.25 °C at room temperature and ±0.75 °C over temperature range from −55 °C to 150 °C. Under normal conditions, the temperature measured by the sensor won't exceed or recede the operational range of the sensor. By trimming and calibration at the wafer level, the use of sensor at lower cost is thereby assured. Due to low-output impedance, linear output, and precise inherent calibration of the LM-35, the interfacing of the sensor to a control circuitry is easy. As the LM-35 device draws only 60 uA from the supply, it has very low self-heating of less than 0.1 °C in still air. Typically in the temperature range from −55 °C to 150 °C, the voltage output of the sensor increases by 10 mV per degree Celsius. The voltage output of the sensor is given by the following formulae
Vout = 10 mV/°C*T
Vout = Voltage output of the sensor
T = Temperature in degree Celsius So,
T (in °C) = Vout/10 mV
T (in °C) = Vout(in V)*100
If VDD is assumed to be 3.3 V, the analog reading is related to the sensed voltage over 12-bit range by the following formula
Vout = (3.3/4095)*Analog-Reading
So, the temperature in degree Celsius can be given by the following formulae
T (in °C) = Vout(in V)*100
T (in °C) = (3.3/4095)*Analog-Reading *100
So, the temperature can be measured directly by sensing the analog voltage output from the sensor. The analogRead() function is used to read analog voltage at the controller pin. The voltage output of the solar panel should be typically 3 V which can be directly sensed by the Particle Photon. The Particle photon can directly sense voltage up to 3.3 V. For digitization of the sensed analog voltage, it is again internally referenced to the VDD. The digitized voltage reading is scaled over the 12-bit range i.e. 0 to 4095. So
Vout = (3.3/4095)*Analog-Reading
The read sensor data is first displayed on the LCD display and then is passed to the Particle Cloud via Wi-Fi connection. The user needs to login into the Particle's registered account in order to view the read sensor values. The platform allows connecting to a board from the registered account. The user can monitor received sensor data in real time and can also log data.
Step 5: Connections and Circuit Diagram
Photon ==> LCD
- D6 ==> RS
- D5 ==> Enable
- D3 ==> DB4
- D2 ==> DB5
- D1 ==> DB6
- D0 ==> DB7
Photon ==> LM-35
- A0 ==> Aout
Photon ==> LDR
- A2 ==> Vcc
Photon ==> Solar plate
- A1 ==> Vcc
Step 6: Result
Step 7: Program
// To be used in Particle Web IDE
#include // library for LCD
LiquidCrystal lcd(6, 5, 3, 2, 1, 0); // LCD connection
/* LCD ==> Particle RS ==> D6 Enable ==> D5 DB4 ==> D3 DB5 ==> D2 DB6 ==> D1 DB7 ==> D0
float reading = 0;
float Temperature = 0;
float temp1 = 0;
float volts = 0;
float value = 0;
float volt = 0;
float lux = 0;
byte degree =
//array of byte is declared and initialized to display the special character //degree symbol on the LCD.
Serial.begin(9600); // baudrate 9600
lcd.begin(16,2); // Initialize the LCD
lcd.print(" Solar Panel ");
lcd.print(" Monitoring ");
lcd.print(" For ");
pinMode(A0, INPUT); // interface LM-35 to A0 pin of particle
pinMode(A1, INPUT); // interface solar plate to A1 pin of particle
pinMode(A2, INPUT); // interface LDR to A2 pin of particle
reading=analogRead(A0); // Read values from LM-35
Temperature=(reading*0.80); //Temperature=(reading*3.3*100)/4096; // 3.3V/4095= 0.80 Temperature = (Temperature/10); // LM35 gives output of 10mv/°C delay(10);
volts= (temp1*3.3)/4095; //volts= (temp1/511.5)*3;
lux=analogRead(A2); volt= (lux/4095*100);
// To see events on console
Particle.publish("Light Intensity", String(lux));